changeset 553:43a2dd4ba30f

Added color indicator for focus state: Some lines in T7 and T3 screen will turn blue in case the OSTC detects a potential view of the diver. During focus state motion events are evaluated and proceeded.
author Ideenmodellierer
date Sun, 08 Nov 2020 18:49:54 +0100
parents 531e7818b737
children 3328189786e7
files Discovery/Inc/tStructure.h Discovery/Src/t3.c Discovery/Src/t7.c
diffstat 3 files changed, 37 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/tStructure.h	Sun Nov 08 18:46:46 2020 +0100
+++ b/Discovery/Inc/tStructure.h	Sun Nov 08 18:49:54 2020 +0100
@@ -321,6 +321,11 @@
 #define StMCustom3_CViewSelection6	_MB(2,9,3,6,0)
 
 #define StMCustom4_CViewSelection1	_MB(2,9,4,1,0)
+#define StMCustom5_CViewMotion		_MB(2,9,5,1,0)
+
+#define StMCustom6_CViewPortCalib	_MB(2,9,6,1,0)
+#define StMCustom6_CViewPortLayout	_MB(2,9,6,2,0)
+#define StMCustom6_CViewPortAmbient	_MB(2,9,6,3,0)
 
 /* PAGE 10 */
 #define StMPLAN		_MB(2,10,0,0,0)
--- a/Discovery/Src/t3.c	Sun Nov 08 18:46:46 2020 +0100
+++ b/Discovery/Src/t3.c	Sun Nov 08 18:49:54 2020 +0100
@@ -36,6 +36,7 @@
 #include "tHome.h"
 #include "timer.h"
 #include "unit.h"
+#include "motion.h"
 
 //* Imported function prototypes ---------------------------------------------*/
 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
@@ -226,13 +227,28 @@
     start.x = 0;
     stop.x = 799;
     stop.y = start.y = BigFontSeperationTopBottom;
-    GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
+    if(viewInFocus())
+    {
+    	GFX_draw_line(tXscreen, start, stop, CLUT_Font023);
+    }
+    else
+    {
+    	GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
+    }
+
 
     start.y = BigFontSeperationTopBottom;
     stop.y = 479;
 
     stop.x = start.x = BigFontSeperationLeftRight;
-    GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
+    if(viewInFocus())
+    {
+    	GFX_draw_line(tXscreen, start, stop, CLUT_Font023);
+    }
+    else
+    {
+    	GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
+    }
 
     /* depth */
     float depth = unit_depth_float(stateUsed->lifeData.depth_meter);
--- a/Discovery/Src/t7.c	Sun Nov 08 18:46:46 2020 +0100
+++ b/Discovery/Src/t7.c	Sun Nov 08 18:49:54 2020 +0100
@@ -577,7 +577,11 @@
                 selection_customview = settingsGetPointer()->tX_customViewPrimary;
 
             t7_change_customview(ACTION_END);
-            InitMotionDetection();
+
+            if((settingsGetPointer()->MotionDetection != MOTION_DETECT_OFF))
+            {
+            	InitMotionDetection();
+            }
         }
 
         if(status.page == PageSurface)
@@ -609,6 +613,7 @@
             last_mode = MODE_SURFACE;
             selection_customview = customviewsSurface[0];
             InitMotionDetection();
+            resetFocusState();
         }
         if(status.page == PageDive)
             set_globalState(StS);
@@ -2841,7 +2846,14 @@
     WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT;
     LeftLow.y = 60;
     WidthHeight.y = 440 - LeftLow.y;
-    GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox);
+    if(viewInFocus())
+    {
+    	GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, CLUT_Font023);
+    }
+    else
+    {
+    	GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox);
+    }
 
     if(PluginBoxHeader)
     {