changeset 547:12f8745c8a94

Added viewport calibration to dive menu: To allow adjustments of the viewport during dive an option has been added to the dive menu "Xtra" including multi language strings
author Ideenmodellierer
date Mon, 02 Nov 2020 21:17:45 +0100
parents daa8d4474ba0
children e7e44986684a
files Discovery/Inc/text_multilanguage.h Discovery/Src/tMenuEditXtra.c Discovery/Src/tMenuXtra.c Discovery/Src/text_multilanguage.c
diffstat 4 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/text_multilanguage.h	Mon Nov 02 21:15:42 2020 +0100
+++ b/Discovery/Inc/text_multilanguage.h	Mon Nov 02 21:17:45 2020 +0100
@@ -167,6 +167,7 @@
 		TXT2BYTE_ResetStopwatch,
 		TXT2BYTE_SetMarker,
 		TXT2BYTE_CompassHeading,
+		TXT2BYTE_CalibView,
 		TXT2BYTE_EndDiveMode,
 		/* */
 		TXT2BYTE_Simulator,
--- a/Discovery/Src/tMenuEditXtra.c	Mon Nov 02 21:15:42 2020 +0100
+++ b/Discovery/Src/tMenuEditXtra.c	Mon Nov 02 21:17:45 2020 +0100
@@ -34,6 +34,7 @@
 #include "timer.h"
 #include "tMenuEdit.h"
 #include "data_exchange_main.h"
+#include "motion.h"
 
 
 /* Private function prototypes -----------------------------------------------*/
@@ -66,6 +67,9 @@
         openEdit_SetManualMarker();
         break;
     case 4:
+    	openEdit_CalibViewport();
+        break;
+    case 5:
     	if(is_stateUsedSetToSim())
     	{
     		 openEdit_SimFollowDecostops();
@@ -103,6 +107,12 @@
     exitMenuEdit_to_Menu_with_Menu_Update();
 }
 
+void openEdit_CalibViewport(void)
+{
+	calibrateViewport(stateUsed->lifeData.compass_roll, stateUsed->lifeData.compass_pitch, stateUsed->lifeData.compass_heading);
+    exitMenuEdit_to_Home();
+}
+
 void refresh_CompassHeading(void)
 {
     uint16_t heading;
--- a/Discovery/Src/tMenuXtra.c	Mon Nov 02 21:15:42 2020 +0100
+++ b/Discovery/Src/tMenuXtra.c	Mon Nov 02 21:17:45 2020 +0100
@@ -78,9 +78,17 @@
     strcpy(&text[textPointer],"\n\r");
     textPointer += 2;
 
+    if((line == 0) || (line == 4))
+    {
+        text[textPointer++] = TXT_2BYTE;
+        text[textPointer++] = TXT2BYTE_CalibView;
+    }
+    strcpy(&text[textPointer],"\n\r");
+    textPointer += 2;
+
     if(is_stateUsedSetToSim())
     {
-        if((line == 0) || (line == 4))
+        if((line == 0) || (line == 5))
         {
             text[textPointer++] = TXT_2BYTE;
             text[textPointer++] = TXT2BYTE_SimFollowDecoStops;
@@ -96,7 +104,7 @@
     }
     else
     {
-    	if((line == 0) || (line == 4))		/* end dive mode only used during real dives */
+    	if((line == 0) || (line == 5))		/* end dive mode only used during real dives */
     	    {
     	        text[textPointer++] = TXT_2BYTE;
     	        text[textPointer++] = TXT2BYTE_EndDiveMode;
--- a/Discovery/Src/text_multilanguage.c	Mon Nov 02 21:15:42 2020 +0100
+++ b/Discovery/Src/text_multilanguage.c	Mon Nov 02 21:17:45 2020 +0100
@@ -746,6 +746,13 @@
 static uint8_t text_ES_CompassHeading[] = "Rumbo brújula";
 
 // Dive Menu
+static uint8_t text_EN_CalibView[] = "Calibrate View";
+static uint8_t text_DE_CalibView[] = "Blickwinkel";
+static uint8_t text_FR_CalibView[] = "Calibrate View";
+static uint8_t text_IT_CalibView[] = "Calibrate View";
+static uint8_t text_ES_CalibView[] = "Calibrate View";
+
+// Dive Menu
 static uint8_t text_EN_EndDiveMode[] = "End dive";
 static uint8_t text_DE_EndDiveMode[] = "Tauchgang beenden";
 static uint8_t text_FR_EndDiveMode[] = "End dive";
@@ -1714,6 +1721,7 @@
     {(uint8_t)TXT2BYTE_ResetStopwatch,  {text_EN_ResetStopwatch, text_DE_ResetStopwatch, text_FR_ResetStopwatch, text_IT_ResetStopwatch, text_ES_ResetStopwatch}},
     {(uint8_t)TXT2BYTE_SetMarker,		{text_EN_SetMarker, text_DE_SetMarker, text_FR_SetMarker, text_IT_SetMarker, text_ES_SetMarker}},
     {(uint8_t)TXT2BYTE_CompassHeading,  {text_EN_CompassHeading, text_DE_CompassHeading, text_FR_CompassHeading, text_IT_CompassHeading, text_ES_CompassHeading}},
+	{(uint8_t)TXT2BYTE_CalibView,  		{text_EN_CalibView, text_DE_CalibView, text_FR_CalibView, text_IT_CalibView, text_ES_CalibView}},
     {(uint8_t)TXT2BYTE_EndDiveMode,		{text_EN_EndDiveMode, text_DE_EndDiveMode, text_FR_EndDiveMode, text_IT_EndDiveMode, text_ES_EndDiveMode}},
 	{(uint8_t)TXT2BYTE_Simulator,		{text_EN_Simulator, text_DE_Simulator, text_FR_Simulator, text_IT_Simulator, text_ES_Simulator}},
     {(uint8_t)TXT2BYTE_StartSimulator,  {text_EN_StartSimulator, text_DE_StartSimulator, text_FR_StartSimulator, text_IT_StartSimulator, text_ES_StartSimulator}},