# HG changeset patch # User heinrichsweikamp # Date 1590521227 0 # Node ID 0f5080f50ba7b32fe52932ac09263f071c2726e4 # Parent 230aed360da00ab0acf55049dc8fbdf7b575cbb1# Parent 3db9eba89e3ce8b705ac3f29667010742353c944 Merged in Ideenmodellierer/ostc4/FixLayout_Header_LogView (pull request #46) FixLayout Header LogView diff -r 230aed360da0 -r 0f5080f50ba7 Discovery/Inc/logbook.h --- a/Discovery/Inc/logbook.h Tue May 19 07:27:18 2020 +0000 +++ b/Discovery/Inc/logbook.h Tue May 26 19:27:07 2020 +0000 @@ -75,7 +75,6 @@ uint8_t gfAtBeginning; uint8_t gfAtEnd; uint16_t personalDiveCount; - uint8_t batteryCharge; SSetpointLog setpoint[NUM_GAS]; uint16_t maxCNS; uint16_t averageDepth_mbar; @@ -94,7 +93,8 @@ uint8_t diveMode; uint8_t hwHudLastStatus; /* from here on identical to OSTC3 again */ uint16_t hwHudBattery_mV; - uint8_t batteryGaugeRegisters[6]; + uint8_t batteryGaugeRegisters[5]; /* former batteryGaugeRegisters (6 Bytes) which were not used => use as reserve to keep memory layout */ + uint8_t batteryCharge; /* first reuse byte */ uint16_t diveHeaderEnd; } SLogbookHeader; diff -r 230aed360da0 -r 0f5080f50ba7 Discovery/Src/gfx_engine.c --- a/Discovery/Src/gfx_engine.c Tue May 19 07:27:18 2020 +0000 +++ b/Discovery/Src/gfx_engine.c Tue May 26 19:27:07 2020 +0000 @@ -3175,6 +3175,7 @@ uint32_t pText; uint8_t setToTinyFont = 0; uint16_t decodeUTF8; + uint8_t tinyState = 0; /* used to identify the usage of tiny font */ #ifndef BOOTLOADER_STANDALONE SSettings *pSettings; @@ -3197,6 +3198,24 @@ while (*(char*)pText != 0)// und fehlend: Abfrage window / image size { + if(*(char*)pText == '\016') /* request font change */ + { + tinyState++; + } + if(*(char*)pText == '\017') /* request font reset */ + { + tinyState = 0; + } + if(tinyState > 1) + { + font = (tFont *)cfg->TinyFont; + } + else + { + font = (tFont *)cfg->font; + } + + if((font == &FontT144) && (*(char*)pText == '.')) { font = (tFont *)&FontT84; diff -r 230aed360da0 -r 0f5080f50ba7 Discovery/Src/logbook.c --- a/Discovery/Src/logbook.c Tue May 19 07:27:18 2020 +0000 +++ b/Discovery/Src/logbook.c Tue May 26 19:27:07 2020 +0000 @@ -901,7 +901,6 @@ divisor.cns--; } -#ifdef ENABLE_BOTTLE_SENSOR if(smallHeader.tankDivisor) { if(divisor.tank == 0) @@ -920,7 +919,6 @@ divisor.tank--; } } -#endif if (length != 0) return 0; @@ -1618,8 +1616,7 @@ headerOSTC3.hwHudLastStatus = pHead->hwHudLastStatus; - memcpy(headerOSTC3.batteryGaugeRegisters,&pHead->batteryGaugeRegisters, 6); - + memset(headerOSTC3.batteryGaugeRegisters, 0x00, 6); /* The battery registers are not evaluated => Set to zero */ memcpy(headerOSTC3.diveHeaderEnd, &pHead->diveHeaderEnd, 2); } diff -r 230aed360da0 -r 0f5080f50ba7 Discovery/Src/show_logbook.c --- 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 #include // 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 ---