changeset 529:0e1db77b2aca

Added skip condition in custom view selection: Decoplan may be selected even nothing was shown due to certain display conditions. These conditions have now been added to selection function to show deco plan only if data is available for visualization.
author Ideenmodellierer
date Tue, 15 Sep 2020 20:52:39 +0200
parents a9c195be907e
children c880907fd1d7
files Discovery/Src/t3.c
diffstat 1 files changed, 6 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t3.c	Sun Sep 13 20:59:38 2020 +0200
+++ b/Discovery/Src/t3.c	Tue Sep 15 20:52:39 2020 +0200
@@ -52,7 +52,7 @@
 GFX_DrawCfgWindow	t3c1;
 GFX_DrawCfgWindow	t3c2;
 
-uint8_t t3_selection_customview = 0;
+uint8_t t3_selection_customview = CVIEW_noneOrDebug;
 
 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/
 
@@ -551,10 +551,6 @@
 
 void t3_refresh_customview(float depth)
 {
-#if 0
-    if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
-        t3_change_customview();
-#endif
     t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode);
 }
 
@@ -855,16 +851,6 @@
             	default:
             		break;
             }
-#if 0
-            if(gasPosIdx < 3)
-            {
-            	lineNumber = 1;
-            }
-            else
-            {
-                lineNumber = 0;
-            }
-#endif
             gasPosIdx++;
 
             fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
@@ -1456,10 +1442,14 @@
 		{
 			iterate = 1;
 		}
-	    if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds)
+	    if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds)	/* Skip TTS if value is 0 */
 	    {
 	    	iterate = 1;
 	    }
+	    if((tX_customviews[index] == CVIEW_T3_Decostop) && ((!pDecoinfo->output_ndl_seconds) && (!pDecoinfo->output_time_to_surface_seconds) && (timer_Safetystop_GetCountDown() == 0)))			/* Skip Deco if NDL is not set */
+	    {
+	       	iterate = 1;
+	    }
 	    if((iterate) && (action == ACTION_END))
 	    {
 	    	action = ACTION_BUTTON_ENTER;