Mercurial > public > ostc4
diff Discovery/Src/show_logbook.c @ 487:0f5080f50ba7
Merged in Ideenmodellierer/ostc4/FixLayout_Header_LogView (pull request #46)
FixLayout Header LogView
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Tue, 26 May 2020 19:27:07 +0000 |
parents | eea282e733e8 |
children | 1c95f811967c |
line wrap: on
line diff
--- a/Discovery/Src/show_logbook.c Tue May 19 07:27:18 2020 +0000 +++ b/Discovery/Src/show_logbook.c Tue May 26 19:27:07 2020 +0000 @@ -39,6 +39,8 @@ #include <stdio.h> #include <stdlib.h> // for abs() +#define LOG_BORDER_OFFSET (50u) /* text offset from left / right display to text start/end */ + /* Private variables ---------------------------------------------------------*/ static GFX_DrawCfgScreen tLOGscreen; @@ -415,9 +417,9 @@ { SWindowGimpStyle wintemp; SWindowGimpStyle winsmal; - wintemp.left = 50; + wintemp.left = LOG_BORDER_OFFSET; wintemp.right = 799 - wintemp.left; - wintemp.top = 50; + wintemp.top = LOG_BORDER_OFFSET; wintemp.bottom = 479 - 40; SLogbookHeader logbookHeader; @@ -465,8 +467,8 @@ //Print time uint8_t hour = logbookHeader.timeHour; uint8_t minute = logbookHeader.timeMinute; - snprintf(text,20,"%02i:%02i",hour,minute); - Gfx_write_label_var(hgfx, 600, 749,10, &FontT42,CLUT_GasSensor1,text); + snprintf(text,20,"\002%02i:%02i",hour,minute); + Gfx_write_label_var(hgfx, 600, wintemp.right,10, &FontT42,CLUT_GasSensor1,text); //Print Dive Mode (OC/CCR/...) switch(logbookHeader.diveMode) @@ -493,12 +495,15 @@ { case GF_MODE: snprintf(text,20,"\002GF%u/%u",logbookHeader.gfLow_or_Vpm_conservatism,logbookHeader.gfHigh); - break; + break; case VPM_MODE: snprintf(text,20,"\002VPM +%u",logbookHeader.gfLow_or_Vpm_conservatism); - break; + break; + default: + snprintf(text,20," "); /* no information to be displayed */ + break; } - Gfx_write_label_var(hgfx, 600, 729,60, &FontT42,CLUT_GasSensor1,text); + Gfx_write_label_var(hgfx, 500, wintemp.right,60, &FontT42,CLUT_GasSensor1,text); } //Write Dive Time @@ -643,8 +648,8 @@ } if(bottlePressureStart != 0) { - snprintf(text,40,"%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); - Gfx_write_label_var(hgfx,600,800,440, &FontT42,CLUT_GasSensor1,text); + snprintf(text,40,"\002%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); + Gfx_write_label_var(hgfx,450,wintemp.right,440, &FontT42,CLUT_GasSensor1,text); } #endif //--- print coordinate system & depth graph with gaschanges ---