Skip to content

Add emergency status banner from ADS-B decoded emergency field - #314

Open
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:emergency-status-banner
Open

Add emergency status banner from ADS-B decoded emergency field#314
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:emergency-status-banner

Conversation

@zagers

@zagers zagers commented Jul 19, 2026

Copy link
Copy Markdown

Summary

Surfaces the emergency field from aircraft.json in the UI. The C backend already decodes 7 emergency states from ADS-B Type 28/1 and Type 29/0 messages, but the frontend was ignoring them — only detecting emergencies via squawk codes 7500/7600/7700.

Fixes #313

Changes

  • EmergencyStatus lookup object in script.js — maps emergency strings to CSS class, marker color, and display text
  • planeObject.js — reads emergency field in updateData(), extends getMarkerColor() to use ADS-B emergency (priority over squawk)
  • Table row highlighting — checks plane.emergency in addition to squawk, applies CSS class and sets warning flag
  • Detail panel — adds emergency row to Tracking Information section, populated when emergency is active
  • CSS classes — 6 new classes for each emergency type (general, lifeguard, minfuel, nordo, unlawful, downed)

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

Testing

  • Existing squawk alerts (7500/7600/7700) still work
  • Aircraft with emergency: "lifeguard" in JSON shows orange marker and table highlight
  • Selected aircraft panel shows the emergency text

Surface the 'emergency' field from aircraft.json in the UI. The C backend
already decodes 7 emergency states from ADS-B Type 28/1 and Type 29/0
messages but the frontend was ignoring them, only detecting emergencies
via squawk codes 7500/7600/7700.

Changes:
- Add EmergencyStatus lookup object mapping emergency strings to display
  properties (CSS class, marker color, text)
- Read emergency field in planeObject.js updateData()
- Extend getMarkerColor() to use ADS-B emergency (priority over squawk)
- Extend table row highlighting to check plane.emergency
- Add emergency row to selected aircraft detail panel
- Add CSS classes for each emergency type

Fixes flightaware#313
@mutability mutability added the LLM has LLM-generated content, treat with extreme suspicion label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM has LLM-generated content, treat with extreme suspicion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add emergency status banner from ADS-B decoded emergency field

2 participants