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

@@ -78,22 +78,20 @@ NetStatWin_Init:
ldi r16, NETSTATWIN_TIMERVAL
std Y+NETSTATWIN_OFFS_TIMER, r16
bigcall MainWindow_GetContentWidget ; r19:r18=content window
brcc NetStatWin_Init_ret
mov xl, r18 ; use content window as parent
mov xh, r19
; Y=MainWindow
push yl
push yh
bigcall MainWindow_GetContentWidget ; r19:r18=content window
brcc NetStatWin_Init_popRet
mov xl, r18 ; use content window as parent
mov xh, r19
push xl ; content window
push xh
rcall netStatWinCreateContent
pop xh
pop xl
brcc NetStatWin_Init_popRet
bigcall C03App_CreateBackButton
NetStatWin_Init_popRet:
pop yh
pop yl
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
;
@@ -136,19 +150,16 @@ NetStatWin_OnTimer_ret:
netStatWinCreateContent:
; create MLayout
push yl
push yh
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, MLAYOUT_MODE_COLUMNS
ldi r21, 2 ; columns per row
bigcall MLayout_new
mov xl, yl ; use MLayout as parent
mov xh, yh
pop yh
pop yl
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, MLAYOUT_MODE_COLUMNS
ldi r21, 2 ; columns per row
bigcall MLayout_new
brcc netStatWinCreateContent_ret
mov xl, yl ; use MLayout as parent
mov xh, yh
ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN)
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN)
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
@@ -342,7 +353,8 @@ NetStatWin_DefaultSignalmap:
; header
.dw MainWindow_DefaultSignalmap*2 ; next table to use
; 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