# HG changeset patch # User heinrichsweikamp # Date 1401138959 -7200 # Node ID de7fa23169139474de1c4d819628e97d24663c89 # Parent d2b7d78b0019a80d81426e95d828760dda75d7f7 add simple gas change countdown diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Mon May 26 23:15:59 2014 +0200 @@ -583,4 +583,5 @@ #DEFINE show_cns_in_logbook flag15,7 ;=1: Show CNS value in logbook (>= V1.84) #DEFINE store_bailout_event flag16,0 ;=1: Store the bailout event +#DEFINE gaschange_cnt_active flag16,1 ;=1: The gas switch countdown is active diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Mon May 26 23:15:59 2014 +0200 @@ -52,6 +52,9 @@ ; Startup Tasks for deco modes call DISP_display_ndl_mask ; display "no stop" if not in gauge or apnoe mode + GETCUSTOM8 d'55' + movwf apnoe_surface_mins + clrf apnoe_surface_secs btfss FLAG_const_ppO2_mode ; only in const_ppO2_mode bra diveloop_loop ; OC modes, skip @@ -84,6 +87,8 @@ diveloop_loop1z: bcf update_divetime ; clear flag + call DISP_show_gas_change_countdown ; Show the gas change countdown (If required) + btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode bra diveloop_loop1c ; One Second Tasks in const_ppO2 mode @@ -2014,7 +2019,6 @@ movwf apnoe_max_pressure+0 clrf apnoe_max_pressure+1 clrf apnoe_surface_mins - clrf apnoe_surface_secs clrf apnoe_mins clrf apnoe_secs clrf divemins+0 @@ -2057,6 +2061,7 @@ bcf tts_extra_time ;=1: Compute TTS if extra time spent at current depth bcf show_safety_stop ;=1: Show the safety stop clrf safety_stop_countdown ; Clear count-down + bcf gaschange_cnt_active ; Do not show the countdown on start call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs! diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Mon May 26 23:15:59 2014 +0200 @@ -743,6 +743,8 @@ bsf stored_gas_changed ; set event flag bsf event_occured ; set global event flag bsf decoplan_invalid ; The decoplan needs to updated + btfsc better_gas_available ; If a gas change was planned... + bsf gaschange_cnt_active ; Show the countdown clrf WREG movff WREG,char_O_deco_status ; Restart decoplan computation mH bra timeout_divemenu2 ; quit menu! @@ -785,6 +787,8 @@ movff EEDATA, char_I_N2_ratio ; = N2! bsf stored_gas_changed ; set event flag bsf event_occured ; set global event flag + btfsc better_gas_available ; If a gas change was planned... + bsf gaschange_cnt_active ; Show the countdown bsf decoplan_invalid ; The decoplan needs to updated clrf WREG movff WREG,char_O_deco_status ; Restart decoplan computation mH diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/english_text.asm --- a/code_part1/OSTC_code_asm_part1/english_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/english_text.asm Mon May 26 23:15:59 2014 +0200 @@ -307,7 +307,7 @@ TCODE .40, .35, "ShowTissueGraph" ;174 ShowTissueGraph TCODE .40, .35, "Show Lead.Tiss." ;175 Show Lead.Tiss. TCODE .40, .35, "ShallowStop 1st" ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unused " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "BottomGas[/min]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "AscentGas[/min]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "Future TTS[min]" ;180 Future TTS[min] (Compute TTS for extra time at current depth) diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/french_text.asm --- a/code_part1/OSTC_code_asm_part1/french_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/french_text.asm Mon May 26 23:15:59 2014 +0200 @@ -309,7 +309,7 @@ TCODE .40, .35, "Aff.GraphTissus" ;174 ShowTissueGraph TCODE .40, .35, "Aff.Tiss.Direct" ;175 Show Lead.Tiss. TCODE .40, .35, "Ordre paliers " ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unused " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "ConsoFond[/min]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "ConsoDeco[/min]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "DTR Rйchap[min]" ;180 Future TTS[min] (Compute TTS for extra time at current depth) diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/german_text.asm --- a/code_part1/OSTC_code_asm_part1/german_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/german_text.asm Mon May 26 23:15:59 2014 +0200 @@ -308,7 +308,7 @@ TCODE .40, .35, "Gewebegraph anz" ;174 ShowTissueGraph TCODE .40, .35, "Leitgewebe anz " ;175 Show Lead.Tiss. TCODE .40, .35, "Flach.StoppOben" ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unbenutzt " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "BottomGas[/min]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "Sonst.Gas[/min]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "TTS @ Zeit[min]" ;180 Future TTS[min] (Compute TTS for extra time at current depth) diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/italian_text.asm --- a/code_part1/OSTC_code_asm_part1/italian_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/italian_text.asm Mon May 26 23:15:59 2014 +0200 @@ -307,7 +307,7 @@ TCODE .40, .35, "VediGrafTessuti" ;174 ShowTissueGraph TCODE .40, .35, "Vedi Tess.Prim." ;175 Show Lead.Tiss. TCODE .40, .35, "Inver. Tab Deco" ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unused " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "Gas Fondo[/min]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "Gas Risal[/min]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "TTS Futuro[min]" ;180 Future TTS[min] (Compute TTS for extra time at current depth) diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/outputs.asm --- a/code_part1/OSTC_code_asm_part1/outputs.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/outputs.asm Mon May 26 23:15:59 2014 +0200 @@ -582,6 +582,52 @@ call DISP_standard_color return +DISP_show_gas_change_countdown: + btfss gaschange_cnt_active + return + decf apnoe_surface_secs,F ; Reduce countdown + btfss STATUS,N + bra DISP_show_gas_change_countdown2 + movlw .59 + movwf apnoe_surface_secs + decf apnoe_surface_mins,F + btfss STATUS,N + bra DISP_show_gas_change_countdown2 + bcf gaschange_cnt_active ; Clear flag + WIN_TOP .86 + WIN_LEFT .64 + WIN_FONT FT_SMALL + movlw d'4' + movwf temp1 + call DISP_display_clear_common_y1 + ; Reload countdown + GETCUSTOM8 d'55' + movwf apnoe_surface_mins + clrf apnoe_surface_secs + return + +DISP_show_gas_change_countdown2: + btfsc menubit ; Divemode menu active? + return ; Yes, do not show + movlw color_yellow ; show in yellow + call DISP_set_color + WIN_TOP .86 + WIN_LEFT .64 + WIN_FONT FT_SMALL + WIN_INVERT .0 ; Init new Wordprocessor + lfsr FSR2,letter + movff apnoe_surface_mins,lo + bsf leftbind + output_8 + PUTC ':' + movff apnoe_surface_secs,lo + output_99x + STRCAT_PRINT "" + call DISP_standard_color + bcf leftbind + return + + ;============================================================================= ; Update simulator menu with time/depth ; Note: because translations might change a bit the string length, we reprint diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/russian_text.asm --- a/code_part1/OSTC_code_asm_part1/russian_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/russian_text.asm Mon May 26 23:15:59 2014 +0200 @@ -310,7 +310,7 @@ TCODE .40, .35, "Показ граф. ткн" ;174 ShowTissueGraph TCODE .40, .35, "Показ глав. ткн" ;175 Show Lead.Tiss. TCODE .40, .35, "Мелк.ост.вверху" ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unused " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "Донн.расх[/мин]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "Подъ.расх[/мин]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "Будущ. TTS[мин]" ;180 Future TTS[min] (@5 variant: compute TTS for extra time at current depth) diff -r d2b7d78b0019 -r de7fa2316913 code_part1/OSTC_code_asm_part1/spanish_text.asm --- a/code_part1/OSTC_code_asm_part1/spanish_text.asm Mon May 26 20:17:25 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm Mon May 26 23:15:59 2014 +0200 @@ -306,7 +306,7 @@ TCODE .40, .35, "Mostr. Grбf.Tej" ;174 ShowTissueGraph TCODE .40, .35, "Mostr. TejContr" ;175 Show Lead.Tiss. TCODE .40, .35, "PriParadaSuperf" ;176 Shallow stop 1st (Reverse order of deco plans) - TCODE .40, .35, "unused " ;177 unused + TCODE .40, .35, "Gas switch[min]" ;177 Gas switch[min] (Show Countdown after gas change) TCODE .40, .35, "Gas Fondo[/min]" ;178 BottomGas[/min] (Bottom gas usage, for volume estimation). TCODE .40, .35, "GasAscens[/min]" ;179 AscentGas[/min] (Ascent+Deco gas usage) TCODE .40, .35, "Futuro TTS[min]" ;180 Future TTS[min] (Compute TTS for extra time at current depth)