mobile: move distance below speed to avoid overlap
This commit is contained in:
28
pr133.ino
28
pr133.ino
@@ -407,7 +407,21 @@ void drawStationScreen(int idx) {
|
||||
u8g2.setFont(u8g2_font_6x12_t_cyrillic);
|
||||
int y = 50;
|
||||
|
||||
if (s.hasPos) {
|
||||
if (s.isMobile) {
|
||||
float kmh = s.speed * 1.852;
|
||||
String sp = "Speed: " + String(kmh, 0) + " km/h";
|
||||
u8g2.drawUTF8(2, y, sp.c_str());
|
||||
|
||||
char dirAge[16];
|
||||
unsigned long sec = (millis() - s.rxTime) / 1000;
|
||||
String age = sec < 120 ? String(sec) + "s" : String(sec / 60) + "m";
|
||||
snprintf(dirAge, sizeof(dirAge), "%s%d\xB0 %s", dirSymbol(s.heading), s.heading, age.c_str());
|
||||
u8g2.drawUTF8(126 - u8g2.getUTF8Width(dirAge), y, dirAge);
|
||||
|
||||
y += 14;
|
||||
String di = "Dist: " + String(s.distance, 1) + " km";
|
||||
u8g2.drawUTF8(2, y, di.c_str());
|
||||
} else if (s.hasPos) {
|
||||
char line[32];
|
||||
snprintf(line, sizeof(line), "%s %d\xB0 %.1f km",
|
||||
dirSymbol(s.heading), s.heading, s.distance);
|
||||
@@ -421,18 +435,6 @@ void drawStationScreen(int idx) {
|
||||
u8g2.drawUTF8(126 - aw, y, age.c_str());
|
||||
|
||||
y += 14;
|
||||
}
|
||||
|
||||
if (s.isMobile) {
|
||||
char sp[24];
|
||||
float kmh = s.speed * 1.852;
|
||||
snprintf(sp, sizeof(sp), "Speed: %.0f km/h", kmh);
|
||||
u8g2.drawUTF8(2, y, sp);
|
||||
|
||||
char di[16];
|
||||
snprintf(di, sizeof(di), "Dist: %.1f km", s.distance);
|
||||
int dw = u8g2.getUTF8Width(di);
|
||||
u8g2.drawUTF8(126 - dw, y, di);
|
||||
} else if (s.comment.length() > 0) {
|
||||
String c = s.comment;
|
||||
if (u8g2.getUTF8Width(c.c_str()) > 124) {
|
||||
|
||||
Reference in New Issue
Block a user