v2.6.0: Show highest-altitude flight of the day on Statistics screen

Adds FlightLogbook::todayMaxAltitude(), which scans today's logbook
CSV for the entry with the greatest altitude at first sighting, and
displays it as "Highest flight today: <callsign> (<alt> ft)" on the
Statistics screen (Menu -> Flight Options -> Statistics).

Also documents the CYD-flightradar.bin rename step (for GitHub
release uploads) in the CLAUDE.md release workflow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-06 15:58:08 +02:00
parent 82b0877e8d
commit f966255329
12 changed files with 100 additions and 7 deletions

View File

@@ -36,11 +36,12 @@ namespace {
constexpr uint32_t CONFIRM_WINDOW_MS = 4000;
constexpr int16_t ROW1_Y = 44;
constexpr int16_t ROW2_Y = 84;
constexpr int16_t ROW3_Y = 124;
constexpr int16_t ROW4_Y = 164;
constexpr int16_t UPTIME_Y = 202;
constexpr int16_t ROW1_Y = 40;
constexpr int16_t ROW2_Y = 76;
constexpr int16_t ROW3_Y = 112;
constexpr int16_t ROW4_Y = 148;
constexpr int16_t UPTIME_Y = 184;
constexpr int16_t TOP_ALT_Y = 204; // "Hoechster Flug heute" - einzeilig, daher naeher an UPTIME als die anderen Rows
}
void run(TFT_eSPI& tft) {
@@ -56,6 +57,7 @@ void run(TFT_eSPI& tft) {
uint32_t allTimeAircraft = 0;
uint16_t allTimeDays = 0;
FlightLogbook::computeAllTimeStats(allTimeAircraft, allTimeDays);
FlightLogbook::TopAltitude topAlt = FlightLogbook::todayMaxAltitude();
Rect resetBtn = {10, (int16_t)(Config::SCREEN_HEIGHT - 100), (int16_t)(Config::SCREEN_WIDTH - 20), 40};
Rect backBtn = {10, (int16_t)(Config::SCREEN_HEIGHT - 50), (int16_t)(Config::SCREEN_WIDTH - 20), 40};
@@ -94,6 +96,14 @@ void run(TFT_eSPI& tft) {
tft.setCursor(10, UPTIME_Y);
tft.print(String(I18n::t(StringId::STATS_UPTIME_PREFIX)) + upBuf);
if (topAlt.found) {
String csign = topAlt.callsign[0] ? String(topAlt.callsign) : "?";
char altBuf[24];
snprintf(altBuf, sizeof(altBuf), "%s (%ld ft)", csign.c_str(), (long)topAlt.altitudeFt);
tft.setCursor(10, TOP_ALT_Y);
tft.print(String(I18n::t(StringId::STATS_TOP_ALTITUDE_PREFIX)) + altBuf);
}
if (confirmPending) {
drawButton(tft, resetBtn, I18n::t(StringId::STATS_RESET_CONFIRM), true);
} else {