changeset 1049:d91345e9c009 GasConsumption

Added GF for surface: The GF for the surface will now be shown in the lowerleft corner as well as in the customer summary view.
author Ideenmodellierer
date Tue, 18 Nov 2025 18:53:21 +0100
parents 493a5903ec20
children 88b6ab90c55a
files Common/Inc/data_central.h Discovery/Src/buehlmann.c Discovery/Src/t7.c Discovery/Src/vpm.c
diffstat 4 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/data_central.h	Sat Nov 15 19:29:44 2025 +0100
+++ b/Common/Inc/data_central.h	Tue Nov 18 18:53:21 2025 +0100
@@ -105,6 +105,7 @@
 	int output_ndl_seconds;
 	float output_ceiling_meter;
 	float super_saturation;
+	float gf_surf;
 	uint32_t tickstamp;
 } 	SDecoinfo;
 
--- a/Discovery/Src/buehlmann.c	Sat Nov 15 19:29:44 2025 +0100
+++ b/Discovery/Src/buehlmann.c	Tue Nov 18 18:53:21 2025 +0100
@@ -320,11 +320,14 @@
 	float inertgas_a;
 	float inertgas_b;
 	float ceiling;
+	float M_surf,gf_surf;
 	float super_saturation;
 	float pres_respiration = pLifeData->pressure_ambient_bar;
+	float pres_surface = pLifeData->pressure_surface_bar;
 	int ci;
 
 	pDecoInfo->super_saturation = 0;
+	pDecoInfo->gf_surf = 0;
 
 	for (ci = 0; ci < 16; ci++)
 	{
@@ -341,6 +344,16 @@
 			inertgas_b = ( ( buehlmann_N2_b[ci] *  gTissue_nitrogen_bar[ci]) + ( buehlmann_He_b[ci] * gTissue_helium_bar[ci]) ) / tissue_inertgas_saturation;
 		}
 
+		M_surf = inertgas_a + inertgas_b * pres_surface;
+		if (M_surf > pres_surface)
+		{
+			gf_surf = (tissue_inertgas_saturation - pres_surface) / (M_surf - pres_surface);
+			if(gf_surf > pDecoInfo->gf_surf)
+			{
+				pDecoInfo->gf_surf = gf_surf;
+			}
+		}
+
 		ceiling = pres_respiration / inertgas_b + inertgas_a;
 		if(tissue_inertgas_saturation > pres_respiration)
 		{
--- a/Discovery/Src/t7.c	Sat Nov 15 19:29:44 2025 +0100
+++ b/Discovery/Src/t7.c	Tue Nov 18 18:53:21 2025 +0100
@@ -3348,7 +3348,10 @@
     /* actual GF */
     case LLC_GF:
         headerText[2] = TXT_ActualGradient;
-        snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation);
+        snprintf(text,TEXTSIZE,"\020\002\016\016%3.0f%% @ C\017\n\r\002\016\016%3.0f%% @ 0\017",100 * pDecoinfoStandard->super_saturation
+        																		 	 	 ,100 * pDecoinfoStandard->gf_surf);
+        tinyHeaderFont = 1;
+        line = 1;
         break;
 
     case LLC_ScrubberTime:
@@ -4146,6 +4149,9 @@
     text[textpointer++] = TXT_ActualGradient;
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
+    text[textpointer++] = TXT_ActualGradient;
+    text[textpointer++] = '\n';
+    text[textpointer++] = '\r';
     text[textpointer++] = TXT_CNS;
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
@@ -4187,7 +4193,11 @@
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",		100 * pDecoinfoStandard->super_saturation);
+    textpointer += snprintf(&text[textpointer],15,"\020%.0f\016\016%%\017 @ C",		100 * pDecoinfoStandard->super_saturation);
+    text[textpointer++] = '\n';
+    text[textpointer++] = '\r';
+    text[textpointer++] = '\t';
+    textpointer += snprintf(&text[textpointer],15,"\020%.0f\016\016%%\017 @ 0",			100 * pDecoinfoStandard->gf_surf);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = '\t';
--- a/Discovery/Src/vpm.c	Sat Nov 15 19:29:44 2025 +0100
+++ b/Discovery/Src/vpm.c	Tue Nov 18 18:53:21 2025 +0100
@@ -290,6 +290,7 @@
     pDECOINFO->output_ndl_seconds = 0;
     pDECOINFO->output_ceiling_meter = 0;
     pDECOINFO->super_saturation = 0;
+    pDECOINFO->gf_surf = 0;
     uint8_t tmp_calc_status;
     for(int i=0;i<DECOINFO_STRUCT_MAX_STOPS;i++)
     {