changeset 656:3ccf13af4651

Added visualization of scrubber time: The remaining scrubber timer may be displayed in minutes or percentage of maximum time (both countdown). The value is displayed in the lower left corner, the overview custom view in T7 display as well as in the O2 Monitor view of the T3 display.
author Ideenmodellierer
date Sun, 25 Apr 2021 20:47:01 +0200
parents 980b4aa60a0e
children 9513a92b293b
files Discovery/Inc/t7.h Discovery/Src/t3.c Discovery/Src/t7.c Discovery/Src/tMenuEditCustom.c
diffstat 4 files changed, 69 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/t7.h	Sun Apr 25 20:42:56 2021 +0200
+++ b/Discovery/Inc/t7.h	Sun Apr 25 20:47:01 2021 +0200
@@ -45,6 +45,7 @@
 		LLC_FutureTTS,
 		LLC_CNS,
 		LLC_GF,
+		LLC_ScrubberTime,
 #ifdef ENABLE_BOTTLE_SENSOR
 		LCC_BottleBar,
 #endif
--- a/Discovery/Src/t3.c	Sun Apr 25 20:42:56 2021 +0200
+++ b/Discovery/Src/t3.c	Sun Apr 25 20:47:01 2021 +0200
@@ -1277,6 +1277,24 @@
                 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.2f",stateUsed->lifeData.ppO2Sensor_bar[i]);
             }
             GFX_write_string(&FontT105,tXc1,text,0);
+
+
+            if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (pSettings->dive_mode == DIVEMODE_CCR))
+            {
+                 snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_ScrubTime);
+                 GFX_write_string(&FontT42,tXc1,text,0);
+
+            	textpointer = 0;
+                if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES)
+                {
+                	textpointer += snprintf(&text[textpointer],10,"\020\002%3u'", pSettings->scrubTimerCur);
+                }
+                else
+                {
+                	textpointer += snprintf(&text[textpointer],20,"\020\002%u\016\016%%\017", (uint16_t)(pSettings->scrubTimerCur * 100 / pSettings->scrubTimerMax));
+                }
+                GFX_write_string(&FontT105,tXc1,text,1);
+            }
         }
         break;
 
--- a/Discovery/Src/t7.c	Sun Apr 25 20:42:56 2021 +0200
+++ b/Discovery/Src/t7.c	Sun Apr 25 20:47:01 2021 +0200
@@ -146,7 +146,7 @@
 const uint8_t *customviewsDive		= customviewsDiveStandard;
 const uint8_t *customviewsSurface	= customviewsSurfaceStandard;
 
-#define TEXTSIZE 16
+#define TEXTSIZE 30
 /* offset includes line: 2 = line +1
  * box (line) is 300 px
  * inside is 296 px
@@ -2412,7 +2412,7 @@
         TextR1[textPointer++] = '\a';
         TextR1[textPointer++] = '\001';
         TextR1[textPointer++] = ' ';
-        textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100);
+        textPointer += snprintf(&TextR1[textPointer],TEXTSIZE,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100);
         TextR1[textPointer++] = '?';
         TextR1[textPointer++] = ' ';
         TextR1[textPointer++] = 0;
@@ -2661,6 +2661,10 @@
     {
     	selection_custom_field++;
     }
+    if((selection_custom_field == LLC_ScrubberTime) && ((settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_OFF) || (settingsGetPointer()->dive_mode != DIVEMODE_CCR)))
+    {
+    	selection_custom_field++;
+    }
 
     if(selection_custom_field >= LLC_END)
     {
@@ -2786,6 +2790,20 @@
         headerText[2] = TXT_ActualGradient;
         snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation);
         break;
+
+    case LLC_ScrubberTime:
+    	tinyHeaderFont = 1;
+        headerText[2] = TXT_ScrubTime;
+        if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES)
+        {
+        	snprintf(text,TEXTSIZE,"\020%3u'",settingsGetPointer()->scrubTimerCur);
+        }
+        else
+        {
+        	snprintf(text,TEXTSIZE,"\020%u\016\016%%\017", (settingsGetPointer()->scrubTimerCur * 100 / settingsGetPointer()->scrubTimerMax));
+        }
+		break;
+
 #ifdef ENABLE_BOTTLE_SENSOR
     case LCC_BottleBar:
         headerText[2] = TXT_AtemGasVorrat;
@@ -3311,6 +3329,7 @@
 {
     char text[256+60];
     uint8_t textpointer = 0;
+    SSettings* pSettings = settingsGetPointer();
 
     const SDecoinfo * pDecoinfoStandard;
     const SDecoinfo * pDecoinfoFuture;
@@ -3332,7 +3351,7 @@
         fCNS = 999;
 
     t7cY0free.WindowY0 = t7cC.WindowY0 - 10;
-    if(settingsGetPointer()->FlipDisplay)
+    if(pSettings->FlipDisplay)
     {
     	t7cY0free.WindowY1 = 400;
     }
@@ -3359,10 +3378,16 @@
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = TXT_FutureTTS;
+    text[textpointer++] = '\n';
+    text[textpointer++] = '\r';
+    if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (pSettings->dive_mode == DIVEMODE_CCR))
+    {
+		text[textpointer++] = TXT_ScrubTime;
+
+    }
     text[textpointer++] = '\017';
-    text[textpointer++] = 0;
-
-    if(!settingsGetPointer()->FlipDisplay)
+	text[textpointer++] = 0;
+    if(!pSettings->FlipDisplay)
     {
 		t7cY0free.WindowX0 += 10;
 		t7cY0free.WindowY0 += 10;
@@ -3403,6 +3428,21 @@
     	textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60);
     else
     	textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600);
+
+    if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (pSettings->dive_mode == DIVEMODE_CCR))
+    {
+        text[textpointer++] = '\n';
+        text[textpointer++] = '\r';
+        text[textpointer++] = '\t';
+        if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES)
+        {
+        	textpointer += snprintf(&text[textpointer],10,"\020%3u'", pSettings->scrubTimerCur);
+        }
+        else
+        {
+        	textpointer += snprintf(&text[textpointer],10,"\020%u\016\016%%\017", (pSettings->scrubTimerCur * 100 / pSettings->scrubTimerMax));
+        }
+    }
     text[textpointer++] = 0;
     t7_colorscheme_mod(text);
     GFX_write_string(&FontT42, &t7cY0free, text, 1);
--- a/Discovery/Src/tMenuEditCustom.c	Sun Apr 25 20:42:56 2021 +0200
+++ b/Discovery/Src/tMenuEditCustom.c	Sun Apr 25 20:47:01 2021 +0200
@@ -160,6 +160,10 @@
     case LLC_GF:
     	text[4] = TXT_ActualGradient;
     	break;
+    case LLC_ScrubberTime:
+    	text[4] = TXT_ScrubTime;
+    	break;
+
 #ifdef ENABLE_BOTTLE_SENSOR
     case LCC_BottleBar:
     	text[4] = TXT_AtemGasVorrat;