mirror of
https://github.com/jketterl/openwebrx.git
synced 2025-12-06 07:12:09 +01:00
parse additional position data, if available
This commit is contained in:
parent
f1995d3c6b
commit
285afb14d7
|
|
@ -499,6 +499,11 @@ AircraftMessagePanel.prototype.renderAcars = function(acars) {
|
|||
details += '<div>Basic ADS-C report</div>';
|
||||
details += '<div>Position: ' + basic_report['lat'] + ', ' + basic_report['lon'] + '</div>';
|
||||
details += '<div>Altitude: ' + basic_report['alt'] + '</div>';
|
||||
} else if ('earth_ref_data' in tag) {
|
||||
var earth_ref_data = tag['earth_ref_data'];
|
||||
details += '<div>Track: ' + earth_ref_data['true_trk_deg'] + '</div>';
|
||||
details += '<div>Speed: ' + earth_ref_data['gnd_spd_kts'] + ' kt</div>';
|
||||
details += '<div>Vertical speed: ' + earth_ref_data['vspd_ftmin'] + ' ft/min</div>';
|
||||
} else if ('cancel_all_contracts' in tag) {
|
||||
details += '<div>Cancel all ADS-C contracts</div>';
|
||||
} else if ('cancel_contract' in tag) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue