v2.7.3: Flight logbook safety net, radar/clock/timezone fixes

New:
- Flight logbook safety net: disabled by default, requires confirming
  a full-screen warning before it can be turned on, and automatically
  switches off again after exactly 24 hours - survives restarts and
  power cycles (no valid enable timestamp = guaranteed off). Each
  activation now writes its own CSV file instead of endlessly
  appending to one growing file, and every file can be deleted
  individually from Logbook files.
- Adjustable display brightness (10-100% in 10% steps, Menu -> System
  -> "Brightness") with a live preview.
- About screen (Menu -> System -> "About") showing project name,
  description, and firmware version.

Fixed:
- Radar's red altitude band (>9100m/30000ft) no longer gets dimmed at
  night - the previous dim tone looked orange-brown and was hard to
  tell apart from yellow. Legend and markers are consistent again.
- Radius change no longer leaves a stale "tail" trail behind each
  aircraft between the old and new position.
- Splash screen no longer shows a time-of-day greeting that appeared
  too late in the boot sequence to be useful; the star animation now
  starts immediately instead of only near the end of boot.
- Clock stayed on raw UTC after the first boot instead of local time
  (missing DST handling in some timezones) because the location wait
  loop skipped the timezone lookup once a location was already saved.
- Header clock no longer leaves stale digit fragments behind the
  current time, most visible on the last minute digit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-10 14:02:01 +02:00
parent d5eda78d2f
commit 7137e50d66
25 changed files with 841 additions and 120 deletions

View File

@@ -16,11 +16,12 @@ namespace {
}
};
void drawButton(TFT_eSPI& tft, const Rect& r, const String& label) {
void drawButton(TFT_eSPI& tft, const Rect& r, const String& label, bool danger = false) {
uint16_t accent = danger ? TFT_RED : TFT_GREEN;
tft.fillRoundRect(r.x, r.y, r.w, r.h, 4, TFT_BLACK);
tft.drawRoundRect(r.x, r.y, r.w, r.h, 4, TFT_GREEN);
tft.drawRoundRect(r.x, r.y, r.w, r.h, 4, accent);
tft.setTextDatum(MC_DATUM);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.setTextColor(accent, TFT_BLACK);
tft.drawString(label, r.x + r.w / 2, r.y + r.h / 2);
tft.setTextDatum(TL_DATUM);
}
@@ -28,6 +29,10 @@ namespace {
constexpr uint8_t MAX_DAYS_QUERIED = 31;
constexpr uint8_t VISIBLE_ROWS = 10;
// Erste Inhaltszeile eine Zeile tiefer als frueher (30) ansetzen, damit
// sie nicht mit dem "?"-Info-Button oben rechts (y=2..26) kollidiert.
constexpr int16_t ROWS_START_Y = 50;
int16_t layoutWrapped(TFT_eSPI& tft, int16_t x, int16_t startY, int16_t maxWidth,
int16_t lineHeight, const String& text, int16_t scrollY,
int16_t viewTop, int16_t viewBottom, bool draw) {
@@ -147,7 +152,7 @@ void run(TFT_eSPI& tft) {
tft.setCursor(10, 14);
tft.println(I18n::t(StringId::LOGFILES_TITLE));
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
tft.setCursor(10, 30);
tft.setCursor(10, ROWS_START_Y);
tft.print(I18n::t(StringId::LOADING));
FlightLogbook::DayEntry days[MAX_DAYS_QUERIED];
@@ -165,13 +170,16 @@ void run(TFT_eSPI& tft) {
tft.println(I18n::t(StringId::LOGFILES_TITLE));
drawButton(tft, infoBtn, "?");
Rect deleteRects[VISIBLE_ROWS];
uint8_t deleteCount = 0;
uint8_t startIdx = (count > VISIBLE_ROWS) ? (count - VISIBLE_ROWS) : 0;
if (count == 0) {
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
tft.setCursor(10, 40);
tft.setCursor(10, ROWS_START_Y);
tft.println(I18n::t(StringId::LOGFILES_EMPTY));
} else {
uint8_t startIdx = (count > VISIBLE_ROWS) ? (count - VISIBLE_ROWS) : 0;
int16_t y = 30;
int16_t y = ROWS_START_Y;
if (count > VISIBLE_ROWS) {
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
@@ -188,6 +196,15 @@ void run(TFT_eSPI& tft) {
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.setCursor(110, y);
tft.print(String(days[i].count) + I18n::t(StringId::LOGFILES_AIRCRAFT_SUFFIX));
// Jede Datei einzeln loeschbar (selber Stil wie das rote 'X'
// bei den WLAN-Netzwerken) - keine Bestaetigung noetig, das
// globale "Flugbuch zuruecksetzen" im Statistik-Screen
// bleibt fuer den Alles-loeschen-Fall.
Rect delBtn = {(int16_t)(Config::SCREEN_WIDTH - 34), (int16_t)(y - 15), 30, 18};
drawButton(tft, delBtn, "X", true);
deleteRects[deleteCount++] = delBtn;
y += 20;
}
}
@@ -201,9 +218,18 @@ void run(TFT_eSPI& tft) {
delay(20);
}
if (infoBtn.contains(tap.x, tap.y)) {
bool handled = false;
for (uint8_t i = 0; i < deleteCount; i++) {
if (deleteRects[i].contains(tap.x, tap.y)) {
FlightLogbook::deleteFile(days[startIdx + i].date);
count = FlightLogbook::listDays(days, MAX_DAYS_QUERIED);
handled = true;
break;
}
}
if (!handled && infoBtn.contains(tap.x, tap.y)) {
runInfoScreen(tft);
} else if (backBtn.contains(tap.x, tap.y)) {
} else if (!handled && backBtn.contains(tap.x, tap.y)) {
done = true;
}
}