diff Discovery/Src/tMenuEditDecoParameter.c @ 902:d4622533271d Evo_2_23

VPM table mode: Because of the model maths, usage of float data type and so on it may happen that the TTS decreases during ascent and continues calculation of the vpm. To keep the values stable the vpm table mode has been introduces. Instead of continously calculation of the stops the stop time is decreased if the diver is close to a deco stop. If the table is violated (e.g. by not doing gas change) the table will be updated to the new, longer runtime. The table will not be switch back to a shorter version in case e.g. the missed gas change is performed
author Ideenmodellierer
date Wed, 02 Oct 2024 22:18:19 +0200
parents ba229a012ac7
children
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditDecoParameter.c	Wed Oct 02 22:07:13 2024 +0200
+++ b/Discovery/Src/tMenuEditDecoParameter.c	Wed Oct 02 22:18:19 2024 +0200
@@ -33,7 +33,7 @@
 #include "tMenuEdit.h"
 #include "unit.h" // last stop in meter and feet
 
-#define MEDP_TAB (380)
+#define MEDP_TAB (525)
 
 /* Private function prototypes -----------------------------------------------*/
 static void openEdit_DecoAlgorithm(void);
@@ -41,6 +41,7 @@
 static void openEdit_DecoAltGF(void);
 static void openEdit_DecoVPM(void);
 static void openEdit_DecoLastStop(void);
+static void openEdit_DecoVpmTable(void);
 static void openEdit_DM_SwitchAlgorithm(uint8_t line);
 
 //void openEdit_DecoGasUsage(void);
@@ -81,6 +82,7 @@
             openEdit_DecoLastStop();
             break;
         case 6:
+        	openEdit_DecoVpmTable();
             break;
         }
     }
@@ -231,6 +233,21 @@
     startEdit();
 }
 
+static void openEdit_DecoVpmTable(void)
+{
+	SSettings *pSettings = settingsGetPointer();
+
+	if(pSettings->VPM_conservatism.ub.alternative == 0)
+	{
+	   pSettings->VPM_conservatism.ub.alternative = 1;
+	}
+    else
+    {
+    	pSettings->VPM_conservatism.ub.alternative = 0;
+    }
+	exitEditWithUpdate();
+}
+
 uint8_t OnAction_VPM(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
 {
     SSettings *pSettings;