x7/x9 GPS datetime fix (#5051)
* Fix x7 display in telemetry widget (only time is displayed) * rename drawDate to a more specific name, since it is not generic fix for x9 * Travis build fix * Introduce time FONTSIZE_MASK macro * Cosmetics based on Bertrand's last feedbacks
This commit is contained in:
@@ -756,42 +756,27 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
|
||||
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
|
||||
}
|
||||
|
||||
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
void drawTelemScreenDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
{
|
||||
if (att & DBLSIZE) {
|
||||
x -= 42;
|
||||
att &= ~0x0F00; // TODO constant
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
|
||||
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
|
||||
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||
y += FH;
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos, y, ':', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos, y, ':', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.month, att|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||
lcdDrawNumber(lcdNextPos+FW+1, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos, y, ':', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdLastRightPos, y, ':', att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||
}
|
||||
att &= ~FONTSIZE_MASK;
|
||||
lcdDrawNumber(x, y+1, telemetryItem.datetime.sec, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y+1, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y+1, telemetryItem.datetime.min, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y+1, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y+1, telemetryItem.datetime.hour, att|LEADING0, 2);
|
||||
|
||||
lcdDrawNumber(x, y+9, telemetryItem.datetime.year, att, 4);
|
||||
lcdDrawText(lcdNextPos, y+9, "-", att);
|
||||
lcdDrawNumber(lcdNextPos+1, y+9, telemetryItem.datetime.month, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos+1, y+9, "-", att);
|
||||
lcdDrawNumber(lcdNextPos+1, y+9, telemetryItem.datetime.day, att|LEADING0,2);
|
||||
}
|
||||
|
||||
void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
{
|
||||
if (att & DBLSIZE) {
|
||||
x -= (g_eeGeneral.gpsFormat == 0 ? 54 : 51);
|
||||
att &= ~0x0F00; // TODO constant
|
||||
att &= ~FONTSIZE_MASK;
|
||||
drawGPSCoord(x, y, telemetryItem.gps.latitude, "NS", att, true);
|
||||
drawGPSCoord(x, y+FH, telemetryItem.gps.longitude, "EW", att, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user