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>Basic ADS-C report</div>';
|
||||||
details += '<div>Position: ' + basic_report['lat'] + ', ' + basic_report['lon'] + '</div>';
|
details += '<div>Position: ' + basic_report['lat'] + ', ' + basic_report['lon'] + '</div>';
|
||||||
details += '<div>Altitude: ' + basic_report['alt'] + '</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) {
|
} else if ('cancel_all_contracts' in tag) {
|
||||||
details += '<div>Cancel all ADS-C contracts</div>';
|
details += '<div>Cancel all ADS-C contracts</div>';
|
||||||
} else if ('cancel_contract' in tag) {
|
} else if ('cancel_contract' in tag) {
|
||||||
|
|
|
||||||
|
|
@ -60,22 +60,30 @@ class AcarsProcessor(JsonParser, metaclass=ABCMeta):
|
||||||
arinc622 = acars["arinc622"]
|
arinc622 = acars["arinc622"]
|
||||||
if "adsc" in arinc622:
|
if "adsc" in arinc622:
|
||||||
adsc = arinc622["adsc"]
|
adsc = arinc622["adsc"]
|
||||||
if "tags" in adsc:
|
if "tags" in adsc and adsc["tags"]:
|
||||||
|
msg = {}
|
||||||
for tag in adsc["tags"]:
|
for tag in adsc["tags"]:
|
||||||
if "basic_report" in tag:
|
if "basic_report" in tag:
|
||||||
basic_report = tag["basic_report"]
|
basic_report = tag["basic_report"]
|
||||||
msg = {
|
msg.update({
|
||||||
"lat": basic_report["lat"],
|
"lat": basic_report["lat"],
|
||||||
"lon": basic_report["lon"],
|
"lon": basic_report["lon"],
|
||||||
"altitude": basic_report["alt"]
|
"altitude": basic_report["alt"],
|
||||||
}
|
})
|
||||||
if icao is not None:
|
if "earth_ref_data" in tag:
|
||||||
source = IcaoSource(icao, flight=flight_id)
|
earth_ref_data = tag["earth_ref_data"]
|
||||||
else:
|
msg.update({
|
||||||
source = FlightSource(flight_id)
|
"groundtrack": earth_ref_data["true_trk_deg"],
|
||||||
Map.getSharedInstance().updateLocation(
|
"groundspeed": earth_ref_data["gnd_spd_kts"],
|
||||||
source, AirplaneLocation(msg), "ACARS over {}".format(self.mode)
|
"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):
|
def processFlight(self, raw):
|
||||||
return self.flightRegex.sub(r"\g<1>\g<2>", raw)
|
return self.flightRegex.sub(r"\g<1>\g<2>", raw)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue