comparison Discovery/Src/buehlmann.c @ 981:c6c781a2e85b default

Merge into default
author heinrichsweikamp
date Tue, 11 Feb 2025 18:12:00 +0100
parents 79b522fbabe6
children 7891160acde3
comparison
equal deleted inserted replaced
871:f7318457df4d 981:c6c781a2e85b
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 #ifdef ENABLE_DECOCALC_OPTION
263 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)
264 #endif
265 )
266 {
262 break; 267 break;
268 }
263 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 269 float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
264 if(gStop.depth <= pressureChange + 0.00001f) 270 if(gStop.depth <= pressureChange + 0.00001f)
265 { 271 {
266 gGas_id = i; 272 gGas_id = i;
267 } 273 }
456 seconds = 0; 462 seconds = 0;
457 do{ 463 do{
458 pressureTop_tmp = pressureTop; 464 pressureTop_tmp = pressureTop;
459 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 465 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
460 { 466 {
461 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 467 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
468 #ifdef ENABLE_DECOCALC_OPTION
469 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)
470 #endif
471 )
472 {
462 break; 473 break;
474 }
463 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; 475 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10;
464 if(pressureBottom <= pressureChange) 476 if(pressureBottom <= pressureChange)
465 { 477 {
466 gGas_id = i; 478 gGas_id = i;
467 } 479 }
471 } 483 }
472 484
473 } 485 }
474 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) 486 for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++)
475 { 487 {
476 if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 488 if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
489 #ifdef ENABLE_DECOCALC_OPTION
490 || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)
491 #endif
492 )
493 {
477 break; 494 break;
495 }
496
478 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10; 497 pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10;
479 if((pressureChange < pressureBottom) && (pressureChange > pressureTop)) 498 if((pressureChange < pressureBottom) && (pressureChange > pressureTop))
480 { 499 {
481 pressureTop_tmp = pressureChange; 500 pressureTop_tmp = pressureChange;
482 } 501 }