From 70846d4add2fde7d0db7ebc1b949ce3674d9cd61 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 1 Sep 2016 19:00:12 +0200 Subject: [PATCH] =?UTF-8?q?[Horus]=C2=A0GPS=20display=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- radio/src/gui/212x64/lcd.cpp | 5 +++-- radio/src/gui/480x272/lcd.cpp | 10 ++++++++-- radio/src/gui/480x272/lcd.h | 1 + radio/src/gui/480x272/widgets/value.cpp | 15 +++++++++++---- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/radio/src/gui/212x64/lcd.cpp b/radio/src/gui/212x64/lcd.cpp index 20a07ef88..f99ab3d33 100644 --- a/radio/src/gui/212x64/lcd.cpp +++ b/radio/src/gui/212x64/lcd.cpp @@ -817,6 +817,7 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L uint32_t absvalue = abs(value); lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd lcdDrawChar(lcdLastPos, y, '@', att); + att &= ~RIGHT; absvalue = absvalue % 1000000; absvalue *= 60; if (g_eeGeneral.gpsFormat == 0 || !seconds) { @@ -876,8 +877,8 @@ void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, Lcd if (att & DBLSIZE) { x -= (g_eeGeneral.gpsFormat == 0 ? 54 : 51); att &= ~0x0F00; // TODO constant - drawGPSCoord(x, y, telemetryItem.gps.longitude, "EW", att); - drawGPSCoord(x, y+FH, telemetryItem.gps.latitude, "NS", att); + drawGPSCoord(x, y, telemetryItem.gps.longitude, "EW", att, true); + drawGPSCoord(x, y+FH, telemetryItem.gps.latitude, "NS", att, true); } else { drawGPSCoord(x, y, telemetryItem.gps.longitude, "EW", att, false); diff --git a/radio/src/gui/480x272/lcd.cpp b/radio/src/gui/480x272/lcd.cpp index 6da5ca565..9851e153c 100644 --- a/radio/src/gui/480x272/lcd.cpp +++ b/radio/src/gui/480x272/lcd.cpp @@ -360,8 +360,14 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L void drawGPSPosition(coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags) { - drawGPSCoord(x, y, longitude, "EW", flags); - drawGPSCoord(x, y+FH, latitude, "NS", flags); + if (flags & EXPANDED) { + drawGPSCoord(x, y, longitude, "EW", flags, true); + drawGPSCoord(x, y + FH, latitude, "NS", flags, true); + } + else { + drawGPSCoord(x, y, longitude, "EW", flags, false); + drawGPSCoord(lcdNextPos+5, y, latitude, "NS", flags, false); + } } void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags flags) diff --git a/radio/src/gui/480x272/lcd.h b/radio/src/gui/480x272/lcd.h index 07a858a80..0315856ee 100644 --- a/radio/src/gui/480x272/lcd.h +++ b/radio/src/gui/480x272/lcd.h @@ -88,6 +88,7 @@ enum FontSizeIndex { #define TIMEBLINK 0x1000 #define TIMEHOUR 0x2000 +#define EXPANDED 0x2000 #define VERTICAL 0x4000 #define NO_FONTCACHE 0x8000 diff --git a/radio/src/gui/480x272/widgets/value.cpp b/radio/src/gui/480x272/widgets/value.cpp index 5ce08a87f..ca0beb555 100644 --- a/radio/src/gui/480x272/widgets/value.cpp +++ b/radio/src/gui/480x272/widgets/value.cpp @@ -75,13 +75,20 @@ void ValueWidget::refresh() yValue = y+18; xLabel = x+NUMBERS_PADDING; yLabel = y+2; + if (field >= MIXSRC_FIRST_TELEM) { + if (isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3)) { + attrValue = LEFT | MIDSIZE | EXPANDED; + } + else { + attrValue = LEFT | DBLSIZE; + } + } #if defined(INTERNAL_GPS) - if (field == MIXSRC_TX_GPS) { - attrValue = LEFT | MIDSIZE; + else if (field == MIXSRC_TX_GPS) { + attrValue = LEFT | MIDSIZE | EXPANDED; } - else #endif - { + else { attrValue = LEFT | DBLSIZE; } }