comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 534:ba1fb2e23f46

BUGFIX NDL deco blocking stops during ascent when less than 10' TTS.
author JeanDo
date Sat, 17 Dec 2011 17:18:41 +0100
parents f5a06b9e2fef
children 9e838e0b3749
comparison
equal deleted inserted replaced
533:a2019f310176 534:ba1fb2e23f46
1056 default: 1056 default:
1057 gas_switch_find_current(); // Lookup for current gas & time. 1057 gas_switch_find_current(); // Lookup for current gas & time.
1058 gas_switch_set(); // setup calc_ratio's 1058 gas_switch_set(); // setup calc_ratio's
1059 1059
1060 calc_nullzeit(); 1060 calc_nullzeit();
1061 /* if( char_O_nullzeit > 0 ) // Some NDL time left ? 1061 if( char_O_nullzeit > 0 ) // Some NDL time left ?
1062 char_O_deco_status = 0; // YES: recalc ndl next time. 1062 {
1063 else 1063 char_O_deco_status = 0; // YES: recalc ndl next time.
1064 char_O_deco_status = 2; // NO: calc ascent next time. 1064 clear_deco_table(); // Also clear stops !
1065 */ 1065 copy_deco_table();
1066 char_O_deco_status = 2; // calc ascent next time. 1066 char_O_deco_last_stop = 0; // And last stop (OSTC menu anim)
1067 }
1068 else
1069 char_O_deco_status = 2; // NO: calc ascent next time.
1067 break; 1070 break;
1068 1071
1069 case 2: //---- Simulate ascent to first stop ----------------------------- 1072 case 2: //---- Simulate ascent to first stop -----------------------------
1070 case 6: // @+5min variation 1073 case 6: // @+5min variation
1071 // Check proposed gas at begin of ascent simulation 1074 // Check proposed gas at begin of ascent simulation
1286 gas_switch_set(); // Apply any simulated gas change, once validated. 1289 gas_switch_set(); // Apply any simulated gas change, once validated.
1287 sim_alveolar_presures(); // Updates ppN2 and ppHe. 1290 sim_alveolar_presures(); // Updates ppN2 and ppHe.
1288 sim_tissue(1); // Simulate compartiments for 1 minute. 1291 sim_tissue(1); // Simulate compartiments for 1 minute.
1289 } 1292 }
1290 1293
1291 // Surface not reached, need more stops... 1294 // Surface not reached, need more stops... for menu animation.
1292 char_O_deco_last_stop = temp_depth_limit; // Reached depth. 1295 char_O_deco_last_stop = temp_depth_limit; // Reached depth.
1293 } 1296 }
1294 1297
1295 ////////////////////////////////////////////////////////////////////////////// 1298 //////////////////////////////////////////////////////////////////////////////
1296 // Simulation ascention to first deco stop. 1299 // Simulation ascention to first deco stop.
1506 //---- Simulate off-gasing while going to surface 1509 //---- Simulate off-gasing while going to surface
1507 // TODO ! 1510 // TODO !
1508 // dTN2 -= exp( ... ascent time ... ppN2...) 1511 // dTN2 -= exp( ... ascent time ... ppN2...)
1509 // dTHe -= exp( ... ascent time ... ppHe...) 1512 // dTHe -= exp( ... ascent time ... ppHe...)
1510 1513
1511 //---- Still ok to surface after 1 or 10 minutes ? 1514 //---- Ok now, and still ok to surface after 1 or 10 minutes ?
1512 if( t + dTN2 + dTHe <= M0 ) 1515 if( (t <= M0) && (t + dTN2 + dTHe <= M0) )
1513 { 1516 {
1514 tN2 += dTN2; // YES: apply gas loadings, 1517 tN2 += dTN2; // YES: apply gas loadings,
1515 tHe += dTHe; 1518 tHe += dTHe;
1516 t = tN2 + tHe; 1519 t = tN2 + tHe;
1517 ndl += period; // increment NDL, 1520 ndl += period; // increment NDL,