changeset 216:7012a521fa95

Merged in janlmulder/ostc4/edit-fix (pull request #11) Fix 3 presentation bugs
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Thu, 28 Mar 2019 13:05:29 +0000
parents c878a08dcf86 (current diff) 4a0ebade04f5 (diff)
children ce05c801b002 486dddfba7ce
files
diffstat 3 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t3.c	Tue Mar 26 22:23:26 2019 +0000
+++ b/Discovery/Src/t3.c	Thu Mar 28 13:05:29 2019 +0000
@@ -855,9 +855,9 @@
         if(pDecoinfo->output_time_to_surface_seconds)
         {
             if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
-                snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 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 / 3600);
+                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,1);
         }
--- a/Discovery/Src/t7.c	Tue Mar 26 22:23:26 2019 +0000
+++ b/Discovery/Src/t7.c	Thu Mar 28 13:05:29 2019 +0000
@@ -2172,9 +2172,9 @@
         snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS);
         GFX_write_string(&FontT42,&t7r3,TextR3,0);
         if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
-            snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60);
+            snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60);
         else
-            snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600);
+            snprintf(TextR3,TEXTSIZE,"\020\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600);
         t7_colorscheme_mod(TextR3);
         if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
             TextR2[0] = '\021';
@@ -2564,7 +2564,10 @@
     /* Future TTS */
     case 6:
         headerText[2] = TXT_FutureTTS;
-        snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, pDecoinfoFuture->output_time_to_surface_seconds / 60);
+        if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60)
+        	snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60);
+        else
+        	snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600);
         tinyHeaderFont = 1;
         line = 1;
         break;
@@ -3096,9 +3099,9 @@
     text[textpointer++] = '\r';
     text[textpointer++] = '\t';
     if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem))
-        textpointer += snprintf(&text[textpointer],10,"\020%01.1f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter));
+        textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter));
     else
-        textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
+        textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = '\t';
@@ -3110,7 +3113,10 @@
     text[textpointer++] = '\n';
     text[textpointer++] = '\r';
     text[textpointer++] = '\t';
-    textpointer += snprintf(&text[textpointer],10,"\020%i'",		pDecoinfoFuture->output_time_to_surface_seconds / 60);
+    if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60)
+    	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);
     text[textpointer++] = 0;
     t7_colorscheme_mod(text);
     GFX_write_string(&FontT42, &t7cY0free, text, 1);
--- a/Discovery/Src/tMenuEditSetpoint.c	Tue Mar 26 22:23:26 2019 +0000
+++ b/Discovery/Src/tMenuEditSetpoint.c	Thu Mar 28 13:05:29 2019 +0000
@@ -47,13 +47,10 @@
 
 /* Private function prototypes -----------------------------------------------*/
 
-void openEdit_DiveSetpointSelect(uint8_t line);
-void openEdit_DiveSetpointSelect_Subroutine(uint8_t line);
 
 /* Announced function prototypes -----------------------------------------------*/
 uint8_t OnAction_SP_Setpoint    (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_SP_Depth       (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-uint8_t On                      (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 //uint8_t OnAction_SP_First     (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 //uint8_t OnAction_SP_Active    (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 //uint8_t OnAction_SP_DM_Select (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
@@ -290,7 +287,7 @@
     if(action == ACTION_BUTTON_BACK)
     {
         digitContentNew = digitContent - 1;
-        if((blockNumber == 0) && (digitContentNew > '1'))
+        if((blockNumber == 0) && (digitContentNew < '0'))
             digitContentNew = '1';
         if(digitContentNew < '0')
             digitContentNew = '9';