mirror of
https://github.com/smittix/intercept.git
synced 2026-05-29 22:59:27 -07:00
feat(adsb): improve ACARS/VDL2 panels with history, clear, smooth updates, and translation
- Persist ACARS/VDL2 messages across page refresh via new /acars/messages and /vdl2/messages endpoints backed by FlightCorrelator - Add clear buttons to ACARS/VDL2 sidebars and right-panel datalink section with /acars/clear and /vdl2/clear endpoints - Fix right-panel DATALINK MESSAGES flickering by diffing innerHTML before updating, with opacity transition for smooth refreshes - Add aircraft deselect toggle (click selected aircraft again to deselect) - Enrich VDL2 messages with ACARS label translation (label_description, message_type, parsed fields) matching existing ACARS translator Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,21 @@ class FlightCorrelator:
|
||||
"""Return message without internal correlation fields."""
|
||||
return {k: v for k, v in msg.items() if not k.startswith('_corr_')}
|
||||
|
||||
def get_recent_messages(self, msg_type: str = 'acars', limit: int = 50) -> list[dict]:
|
||||
"""Return the most recent messages (newest first)."""
|
||||
source = self._acars_messages if msg_type == 'acars' else self._vdl2_messages
|
||||
msgs = [self._clean_msg(m) for m in source]
|
||||
msgs.reverse()
|
||||
return msgs[:limit]
|
||||
|
||||
def clear_acars(self) -> None:
|
||||
"""Clear all stored ACARS messages."""
|
||||
self._acars_messages.clear()
|
||||
|
||||
def clear_vdl2(self) -> None:
|
||||
"""Clear all stored VDL2 messages."""
|
||||
self._vdl2_messages.clear()
|
||||
|
||||
@property
|
||||
def acars_count(self) -> int:
|
||||
return len(self._acars_messages)
|
||||
|
||||
Reference in New Issue
Block a user