changeset 542:6960df7ddb09

Added new t3 view showing first deco stop and tts in parallel: TTS and deco stop may already be shown individually. Now also available in one view where TTS is limited to 99minutes (switch to hours) to avoid string overlap.
author Ideenmodellierer
date Sat, 10 Oct 2020 21:02:05 +0200
parents 6fbf7cd391cb
children bce852cc3b91
files Common/Inc/settings.h Discovery/Inc/tHome.h Discovery/Inc/text_multilanguage.h Discovery/Src/settings.c Discovery/Src/t3.c Discovery/Src/tHome.c Discovery/Src/tMenuEditCustom.c Discovery/Src/text_multilanguage.c
diffstat 8 files changed, 38 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/settings.h	Sat Oct 10 18:34:10 2020 +0200
+++ b/Common/Inc/settings.h	Sat Oct 10 21:02:05 2020 +0200
@@ -227,6 +227,7 @@
 	uint32_t cv_config_BigScreen;
 	/* new in 0xFFFF001C */
 	uint8_t compassInertia;
+	uint8_t tX_customViewPrimaryBF;
 } SSettings;
 
 typedef struct
--- a/Discovery/Inc/tHome.h	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Inc/tHome.h	Sat Oct 10 21:02:05 2020 +0200
@@ -82,6 +82,7 @@
 		CVIEW_T3_ApnoeSurfaceInfo,
 		CVIEW_T3_Navigation,
 		CVIEW_T3_DepthData,
+		CVIEW_T3_DecoTTS,
 		CVIEW_T3_END
 };
 
--- a/Discovery/Inc/text_multilanguage.h	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Inc/text_multilanguage.h	Sat Oct 10 21:02:05 2020 +0200
@@ -312,6 +312,7 @@
 		TXT2BYTE_ppoNair,
 		TXT2BYTE_Navigation,
 		TXT2BYTE_DepthData,
+		TXT2BYTE_DecoTTS,
 		TXT2BYTE_END
 };
 
--- a/Discovery/Src/settings.c	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Src/settings.c	Sat Oct 10 21:02:05 2020 +0200
@@ -470,6 +470,7 @@
     case 0xFFFF001B:
     	pSettings->compassInertia = 0; 			/* no inertia */
     	pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
+    	pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS;
         // no break
     default:
         pSettings->header = pStandard->header;
--- a/Discovery/Src/t3.c	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Src/t3.c	Sat Oct 10 21:02:05 2020 +0200
@@ -73,6 +73,7 @@
 	CVIEW_T3_Navigation,
 	CVIEW_T3_DepthData,
 	CVIEW_noneOrDebug,
+	CVIEW_T3_DecoTTS,
     CVIEW_T3_END
 };
 
@@ -928,6 +929,7 @@
         t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading);
         break;
 
+    case CVIEW_T3_DecoTTS:
     case CVIEW_T3_Decostop:
     default:
         // decostop
@@ -952,13 +954,12 @@
 
             textpointer = 0;
             snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'"
-            , unit_depth_integer(nextstopDepthMeter)
-            , unit_depth_char1_T105()
-            , unit_depth_char2_T105()
-            , (nextstopLengthSeconds+59)/60);
-//	old without feet hw 170703			snprintf(&text[textpointer],TEXTSIZE,"\020\003%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60);
-            t3_basics_colorscheme_mod(text);
-            GFX_write_string(&FontT105,tXc1,text,0);
+			, unit_depth_integer(nextstopDepthMeter)
+			, unit_depth_char1_T105()
+			, unit_depth_char2_T105()
+			, (nextstopLengthSeconds+59)/60);
+			t3_basics_colorscheme_mod(text);
+			GFX_write_string(&FontT105,tXc1,text,0);
         }
         else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
         {
@@ -982,6 +983,21 @@
             t3_basics_colorscheme_mod(text);
             GFX_write_string(&FontT105,tXc1,text,0);
         }
+
+        if(tX_selection_customview == CVIEW_T3_DecoTTS)	/* add tts data on right side of screen */
+        {
+            snprintf(text,TEXTSIZE,"\002\032\f%c",TXT_TTS);
+            GFX_write_string(&FontT42,tXc1,text,0);
+            if(pDecoinfo->output_time_to_surface_seconds)
+            {
+                if(pDecoinfo->output_time_to_surface_seconds < 100 * 60)
+                    snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60);
+                else
+                    snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600);
+                t3_basics_colorscheme_mod(text);
+                GFX_write_string(&FontT105,tXc1,text,0);
+            }
+        }
         break;
 
     case CVIEW_sensors:
--- a/Discovery/Src/tHome.c	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Src/tHome.c	Sat Oct 10 21:02:05 2020 +0200
@@ -58,7 +58,7 @@
 static uint16_t tHome_tick_count_field;
 
 const uint8_t cv_changelist[] = {CVIEW_Compass, CVIEW_SummaryOfLeftCorner, CVIEW_Tissues, CVIEW_Profile, CVIEW_EADTime, CVIEW_Gaslist, CVIEW_noneOrDebug, CVIEW_Decolist,CVIEW_sensors,CVIEW_sensors_mV, CVIEW_END};
-const uint8_t cv_changelist_BS[] = {CVIEW_T3_Decostop, CVIEW_sensors, CVIEW_Compass, CVIEW_T3_MaxDepth,CVIEW_T3_StopWatch, CVIEW_T3_TTS, CVIEW_T3_GasList, CVIEW_T3_ppO2andGas, CVIEW_noneOrDebug, CVIEW_T3_Navigation, CVIEW_T3_DepthData, CVIEW_T3_END};
+const uint8_t cv_changelist_BS[] = {CVIEW_T3_Decostop, CVIEW_sensors, CVIEW_Compass, CVIEW_T3_MaxDepth,CVIEW_T3_StopWatch, CVIEW_T3_TTS, CVIEW_T3_GasList, CVIEW_T3_ppO2andGas, CVIEW_noneOrDebug, CVIEW_T3_Navigation, CVIEW_T3_DepthData, CVIEW_T3_DecoTTS, CVIEW_T3_END};
 
 /* Private function prototypes -----------------------------------------------*/
 
--- a/Discovery/Src/tMenuEditCustom.c	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Src/tMenuEditCustom.c	Sat Oct 10 21:02:05 2020 +0200
@@ -362,6 +362,9 @@
     case CVIEW_T3_DepthData:
     	text = TXT2BYTE_DepthData;
     	break;
+    case CVIEW_T3_DecoTTS:
+    	text = TXT2BYTE_DecoTTS;
+    	break;
     default:
         break;
     }
--- a/Discovery/Src/text_multilanguage.c	Sat Oct 10 18:34:10 2020 +0200
+++ b/Discovery/Src/text_multilanguage.c	Sat Oct 10 21:02:05 2020 +0200
@@ -1608,6 +1608,12 @@
 static uint8_t text_IT_DepthData[] = "";
 static uint8_t text_ES_DepthData[] = "";
 
+static uint8_t text_EN_DecoTTS[] = "Deco and TTS";
+static uint8_t text_DE_DecoTTS[] = "Deco und TTS";
+static uint8_t text_FR_DecoTTS[] = "";
+static uint8_t text_IT_DecoTTS[] = "";
+static uint8_t text_ES_DecoTTS[] = "";
+
 /* Lookup Table -------------------------------------------------------------*/
 
 const tText text_array[] =
@@ -1838,6 +1844,5 @@
 	{(uint8_t)TXT2BYTE_ppoNair, 		{text_EN_ppo2Air, text_DE_ppo2Air, text_FR_ppo2Air, text_IT_ppo2Air, text_ES_ppo2Air}},
 	{(uint8_t)TXT2BYTE_Navigation, 		{text_EN_Navigation, text_DE_Navigation, text_FR_Navigation, text_IT_Navigation, text_ES_Navigation}},
 	{(uint8_t)TXT2BYTE_DepthData, 		{text_EN_DepthData, text_DE_DepthData, text_FR_DepthData, text_IT_DepthData, text_ES_DepthData}},
-
-
+	{(uint8_t)TXT2BYTE_DecoTTS, 		{text_EN_DecoTTS, text_DE_DecoTTS, text_FR_DecoTTS, text_IT_DecoTTS, text_ES_DecoTTS}},
 };