comparison Discovery/Src/buehlmann.c @ 833:e963d32f746e Evo_2_23

Added selection if an active gas shall be used for deco calculation or not Calculate deco acording to gas deco calculation active bit
author Ideenmodellierer
date Sun, 17 Dec 2023 21:10:04 +0100
parents b7d93ff6b3b2
children 974648b5ccfe
comparison
equal deleted inserted replaced
832:7b0033246b12 833:e963d32f746e
256 } while(next_depth == -1); 256 } while(next_depth == -1);
257 tts_seconds += ascend_time; 257 tts_seconds += ascend_time;
258 gStop.depth = next_depth; 258 gStop.depth = next_depth;
259 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 259 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
260 { 260 {
261 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 261 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
262 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0))
263 break; 262 break;
264 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 263 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
265 if(gStop.depth <= pressureChange + 0.00001f) 264 if(gStop.depth <= pressureChange + 0.00001f)
266 { 265 {
267 gGas_id = i; 266 gGas_id = i;
457 seconds = 0; 456 seconds = 0;
458 do{ 457 do{
459 pressureTop_tmp = pressureTop; 458 pressureTop_tmp = pressureTop;
460 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 459 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
461 { 460 {
462 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 461 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
463 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0))
464 break; 462 break;
465 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 463 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
466 if(pressureBottom <= pressureChange) 464 if(pressureBottom <= pressureChange)
467 { 465 {
468 gGas_id = i; 466 gGas_id = i;
473 } 471 }
474 472
475 } 473 }
476 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 474 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
477 { 475 {
478 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 476 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
479 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0))
480 break; 477 break;
481 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10; 478 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10;
482 if((pressureChange < pressureBottom) && (pressureChange > pressureTop)) 479 if((pressureChange < pressureBottom) && (pressureChange > pressureTop))
483 { 480 {
484 pressureTop_tmp = pressureChange; 481 pressureTop_tmp = pressureChange;