Skip to content

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

Description

@zagers

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:

  1. Read the emergency field in planeObject.js (currently not consumed)
  2. Add an EmergencyStatus lookup object mapping emergency strings to display properties (CSS class, marker color, text)
  3. Extend table row highlighting to check plane.emergency in addition to squawk
  4. Extend map marker color logic to use ADS-B emergency (takes priority over squawk-based color)
  5. Add an emergency row to the selected aircraft detail panel
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    LLMhas LLM-generated content, treat with extreme suspicion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions