mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-03-03 03:53:52 +01:00
don't differentiate between "human-readable" and "flight"
This commit is contained in:
parent
3a1eb72e8d
commit
b5eee9450c
|
|
@ -404,17 +404,21 @@ $(function(){
|
|||
};
|
||||
|
||||
var linkifyAircraft = function(source, identification) {
|
||||
var aircraftString = identification || source.humanReadable || source.flight || source.icao;
|
||||
var aircraftString = identification || source.flight || source.icao;
|
||||
var link = false;
|
||||
switch (aircraft_tracking_service) {
|
||||
case 'flightaware':
|
||||
if (!source.icao) break;
|
||||
link = 'https://flightaware.com/live/modes/' + source.icao;
|
||||
if (identification) link += "/ident/" + identification
|
||||
link += '/redirect';
|
||||
if (source.icao) {
|
||||
link = 'https://flightaware.com/live/modes/' + source.icao;
|
||||
if (identification) link += "/ident/" + identification
|
||||
link += '/redirect';
|
||||
} else if (source.flight) {
|
||||
link = 'https://flightaware.com/live/flight/' + source.flight;
|
||||
}
|
||||
break;
|
||||
case 'planefinder':
|
||||
if (identification) link = 'https://planefinder.net/flight/' + identification;
|
||||
if (source.flight) link = 'https://planefinder.net/flight/' + source.flight;
|
||||
break;
|
||||
}
|
||||
if (link) {
|
||||
|
|
|
|||
|
|
@ -19,17 +19,17 @@ class AirplaneLocation(LatLngLocation):
|
|||
|
||||
|
||||
class IcaoSource(Source):
|
||||
def __init__(self, icao: str, humanReadable: str = None):
|
||||
def __init__(self, icao: str, flight: str = None):
|
||||
self.icao = icao.upper()
|
||||
self.humanReadable = humanReadable
|
||||
self.flight = flight
|
||||
|
||||
def getKey(self) -> str:
|
||||
return "icao:{}".format(self.icao)
|
||||
|
||||
def __dict__(self):
|
||||
d = {"icao": self.icao}
|
||||
if self.humanReadable is not None:
|
||||
d["humanReadable"] = self.humanReadable
|
||||
if self.flight is not None:
|
||||
d["flight"] = self.flight
|
||||
return d
|
||||
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class AcarsProcessor(JsonParser, metaclass=ABCMeta):
|
|||
"altitude": basic_report["alt"]
|
||||
}
|
||||
if icao is not None:
|
||||
source = IcaoSource(icao, humanReadable=flight_id)
|
||||
source = IcaoSource(icao, flight=flight_id)
|
||||
else:
|
||||
source = AcarsSource(flight_id)
|
||||
Map.getSharedInstance().updateLocation(
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class HFDLMessageParser(AcarsProcessor):
|
|||
if icao is None:
|
||||
source = HfdlSource(hfnpdu["flight_id"])
|
||||
else:
|
||||
source = IcaoSource(icao, humanReadable=hfnpdu["flight_id"])
|
||||
source = IcaoSource(icao, flight=hfnpdu["flight_id"])
|
||||
if "utc_time" in hfnpdu:
|
||||
ts = self.processTimestamp(**hfnpdu["utc_time"])
|
||||
elif "time" in hfnpdu:
|
||||
|
|
|
|||
Loading…
Reference in a new issue