changeset 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 ad96f99ebc78
children 0c89c6fa949c
files Discovery/Src/buehlmann.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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))
             {