Problem
The C backend decodes 7 emergency states from ADS-B Type 28/1 and Type 29/0 messages (general, lifeguard, minimum fuel, no communications, unlawful interference, downed aircraft), but the frontend only detects emergencies via 3 squawk codes (7500/7600/7700).
An aircraft declaring a lifeguard or minimum fuel emergency via ADS-B would show no alert in the UI.
Proposed Solution
Surface the decoded emergency field from aircraft.json in the UI:
- Read the
emergency field in planeObject.js (currently not consumed)
- Add an
EmergencyStatus lookup object mapping emergency strings to display properties (CSS class, marker color, text)
- Extend table row highlighting to check
plane.emergency in addition to squawk
- Extend map marker color logic to use ADS-B emergency (takes priority over squawk-based color)
- Add an emergency row to the selected aircraft detail panel
- Add CSS classes for each emergency type
Files to Modify
public_html/planeObject.js — read emergency field, extend getMarkerColor()
public_html/script.js — add EmergencyStatus object, extend table highlighting and detail panel
public_html/index.html — add emergency row to detail panel
public_html/style.css — add emergency CSS classes
What Stays the Same
- Existing squawk-based
SpecialSquawks system continues to work
- Global
SpecialSquawkWarning banner continues to show for squawk 7x00
- JSON output format unchanged
Problem
The C backend decodes 7 emergency states from ADS-B Type 28/1 and Type 29/0 messages (general, lifeguard, minimum fuel, no communications, unlawful interference, downed aircraft), but the frontend only detects emergencies via 3 squawk codes (7500/7600/7700).
An aircraft declaring a lifeguard or minimum fuel emergency via ADS-B would show no alert in the UI.
Proposed Solution
Surface the decoded
emergencyfield fromaircraft.jsonin the UI:emergencyfield inplaneObject.js(currently not consumed)EmergencyStatuslookup object mapping emergency strings to display properties (CSS class, marker color, text)plane.emergencyin addition to squawkFiles to Modify
public_html/planeObject.js— reademergencyfield, extendgetMarkerColor()public_html/script.js— addEmergencyStatusobject, extend table highlighting and detail panelpublic_html/index.html— add emergency row to detail panelpublic_html/style.css— add emergency CSS classesWhat Stays the Same
SpecialSquawkssystem continues to workSpecialSquawkWarningbanner continues to show for squawk 7x00