c03: more work on climate and netstats windows.

This commit is contained in:
Martin Preuss
2026-04-07 23:56:14 +02:00
parent d7074388e6
commit 5a9bff2d0b
2 changed files with 55 additions and 23 deletions

View File

@@ -38,18 +38,39 @@ ClimateWin_new:
brcc ClimateWin_new_ret brcc ClimateWin_new_ret
mov xl, r18 ; use root window as parent for main window mov xl, r18 ; use root window as parent for main window
mov xh, r19 mov xh, r19
ldi r24, LOW(CLIMATEWIN_SIZE)
ldi r25, HIGH(CLIMATEWIN_SIZE)
bigcall Object_Alloc ; Y=space (!r16, !r17, !X)
brcc ClimateWin_new_ret
rcall ClimateWin_Init
ClimateWin_new_ret:
ret
; @end
; ---------------------------------------------------------------------------
; @routine ClimateWin_new @global
;
; @param Y pointer to newly allocated widget data
; @param X pointer to root window
; @return CFLAG set of okay, cleared otherwise
; @clobbers any, !Y
ClimateWin_Init:
ldi r16, 0 ; OPTS ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, LOW(RESSSOURCE_TXT_ROOMCLIMATE) ldi r20, LOW(RESSSOURCE_TXT_ROOMCLIMATE)
ldi r21, HIGH(RESSSOURCE_TXT_ROOMCLIMATE) ldi r21, HIGH(RESSSOURCE_TXT_ROOMCLIMATE)
bigcall MainWindow_new ; Y=main window bigcall MainWindow_new ; Y=main window
brcc ClimateWin_new_ret brcc ClimateWin_Init_ret
bigcall MainWindow_GetContentWidget ; r19:r18=content window bigcall MainWindow_GetContentWidget ; r19:r18=content window
brcc ClimateWin_new_ret brcc ClimateWin_Init_ret
mov xl, r18 ; use content window as parent mov xl, r18 ; use content window as parent
mov xh, r19 mov xh, r19
; Y=MainWindow
push yl ; main window push yl ; main window
push yh push yh
push xl ; content window push xl ; content window
@@ -60,7 +81,7 @@ ClimateWin_new:
bigcall C03App_CreateBackButton bigcall C03App_CreateBackButton
pop yh ; main window pop yh ; main window
pop yl pop yl
ClimateWin_new_ret: ClimateWin_Init_ret:
ret ret
; @end ; @end
@@ -71,7 +92,6 @@ ClimateWin_new_ret:
; ;
; @param X pointer to MainWindow content window (becomes parent) ; @param X pointer to MainWindow content window (becomes parent)
; @return CFLAG set of okay, cleared otherwise ; @return CFLAG set of okay, cleared otherwise
; @return Y address of newly created object
climateWinCreateSensorWatches: climateWinCreateSensorWatches:
ldi r16, 0 ; OPTS ldi r16, 0 ; OPTS

View File

@@ -78,22 +78,20 @@ NetStatWin_Init:
ldi r16, NETSTATWIN_TIMERVAL ldi r16, NETSTATWIN_TIMERVAL
std Y+NETSTATWIN_OFFS_TIMER, r16 std Y+NETSTATWIN_OFFS_TIMER, r16
; Y=MainWindow
push yl
push yh
bigcall MainWindow_GetContentWidget ; r19:r18=content window bigcall MainWindow_GetContentWidget ; r19:r18=content window
brcc NetStatWin_Init_popRet brcc NetStatWin_Init_ret
mov xl, r18 ; use content window as parent mov xl, r18 ; use content window as parent
mov xh, r19 mov xh, r19
; Y=MainWindow
push yl
push yh
push xl ; content window push xl ; content window
push xh push xh
rcall netStatWinCreateContent rcall netStatWinCreateContent
pop xh pop xh
pop xl pop xl
brcc NetStatWin_Init_popRet
bigcall C03App_CreateBackButton bigcall C03App_CreateBackButton
NetStatWin_Init_popRet:
pop yh pop yh
pop yl pop yl
NetStatWin_Init_ret: NetStatWin_Init_ret:
@@ -127,6 +125,22 @@ NetStatWin_OnTimer_ret:
NetStatWin_OnShow:
bigcall Widget_OnShow
push yl
push yh
rcall netStatWinUpdate
pop yh
pop yl
; reset timer
ldi r16, NETSTATWIN_TIMERVAL
std Y+NETSTATWIN_OFFS_TIMER, r16
sec
ret
; @end
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine netStatWinCreateContent ; @routine netStatWinCreateContent
; ;
@@ -136,18 +150,15 @@ NetStatWin_OnTimer_ret:
netStatWinCreateContent: netStatWinCreateContent:
; create MLayout ; create MLayout
push yl
push yh
ldi r16, 0 ; OPTS ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, MLAYOUT_MODE_COLUMNS ldi r20, MLAYOUT_MODE_COLUMNS
ldi r21, 2 ; columns per row ldi r21, 2 ; columns per row
bigcall MLayout_new bigcall MLayout_new
brcc netStatWinCreateContent_ret
mov xl, yl ; use MLayout as parent mov xl, yl ; use MLayout as parent
mov xh, yh mov xh, yh
pop yh
pop yl
brcc netStatWinCreateContent_ret
ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN) ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN)
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN) ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN)
@@ -343,6 +354,7 @@ NetStatWin_DefaultSignalmap:
.dw MainWindow_DefaultSignalmap*2 ; next table to use .dw MainWindow_DefaultSignalmap*2 ; next table to use
; entries ; entries
.db 0, OBJECT_SIGNAL_TIMER, LOW(NetStatWin_OnTimer), HIGH(NetStatWin_OnTimer) .db 0, OBJECT_SIGNAL_TIMER, LOW(NetStatWin_OnTimer), HIGH(NetStatWin_OnTimer)
.db 0, WIDGET_SIGNAL_SHOW, LOW(NetStatWin_OnShow), HIGH(NetStatWin_OnShow)
.db 0, 0, 0, 0 ; end of table .db 0, 0, 0, 0 ; end of table