Mercurial > public > mk2
comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 541:6626a6c4eda3
BUGFIX decoplan: ppO2 for CNS is inspired, alveolar (ie. no ppWater correction).
author | JeanDo |
---|---|
date | Mon, 09 Jan 2012 23:53:59 +0100 |
parents | 9e838e0b3749 |
children | 896b6346ccd2 |
comparison
equal
deleted
inserted
replaced
540:9e838e0b3749 | 541:6626a6c4eda3 |
---|---|
2208 overlay unsigned char time, t; | 2208 overlay unsigned char time, t; |
2209 | 2209 |
2210 //---- Ascent to surface delay | 2210 //---- Ascent to surface delay |
2211 // NOTE: count as if time is spent with bottom pressure, | 2211 // NOTE: count as if time is spent with bottom pressure, |
2212 // AND the bottom gas | 2212 // AND the bottom gas |
2213 actual_ppO2 = (pres_surface + char_I_bottom_depth * METER_TO_BAR - ppWater) | 2213 actual_ppO2 = (pres_surface + char_I_bottom_depth * METER_TO_BAR) |
2214 * (1.0 - calc_N2_ratio - calc_He_ratio); | 2214 * (1.0 - calc_N2_ratio - calc_He_ratio); |
2215 if( actual_ppO2 < 0.0 ) actual_ppO2 = 0.0; | 2215 if( actual_ppO2 < 0.0 ) actual_ppO2 = 0.0; |
2216 if( actual_ppO2 > 2.50 ) actual_ppO2 = 2.55; | 2216 if( actual_ppO2 > 2.50 ) actual_ppO2 = 2.55; |
2217 char_I_actual_ppO2 = (unsigned char)(100.0 * actual_ppO2 + 0.5); | 2217 char_I_actual_ppO2 = (unsigned char)(100.0 * actual_ppO2 + 0.5); |
2218 | 2218 |
2237 if( char_O_deco_depth[i] & 0x80 ) | 2237 if( char_O_deco_depth[i] & 0x80 ) |
2238 if( gas_switch_deepest() ) | 2238 if( gas_switch_deepest() ) |
2239 gas_switch_set(); | 2239 gas_switch_set(); |
2240 | 2240 |
2241 //---- Convert Depth and N2_ratio to ppO2 | 2241 //---- Convert Depth and N2_ratio to ppO2 |
2242 actual_ppO2 = (pres_surface + temp_depth_limit * METER_TO_BAR - ppWater) | 2242 actual_ppO2 = (pres_surface + temp_depth_limit * METER_TO_BAR) |
2243 * (1.0 - calc_N2_ratio - calc_He_ratio); | 2243 * (1.0 - calc_N2_ratio - calc_He_ratio); |
2244 if( actual_ppO2 < 0.0 ) actual_ppO2 = 0.0; | 2244 if( actual_ppO2 < 0.0 ) actual_ppO2 = 0.0; |
2245 if( actual_ppO2 > 2.50 ) actual_ppO2 = 2.55; | 2245 if( actual_ppO2 > 2.50 ) actual_ppO2 = 2.55; |
2246 char_I_actual_ppO2 = (unsigned char)(100.0 * actual_ppO2 + 0.5); | 2246 char_I_actual_ppO2 = (unsigned char)(100.0 * actual_ppO2 + 0.5); |
2247 | 2247 |