Sun-based night dimming; separate marker for Heavy aircraft

Night dimming now uses the actual sunrise/sunset at the active
location (classic Almanac algorithm) instead of a fixed 22:00-06:00
window, with a fallback to that fixed window while location or time
isn't known yet. Applies to both the backlight (main.cpp) and the
radar's own color dimming (radar_screen.cpp).

Heavy-category aircraft (ADS-B emitter category "A5") now get a
distinct marker (larger circle with an outer ring, plus the usual
heading line) instead of sharing the orange "notable" ring, on both
the device display and the WebUI radar.

Note: the orange "notable" ring itself (military/government callsign
prefixes) remains unimplemented - Config::NOTABLE_CALLSIGN_PREFIXES
has never been defined anywhere in this project. The WebUI radar's
"notable" field is hardcoded false until that's actually specified;
on the device it was never wired up in the first place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-13 04:13:41 +02:00
parent 5e22025d7a
commit fe3eec29b8
11 changed files with 237 additions and 19 deletions

View File

@@ -117,6 +117,8 @@ namespace {
html += "ctx.fillStyle=color;ctx.strokeStyle=color;";
html += "if(a.ground_vehicle){ctx.fillRect(x-3,y-3,6,6);}";
html += "else if(a.rotorcraft){ctx.beginPath();ctx.moveTo(x,y-5);ctx.lineTo(x+5,y);ctx.lineTo(x,y+5);ctx.lineTo(x-5,y);ctx.closePath();ctx.fill();}";
html += "else if(a.heavy){ctx.beginPath();ctx.arc(x,y,5,0,Math.PI*2);ctx.fill();ctx.beginPath();ctx.arc(x,y,7,0,Math.PI*2);ctx.stroke();";
html += "var hr2=a.track_deg*Math.PI/180;ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x+10*Math.sin(hr2),y-10*Math.cos(hr2));ctx.stroke();}";
html += "else{ctx.beginPath();ctx.arc(x,y,4,0,Math.PI*2);ctx.fill();";
html += "var hr=a.track_deg*Math.PI/180;ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x+10*Math.sin(hr),y-10*Math.cos(hr));ctx.stroke();}";
html += "if(a.emergency){ctx.strokeStyle='#ff3b3b';ctx.beginPath();ctx.arc(x,y,9,0,Math.PI*2);ctx.stroke();}";
@@ -366,9 +368,16 @@ namespace {
if (AirlineFilter::isHidden(a.callsign)) continue;
bool isRotorcraft = a.category[0] == 'A' && a.category[1] == '7';
bool isHeavy = isHeavyCategoryWeb(a.category);
bool isEmergency = emergencyOn && isEmergencySquawkWeb(a.squawk);
bool isWatched = watchOn && AircraftWatchlist::isWatched(a.callsign);
bool isNotable = isHeavyCategoryWeb(a.category);
// "notable" (oranger Ring) ist fuer auffaellige Rufzeichen
// (Militaer/Regierung) reserviert - Heavy-Flugzeuge bekommen
// stattdessen die eigene Markerform (siehe "heavy" unten). Es
// gibt aktuell aber keine Militaer-/Regierungs-Praefixliste im
// Projekt (auch nicht am Geraete-Display, siehe radar_screen.cpp)
// - "notable" bleibt daher bis auf Weiteres immer false.
bool isNotable = false;
JsonObject o = arr.add<JsonObject>();
o["hex"] = a.hex;
@@ -379,6 +388,7 @@ namespace {
o["track_deg"] = a.headingDeg;
o["ground_vehicle"] = isGroundVehicle;
o["rotorcraft"] = isRotorcraft;
o["heavy"] = isHeavy;
o["emergency"] = isEmergency;
o["watched"] = isWatched;
o["notable"] = isNotable;