c03: more work on climate and netstats windows.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
bigcall MainWindow_GetContentWidget ; r19:r18=content window
|
||||||
|
brcc NetStatWin_Init_ret
|
||||||
|
mov xl, r18 ; use content window as parent
|
||||||
|
mov xh, r19
|
||||||
|
|
||||||
; Y=MainWindow
|
; Y=MainWindow
|
||||||
push yl
|
push yl
|
||||||
push yh
|
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 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,19 +150,16 @@ NetStatWin_OnTimer_ret:
|
|||||||
|
|
||||||
netStatWinCreateContent:
|
netStatWinCreateContent:
|
||||||
; create MLayout
|
; create MLayout
|
||||||
push yl
|
ldi r16, 0 ; OPTS
|
||||||
push yh
|
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||||
ldi r16, 0 ; OPTS
|
ldi r20, MLAYOUT_MODE_COLUMNS
|
||||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
ldi r21, 2 ; columns per row
|
||||||
ldi r20, MLAYOUT_MODE_COLUMNS
|
bigcall MLayout_new
|
||||||
ldi r21, 2 ; columns per row
|
|
||||||
bigcall MLayout_new
|
|
||||||
mov xl, yl ; use MLayout as parent
|
|
||||||
mov xh, yh
|
|
||||||
pop yh
|
|
||||||
pop yl
|
|
||||||
brcc netStatWinCreateContent_ret
|
brcc netStatWinCreateContent_ret
|
||||||
|
|
||||||
|
mov xl, yl ; use MLayout as parent
|
||||||
|
mov xh, yh
|
||||||
|
|
||||||
ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN)
|
ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN)
|
||||||
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN)
|
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN)
|
||||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||||
@@ -342,7 +353,8 @@ NetStatWin_DefaultSignalmap:
|
|||||||
; header
|
; header
|
||||||
.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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user