comparison src/p2_deco.c @ 351:de8c45fb2ab9

BUGFIX gas volume: do not forget deco gas with switch >= dive's bottom depth.
author jdg@air
date Fri, 24 Jul 2015 14:52:39 +0200
parents fca4f9de5f4a
children 6ec79c5384f5
comparison
equal deleted inserted replaced
350:2fd258596af0 351:de8c45fb2ab9
1185 copy_deco_table(); 1185 copy_deco_table();
1186 1186
1187 calc_ascenttime(); 1187 calc_ascenttime();
1188 char_O_deco_status = 0; // calc nullzeit next time. 1188 char_O_deco_status = 0; // calc nullzeit next time.
1189 char_O_deco_last_stop = 0; // Surface reached (to animate menu) 1189 char_O_deco_last_stop = 0; // Surface reached (to animate menu)
1190 return; 1190 return;
1191 } 1191 }
1192 } 1192 }
1193 //---- Then update tissue -------------------------------------------- 1193 //---- Then update tissue --------------------------------------------
1194 sim_dive_mins++; // Advance simulated time by 1 minute. 1194 sim_dive_mins++; // Advance simulated time by 1 minute.
1195 gas_switch_set(); // Apply any simulated gas change, once validated. 1195 gas_switch_set(); // Apply any simulated gas change, once validated.
2192 = (char_I_bottom_depth*0.1 + 1.0) // Use Psurface = 1.0 bar. 2192 = (char_I_bottom_depth*0.1 + 1.0) // Use Psurface = 1.0 bar.
2193 * char_I_bottom_time // in minutes. 2193 * char_I_bottom_time // in minutes.
2194 * bottom_usage; // In liter/minutes. 2194 * bottom_usage; // In liter/minutes.
2195 2195
2196 //---- Ascent usage ------------------------------------------------------ 2196 //---- Ascent usage ------------------------------------------------------
2197 depth = lastGasStop = char_I_bottom_depth; 2197 depth = char_I_bottom_depth;
2198 lastGasStop = 255; // Allow deco gas at or below bottom depth
2198 2199
2199 for(i=0; i<NUM_STOPS; ++i) 2200 for(i=0; i<NUM_STOPS; ++i)
2200 { 2201 {
2201 overlay unsigned char newDepth, time; 2202 overlay unsigned char newDepth, time;
2202 2203
2208 2209
2209 //---- Any gas switch before this stop ------------------------------- 2210 //---- Any gas switch before this stop -------------------------------
2210 for(;;) 2211 for(;;)
2211 { 2212 {
2212 overlay unsigned char newGas = 0; 2213 overlay unsigned char newGas = 0;
2213 overlay unsigned char newStop = 0; // NO CHANGE yet 2214 overlay unsigned char newStop = 0; // Mark as NO CHANGE yet
2214 overlay unsigned char j; 2215 overlay unsigned char j;
2215 2216
2216 for(j=0; j<NUM_GAS; ++j) 2217 for(j=0; j<NUM_GAS; ++j)
2217 { 2218 {
2218 // Skip gas without changing depth: 2219 // Skip gas without changing depth: