# HG changeset patch # User Ideenmodellierer # Date 1719941043 -7200 # Node ID 974648b5ccfe95d33cc3472322df67ab2295c9d2 # Parent ad96f99ebc78f216d28ab2899a85e6f1a230b09a 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. diff -r ad96f99ebc78 -r 974648b5ccfe Discovery/Src/buehlmann.c --- a/Discovery/Src/buehlmann.c Tue May 07 21:25:25 2024 +0200 +++ b/Discovery/Src/buehlmann.c Tue Jul 02 19:24:03 2024 +0200 @@ -258,8 +258,11 @@ gStop.depth = next_depth; for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { - if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) + { break; + } float pressureChange = ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; if(gStop.depth <= pressureChange + 0.00001f) { @@ -458,8 +461,11 @@ pressureTop_tmp = pressureTop; for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { - if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) + { break; + } pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero) / 10; if(pressureBottom <= pressureChange) { @@ -473,8 +479,12 @@ } for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { - if(pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) + { break; + } + pressureChange = gSurface_pressure_bar + ((float)pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero)/ 10; if((pressureChange < pressureBottom) && (pressureChange > pressureTop)) {