diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index cf7eee72..0bb2d5ac 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -499,6 +499,11 @@ AircraftMessagePanel.prototype.renderAcars = function(acars) { details += '
Basic ADS-C report
'; details += '
Position: ' + basic_report['lat'] + ', ' + basic_report['lon'] + '
'; details += '
Altitude: ' + basic_report['alt'] + '
'; + } else if ('earth_ref_data' in tag) { + var earth_ref_data = tag['earth_ref_data']; + details += '
Track: ' + earth_ref_data['true_trk_deg'] + '
'; + details += '
Speed: ' + earth_ref_data['gnd_spd_kts'] + ' kt
'; + details += '
Vertical speed: ' + earth_ref_data['vspd_ftmin'] + ' ft/min
'; } else if ('cancel_all_contracts' in tag) { details += '
Cancel all ADS-C contracts
'; } else if ('cancel_contract' in tag) { diff --git a/owrx/aeronautical.py b/owrx/aeronautical.py index b62cc6e5..49ce56f9 100644 --- a/owrx/aeronautical.py +++ b/owrx/aeronautical.py @@ -60,22 +60,30 @@ class AcarsProcessor(JsonParser, metaclass=ABCMeta): arinc622 = acars["arinc622"] if "adsc" in arinc622: adsc = arinc622["adsc"] - if "tags" in adsc: + if "tags" in adsc and adsc["tags"]: + msg = {} for tag in adsc["tags"]: if "basic_report" in tag: basic_report = tag["basic_report"] - msg = { + msg.update({ "lat": basic_report["lat"], "lon": basic_report["lon"], - "altitude": basic_report["alt"] - } - if icao is not None: - source = IcaoSource(icao, flight=flight_id) - else: - source = FlightSource(flight_id) - Map.getSharedInstance().updateLocation( - source, AirplaneLocation(msg), "ACARS over {}".format(self.mode) - ) + "altitude": basic_report["alt"], + }) + if "earth_ref_data" in tag: + earth_ref_data = tag["earth_ref_data"] + msg.update({ + "groundtrack": earth_ref_data["true_trk_deg"], + "groundspeed": earth_ref_data["gnd_spd_kts"], + "verticalspeed": earth_ref_data["vspd_ftmin"], + }) + if icao is not None: + source = IcaoSource(icao, flight=flight_id) + else: + source = FlightSource(flight_id) + Map.getSharedInstance().updateLocation( + source, AirplaneLocation(msg), "ACARS over {}".format(self.mode) + ) def processFlight(self, raw): return self.flightRegex.sub(r"\g<1>\g<2>", raw)