changeset 1050:88b6ab90c55a GasConsumption

Added separate LLC view for surface GF: A new LLC view has been added. In addition the surface GF is now clipped to a value of 9.99 => 999% in the visualization
author Ideenmodellierer
date Wed, 19 Nov 2025 21:34:18 +0100
parents d91345e9c009
children 4b6afe5551e1
files Discovery/Inc/t7.h Discovery/Inc/text_multilanguage.h Discovery/Src/buehlmann.c Discovery/Src/settings.c Discovery/Src/t7.c Discovery/Src/tMenuEditCustom.c Discovery/Src/text_multilanguage.c
diffstat 7 files changed, 44 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/t7.h	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Inc/t7.h	Wed Nov 19 21:34:18 2025 +0100
@@ -47,6 +47,7 @@
 		LLC_FutureTTS,
 		LLC_CNS,
 		LLC_GF,
+		LCC_GF_SURF,
 		LLC_ScrubberTime,
 #ifdef ENABLE_BOTTLE_SENSOR
 		LCC_BottleBar,
--- a/Discovery/Inc/text_multilanguage.h	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Inc/text_multilanguage.h	Wed Nov 19 21:34:18 2025 +0100
@@ -235,6 +235,7 @@
 		TXT2BYTE_OTU,
 		TXT2BYTE_Profile,
 		TXT2BYTE_Compass,
+		TXT2BYTE_GFSurf,
 		TXT2BYTE_SafetyStop2,
 		TXT2BYTE_noFly,
 		TXT2BYTE_Desaturation,
--- a/Discovery/Src/buehlmann.c	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Src/buehlmann.c	Wed Nov 19 21:34:18 2025 +0100
@@ -348,6 +348,10 @@
 		if (M_surf > pres_surface)
 		{
 			gf_surf = (tissue_inertgas_saturation - pres_surface) / (M_surf - pres_surface);
+			if(M_surf > 9.99)
+			{
+				M_surf = 9.99;		/* only intended to be used with 3 digit visualizations */
+			}
 			if(gf_surf > pDecoInfo->gf_surf)
 			{
 				pDecoInfo->gf_surf = gf_surf;
--- a/Discovery/Src/settings.c	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Src/settings.c	Wed Nov 19 21:34:18 2025 +0100
@@ -95,7 +95,7 @@
  * There might even be entries with fixed values that have no range
  */
 const SSettings SettingsStandard = {
-    .header = 0xFFFF002D,
+    .header = 0xFFFF002E,
     .warning_blink_dsec = 8 * 2,
     .lastDiveLogId = 0,
     .logFlashNextSampleStartAddress = SAMPLESTART,
@@ -661,6 +661,12 @@
     	sprintf((char*)pSettings->profileName[2],"MCCR____");
     	sprintf((char*)pSettings->profileName[3],"ECCR____");
     	pSettings->activeProfile = 0;
+    	// no break;
+    case 0xFFFF002D:
+    	if(pSettings->tX_userselectedLeftLowerCornerPrimary > LLC_GF) /* GF_Surf was added behind => shift ID of views */
+    	{
+    		pSettings->tX_userselectedLeftLowerCornerPrimary++;
+    	}
 
     	// no break;
     default:
--- a/Discovery/Src/t7.c	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Src/t7.c	Wed Nov 19 21:34:18 2025 +0100
@@ -3203,7 +3203,7 @@
 {
     selection_custom_field++;
 
-    if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && (selection_custom_field == LLC_GF)) /* no GF if in VPM mode */
+    if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && ((selection_custom_field == LLC_GF) || (selection_custom_field == LCC_GF_SURF))) /* no GF if in VPM mode */
     {
     	selection_custom_field++;
     }
@@ -3348,10 +3348,14 @@
     /* actual GF */
     case LLC_GF:
         headerText[2] = TXT_ActualGradient;
-        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;
+        snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation);
+        break;
+
+    /* Surface GF */
+    case LCC_GF_SURF:
+        headerText[2] = TXT_2BYTE;
+        headerText[3] = TXT2BYTE_GFSurf;
+        snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->gf_surf);
         break;
 
     case LLC_ScrubberTime:
@@ -4149,7 +4153,8 @@
     text[textpointer++] = TXT_ActualGradient;
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
-    text[textpointer++] = TXT_ActualGradient;
+    text[textpointer++] = TXT_2BYTE;
+    text[textpointer++] = TXT2BYTE_GFSurf;
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = TXT_CNS;
@@ -4181,30 +4186,30 @@
 		t7cY0free.WindowX1 += 10;
     }
     textpointer = 0;
-    text[textpointer++] = '\t';
+    text[textpointer++] = '\002';
     textpointer += snprintf(&text[textpointer],10,"\020%01.2f",	stateUsed->lifeData.ppO2);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
+    text[textpointer++] = '\002';
     if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem))
         textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter));
     else
         textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],15,"\020%.0f\016\016%%\017 @ C",		100 * pDecoinfoStandard->super_saturation);
+    text[textpointer++] = '\002';
+    textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",		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++] = '\002';
+    textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",		100 * pDecoinfoStandard->gf_surf);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
+    text[textpointer++] = '\002';
     textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
-    text[textpointer++] = '\t';
+    text[textpointer++] = '\002';
     if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60)
     	textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60);
     else
@@ -4213,7 +4218,7 @@
     if (isScrubberTimerEnabled(pSettings)) {
         text[textpointer++] = '\n';
         text[textpointer++] = '\r';
-        text[textpointer++] = '\t';
+        text[textpointer++] = '\002';
 
         textpointer += printScrubberText(&text[textpointer], 10, stateUsed->scrubberDataDive, pSettings, false);
     }
--- a/Discovery/Src/tMenuEditCustom.c	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Src/tMenuEditCustom.c	Wed Nov 19 21:34:18 2025 +0100
@@ -198,6 +198,10 @@
         text[5] = TXT2BYTE_Compass;
 
         break;
+    case LCC_GF_SURF:
+		text[4] = TXT_2BYTE;
+		text[5] = TXT2BYTE_GFSurf;
+		break;
     /* none */
     case LLC_Empty:
         text[4] = '-';
--- a/Discovery/Src/text_multilanguage.c	Tue Nov 18 18:53:21 2025 +0100
+++ b/Discovery/Src/text_multilanguage.c	Wed Nov 19 21:34:18 2025 +0100
@@ -176,6 +176,12 @@
 static uint8_t text_IT_CompassCalib[] = "Calibrazione bussola";
 static uint8_t text_ES_CompassCalib[] = "Calibrar brujula";
 
+static uint8_t text_EN_GFSurf[] = "GF Surface";
+static uint8_t text_DE_GFSurf[] = "";
+static uint8_t text_FR_GFSurf[] = "";
+static uint8_t text_IT_GFSurf[] = "";
+static uint8_t text_ES_GFSurf[] = "";
+
 static uint8_t text_EN_CompassInertia[] = "Compass inertia level";
 static uint8_t text_DE_CompassInertia[] = "Kompass Trägheitsfaktor";
 static uint8_t text_FR_CompassInertia[] = "Facteur d'inertie";
@@ -2131,6 +2137,7 @@
 	{(uint8_t)TXT2BYTE_SetMarkerShort,	{text_EN_SetMarkerShort, text_DE_SetMarkerShort, text_FR_SetMarkerShort, text_IT_SetMarkerShort, text_ES_SetMarkerShort}},
 	{(uint8_t)TXT2BYTE_CheckMarker,		{text_EN_CheckMarker, text_DE_CheckMarker, text_FR_CheckMarker, text_IT_CheckMarker, text_ES_CheckMarker}},
     {(uint8_t)TXT2BYTE_CompassHeading,  {text_EN_CompassHeading, text_DE_CompassHeading, text_FR_CompassHeading, text_IT_CompassHeading, text_ES_CompassHeading}},
+	{(uint8_t)TXT2BYTE_GFSurf,  		{text_EN_GFSurf, text_DE_GFSurf, text_FR_GFSurf, text_IT_GFSurf, text_ES_GFSurf}},
 	{(uint8_t)TXT2BYTE_CalibView,		{text_EN_CalibView, text_DE_CalibView, text_FR_CalibView, text_IT_CalibView, text_ES_CalibView}},
 	{(uint8_t)TXT2BYTE_IndicateFrame,	{text_EN_IndicateFrame, text_DE_IndicateFrame, text_FR_IndicateFrame, text_IT_IndicateFrame, text_ES_IndicateFrame}},
 	{(uint8_t)TXT2BYTE_BoostBacklight,	{text_EN_BoostBacklight, text_DE_BoostBacklight, text_FR_BoostBacklight, text_IT_BoostBacklight, text_ES_BoostBacklight}},