changeset 440:a17b85b0fbcc

NEW: Decoplanner Warms in red if CNS is too high.
author JeanDo
date Tue, 09 Aug 2011 18:16:03 +0200
parents b9cf06de8aca
children 4826dd98514b
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/simulator.asm code_part1/OSTC_code_c_part2/p2_deco.o
diffstat 3 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Tue Aug 09 18:10:27 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Tue Aug 09 18:16:03 2011 +0200
@@ -1,6 +1,7 @@
 New in 1.96 beta:
 NEW: Logbook displays ceilings and temperature curve.
 BUGFIX: Decoplanner accumulates CNS during ascent.
+NEW: Decoplanner Warms in red if CNS is too high.
 
 New in 1.95 beta:
 CHANGE: 0.98bar equal 10m depths with salinity set to 1.00kg/l
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Tue Aug 09 18:10:27 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Tue Aug 09 18:16:03 2011 +0200
@@ -216,15 +216,30 @@
 
 simulator_decoplan_notts:
         WIN_TOP .190                    ; Print calculated CNS before and after dive
+
+        incf    sim_CNS,W               ; Detect CNS simulation overflow.
+        bz      simulator_decoplan_cns_1
+
+        movlw   .100                    ; Detect if CNS > 100%
+        cpfslt  sim_CNS
+        call    PLED_warnings_color     ; Yes: draw in red !
+
         STRCPY  "CNS:"
         movff   char_O_CNS_fraction,lo  ; Current CNS, before dive.
         output_8
-
         STRCAT  "%\x92"                 ; Right-arrow
+       
         movff   sim_CNS,lo              ; Get back CNS value.
         output_8                        ; CNS after dive.
         STRCAT_PRINT    "%"
+        bra     simulator_decoplan_cns_2
 
+simulator_decoplan_cns_1:
+        call    PLED_warnings_color     ; Yes: draw in red !
+        STRCPY_PRINT    "CNS > 250%"
+
+simulator_decoplan_cns_2:
+        call    PLED_standard_color     ; Back to normal.
         WIN_INVERT	.1	                ; Init new Wordprocessor	
         DISPLAYTEXT	.188		        ; Sim. Results:
         WIN_INVERT	.0                  ; Init new Wordprocessor	
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed