v2.7.0: Time-of-day greeting, bearing indicator, and empty-sky timer

Three small usability additions:
- Splash screen now shows a "Good morning/day/evening" greeting under
  the title, based on local time (computed after the timezone offset
  from IP geolocation is applied via configTime(), not before, so it
  reflects actual local time rather than UTC).
- Selecting an aircraft on the radar now also draws a dotted bearing
  line plus a degree label from the radar center to the compass edge,
  showing which direction to actually look to spot it in the sky
  (distinct from the aircraft's own heading arrow).
- The radar info bar now shows "Empty sky for <time>" instead of the
  "tap for details" hint whenever no aircraft are currently in range
  after all filters, counting up from the last sighting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-06 20:41:09 +02:00
parent e4aa03dbf2
commit 9b9b89eb85
12 changed files with 141 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#include "splash_screen.h"
#include "menu_stars.h"
#include "i18n.h"
#include <math.h>
namespace SplashScreen {
@@ -131,6 +132,30 @@ void begin(TFT_eSPI& tft) {
tft.setTextSize(1);
}
void showGreeting(TFT_eSPI& tft) {
// Ohne per NTP synchronisierte Uhrzeit koennen wir die Tageszeit nicht
// bestimmen - dann lieber nichts anzeigen als zu raten (gleiches Muster
// wie bei der Nachtdimmung in main.cpp::isNightDimHours()).
time_t now = time(nullptr);
if (now <= 8 * 3600 * 2) return;
struct tm tmNow;
localtime_r(&now, &tmNow);
int h = tmNow.tm_hour;
StringId greetingId;
if (h < 12) greetingId = StringId::SPLASH_GREETING_MORNING;
else if (h < 18) greetingId = StringId::SPLASH_GREETING_DAY;
else greetingId = StringId::SPLASH_GREETING_EVENING;
int16_t cx = tft.width() / 2;
tft.setTextDatum(MC_DATUM);
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
tft.setTextSize(1);
tft.drawString(I18n::t(greetingId), cx, 84);
tft.setTextDatum(TL_DATUM);
}
void setStatusLine(TFT_eSPI& tft, uint8_t slot, const String& text, uint16_t color) {
if (slot >= MAX_STATUS_LINES) return;