changeset 326:d21b172d5a7a new_screen_layout

VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
author Janos Kovacs <kovjanos@gmail.com>
date Sat, 13 Jun 2015 22:53:05 +0200
parents d82516b8298e
children ca5df826437a
files src/comm.asm src/hwos.inc src/menu_tree.asm src/option_table.asm src/text_english.inc src/text_french.inc src/text_german.inc src/text_italian.inc src/tft_outputs.asm
diffstat 9 files changed, 63 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/comm.asm	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/comm.asm	Sat Jun 13 22:53:05 2015 +0200
@@ -959,6 +959,8 @@
     movff   opt_modwarning, TXREG1          ; RCREG1=0x3E
     dcfsnz  WREG
     movff   opt_vsitextv2, TXREG1           ; RCREG1=0x3F
+    dcfsnz  WREG
+    movff   opt_vsigraph, TXREG1            ; RCREG1=0x40
 
 
 comm_read_abort:
@@ -1244,6 +1246,8 @@
     movff   RCREG1, opt_modwarning          ; RCREG1=0x3E
     dcfsnz  WREG
     movff   RCREG1, opt_vsitextv2           ; RCREG1=0x3F
+    dcfsnz  WREG
+    movff   RCREG1, opt_vsigraph            ; RCREG1=0x40
 
 
 comm_write_abort:
--- a/src/hwos.inc	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/hwos.inc	Sat Jun 13 22:53:05 2015 +0200
@@ -573,6 +573,7 @@
 opt_cR_button_right     res 1   ; Right button sensitivity (cR hardware)
 opt_modwarning          res 1   ; =1:do a red blinking warning, =0:default behaviour
 opt_vsitextv2           res 1   ; =1:use the depth dependent ascend rate limits
+opt_vsigraph            res 1   ; =1:draw the graphical VSI bar
 
 ;-----------------------------EEPROM DATA ------------------------------------
 ; Automatic reset of all options when this is changed:
--- a/src/menu_tree.asm	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/menu_tree.asm	Sat Jun 13 22:53:05 2015 +0200
@@ -343,6 +343,10 @@
         MENU_CALL   tExit,          do_continue_main_menu
     MENU_END
 
+
+do_return_settings_more:
+        call    menu_processor_pop              ; Drop exit entry
+        call    menu_processor_pop              ; Pop return line.
     
 do_settings_menu_more:
     btfsc   rechargeable            ; piezo buttons available
@@ -407,7 +411,7 @@
     MENU_BEGIN  tSystSets, .2
         MENU_CALL   tCompassMenu,   compass_calibration_loop
 ;        MENU_OPTION tCompassGain,   oCompassGain,       0
-        MENU_CALL   tExit,          do_return_settings
+        MENU_CALL   tExit,          do_return_settings_more
     MENU_END
 
 ;=============================================================================
@@ -566,7 +570,7 @@
 		MENU_CALL       tLogOffsetp10,				do_logoffset_plus10
 		MENU_CALL       tLogOffsetm1,				do_logoffset_minus1
 		MENU_CALL       tLogOffsetm10,				do_logoffset_minus10
-        MENU_CALL       tExit,                  	do_dispsets_menu_3stack
+        MENU_CALL       tExit,                  	do_return_settings_more
     MENU_END
 
 
@@ -619,10 +623,17 @@
         MENU_CALL   tColorScheme,                 do_color_scheme
         MENU_OPTION tFlip,         oFlipScreen,   0
         MENU_OPTION tMODwarning,   oMODwarning,   0
-        MENU_OPTION tVSItextv2,    oVSItextv2,    0
+        MENU_CALL   tDispSetVSI,                  do_dispsets_VSI_menu
         MENU_CALL   tExit,                        do_return_settings
     MENU_END
 
+do_dispsets_VSI_menu:
+    MENU_BEGIN  tDispSetVSItitle, .4
+        MENU_DYNAMIC    TFT_VSImenu_dynamictitle,     0
+        MENU_OPTION     tVSItext2,     oVSItextv2,    0
+        MENU_OPTION     tVSIgraph,     oVSIgraph,     0
+        MENU_CALL       tExit,                        do_dispsets_menu_3stack
+    MENU_END
 
     extern  oColorSetDive
 do_color_scheme:
--- a/src/option_table.asm	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/option_table.asm	Sat Jun 13 22:53:05 2015 +0200
@@ -200,7 +200,8 @@
         OPTION_UINT8    obottom_usage,  .5,.50,   .20,tLitersMinute,  .154,    char_I_bottom_usage              ; l/min
         OPTION_UINT8    odeco_usage,    .5,.50,   .20,tLitersMinute,  .155,    char_I_deco_usage                ; l/min
         OPTION_BOOL     oMODwarning,    0,                            .156,    opt_modwarning                   ; =1: red depth blinking warning
-        OPTION_BOOL     oVSItextv2,     0,                            .157,    opt_vsitextv2                    ; =1: use the dynamic ascend rate limits
+        OPTION_BOOL     oVSItextv2,     0,                            .157,    opt_vsitextv2                    ; =1: use the dynamic (depends on depth) ascend rate limits
+        OPTION_BOOL     oVSIgraph,      0,                            .158,    opt_vsigraph                     ; =1: draw the graphical VSI bar
 
 ;=============================================================================
 ; Set Time/Set Date (RAM only)
--- a/src/text_english.inc	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/text_english.inc	Sat Jun 13 22:53:05 2015 +0200
@@ -136,7 +136,13 @@
     TCODE   tDvSalinity,"Salinity:"             ; Salinity
     TCODE   tFlip,      "Rotate Screen:"        ; Rotate Screen
     TCODE   tMODwarning,"MOD warning:"          ; MOD warning
-    TCODE   tVSItextv2, "Dyn asc rate lim:"     ; Dyn asc rate lim
+    TCODE   tDispSetVSI,"VSI Settings..."       ; VSI Settings...
+
+; VSI display Settings
+    TCODE   tDispSetVSItitle, "VSI Display Settings"     ; VSI display Settings
+    TCODE   tVSItext1,        "Depth based variable"     ; max 20 chars: "Depth based variable", first line of the option
+    TCODE   tVSItext2,        "   ascend limit: "        ; max 17 chars: "   ascend limit: ", second line, with space prefix
+    TCODE   tVSIgraph,        "Graphical VSI:   "        ; max 17 chars: "Graphical VSI:   "
 
 ; Setup Menu
     TCODE   tSystSets,  "Settings"
--- a/src/text_french.inc	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/text_french.inc	Sat Jun 13 22:53:05 2015 +0200
@@ -136,7 +136,13 @@
     TCODE   tDvSalinity,"Salinité:"             ; Salinity
     TCODE   tFlip,      "Pivoter l'écran:"      ; Rotate Screen
     TCODE   tMODwarning,"MOD warning:"          ; MOD warning
-    TCODE   tVSItextv2, "Dyn asc rate lim:"     ; Dyn asc rate lim
+    TCODE   tDispSetVSI,"VSI Settings..."       ; VSI Settings...
+
+; VSI display Settings
+    TCODE   tDispSetVSItitle, "VSI Display Settings"     ; VSI display Settings
+    TCODE   tVSItext1,        "Depth based variable"     ; max 20 chars: "Depth based variable", first line of the option
+    TCODE   tVSItext2,        "   ascend limit: "        ; max 17 chars: "   ascend limit: ", second line, with space prefix
+    TCODE   tVSIgraph,        "Graphical VSI:   "        ; max 17 chars: "Graphical VSI:   "
 
 ; Setup Menu
     TCODE   tSystSets,  "Réglages"
--- a/src/text_german.inc	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/text_german.inc	Sat Jun 13 22:53:05 2015 +0200
@@ -136,7 +136,13 @@
     TCODE   tDvSalinity,"Salinität:"             ; Salinity
     TCODE   tFlip,      "Anzeige drehen:"        ; Rotate Screen
     TCODE   tMODwarning,"MOD Warnung:"           ; MOD warning
-    TCODE   tVSItextv2, "Dyn asc rate lim:"     ; Dyn asc rate lim
+    TCODE   tDispSetVSI,"VSI Settings..."       ; VSI Settings...
+
+; VSI display Settings
+    TCODE   tDispSetVSItitle, "VSI Display Settings"     ; VSI display Settings
+    TCODE   tVSItext1,        "Depth based variable"     ; max 20 chars: "Depth based variable", first line of the option
+    TCODE   tVSItext2,        "   ascend limit: "        ; max 17 chars: "   ascend limit: ", second line, with space prefix
+    TCODE   tVSIgraph,        "Graphical VSI:   "        ; max 17 chars: "Graphical VSI:   "
 
 ; Setup Menu
     TCODE   tSystSets,  "Konfiguration"
--- a/src/text_italian.inc	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/text_italian.inc	Sat Jun 13 22:53:05 2015 +0200
@@ -136,7 +136,13 @@
     TCODE   tDvSalinity,"Salinita':"             ; Salinity
     TCODE   tFlip,      "Ruotare schermo:"       ; Rotate Screen
     TCODE   tMODwarning,"MOD warning:"          ; MOD warning
-    TCODE   tVSItextv2, "Dyn asc rate lim:"     ; Dyn asc rate lim
+    TCODE   tDispSetVSI,"VSI Settings..."       ; VSI Settings...
+
+; VSI display Settings
+    TCODE   tDispSetVSItitle, "VSI Display Settings"     ; VSI display Settings
+    TCODE   tVSItext1,        "Depth based variable"     ; max 20 chars: "Depth based variable", first line of the option
+    TCODE   tVSItext2,        "   ascend limit: "        ; max 17 chars: "   ascend limit: ", second line, with space prefix
+    TCODE   tVSIgraph,        "Graphical VSI:   "        ; max 17 chars: "Graphical VSI:   "
 
 ; Setup Menu
     TCODE   tSystSets,  "Impostazioni"
--- a/src/tft_outputs.asm	Sat Jun 13 22:54:37 2015 +0200
+++ b/src/tft_outputs.asm	Sat Jun 13 22:53:05 2015 +0200
@@ -990,6 +990,10 @@
     btfss   neg_flag_velocity
     bra     TFT_velocity_VSIbar_desc
     call    TFT_velocity_VSIbar_desc_clr
+
+    TSTOSS  opt_vsigraph			; 0=skip, 1=draw
+    return
+
     btfsc   velocity_warn
     bra     TFT_velocity_VSIbar_warn
     ; if all ok or attention, use attn's values
@@ -1103,6 +1107,10 @@
 TFT_velocity_VSIbar_desc:
     ; clear the ascend part of the bar
     call    TFT_velocity_VSIbar_clr
+
+    TSTOSS  opt_vsigraph			; 0=skip, 1=draw
+    return
+
     ; divA+0=0 is descend, clear everything if it's actually zero
     movlw   .0
     cpfsgt  divA+0
@@ -4089,6 +4097,12 @@
 	PUTC	" "
 	return			; No "_PRINT" here...
 	
+	global	TFT_VSImenu_dynamictitle
+TFT_VSImenu_dynamictitle:
+	STRCPY_TEXT tVSItext1
+	PUTC	" "
+	return			; No "_PRINT" here...
+
 
 	global	adjust_depth_with_salinity
 adjust_depth_with_salinity:			; computes salinity setting into lo:hi [mbar]