diff code_part1/OSTC_code_c_part2/p2_deco.c @ 697:53e41fa1e3f0

BUGFIX Vault low_depth too.
author JeanDo
date Wed, 06 Mar 2013 14:21:48 +0100
parents 5bf4f526f552
children 1a5804e21d3f
line wrap: on
line diff
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Sun Feb 24 20:29:47 2013 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Wed Mar 06 14:21:48 2013 +0100
@@ -85,6 +85,7 @@
 // 2012/02/25: [jDG] Looking for a more stable LOW grad factor reference.
 // 2012/09/10: [mH]  Fill char_O_deco_time_for_log for logbook write
 // 2012/10/05: [jDG] Better deco_gas_volumes accuracy (average depth, switch between stop).
+// 2013/03/05: [jDG] Should vault low_depth too.
 //
 // TODO:
 //  + Allow to abort MD2 calculation (have to restart next time).
@@ -178,6 +179,7 @@
 static unsigned char	internal_deco_depth[NUM_STOPS];
 
 static float cns_vault;
+static float low_depth_vault;
 static float pres_tissue_N2_vault[NUM_COMP];
 static float pres_tissue_He_vault[NUM_COMP];
 
@@ -1055,7 +1057,7 @@
     // toggle between calculation for nullzeit (bottom time), 
     //                deco stops 
     //                and more deco stops (continue)
-	switch( char_O_deco_status )
+    switch( char_O_deco_status )
 	{
     case 3: //---- At surface: start a new dive ------------------------------
     	clear_deco_table();
@@ -2493,6 +2495,8 @@
     RESET_C_STACK
 
 	cns_vault = CNS_fraction;
+    low_depth_vault = low_depth;
+
 	for (x=0;x<NUM_COMP;x++)
     {
 		pres_tissue_N2_vault[x] = pres_tissue_N2[x];
@@ -2514,6 +2518,10 @@
     // Restore both CNS variable, too.
     CNS_fraction = cns_vault;
     char_O_CNS_fraction = (unsigned char)(CNS_fraction * 100.0 + 0.5);
+
+    // GF history too:
+    low_depth = low_depth_vault;
+    locked_GF_step = GF_delta / low_depth;
 }
 
 //////////////////////////////////////////////////////////////////////////////