comparison Discovery/Src/buehlmann.c @ 862:974648b5ccfe Evo_2_23

Only use deco gas for calculation if option is enabled: The gas menu meanwhile provides the possibility to select a gas for deco (having the gas switching reminder visible) without the need to visualize the reduced deco time. If the visualization of the deco considering all gas changes is wanted then this may be enabled by selecting the gas additionaly for deco calculation.
author Ideenmodellierer
date Tue, 02 Jul 2024 19:24:03 +0200
parents e963d32f746e
children
comparison
equal deleted inserted replaced
861:ad96f99ebc78 862:974648b5ccfe
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 {
262 break; 264 break;
265 }
263 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 266 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
264 if(gStop.depth <= pressureChange + 0.00001f) 267 if(gStop.depth <= pressureChange + 0.00001f)
265 { 268 {
266 gGas_id = i; 269 gGas_id = i;
267 } 270 }
456 seconds = 0; 459 seconds = 0;
457 do{ 460 do{
458 pressureTop_tmp = pressureTop; 461 pressureTop_tmp = pressureTop;
459 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 462 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
460 { 463 {
461 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 464 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
465 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0))
466 {
462 break; 467 break;
468 }
463 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 469 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
464 if(pressureBottom <= pressureChange) 470 if(pressureBottom <= pressureChange)
465 { 471 {
466 gGas_id = i; 472 gGas_id = i;
467 } 473 }
471 } 477 }
472 478
473 } 479 }
474 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 480 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
475 { 481 {
476 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 482 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
483 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0))
484 {
477 break; 485 break;
486 }
487
478 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10; 488 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10;
479 if((pressureChange < pressureBottom) && (pressureChange > pressureTop)) 489 if((pressureChange < pressureBottom) && (pressureChange > pressureTop))
480 { 490 {
481 pressureTop_tmp = pressureChange; 491 pressureTop_tmp = pressureChange;
482 } 492 }