Fixed aircraft title linkify(), VDL2 altitudes, etc.

This commit is contained in:
Marat Fayzullin 2023-09-25 23:22:00 -04:00
parent 682441caf2
commit 768a16171d
4 changed files with 9 additions and 15 deletions

View File

@ -817,17 +817,18 @@ AircraftMarker.prototype.getInfoHTML = function(name, receiverMarker = null) {
distance = ' at ' + Marker.distanceKm(receiverMarker.position, this.position) + ' km';
}
// Linkify title based on what it is (vessel, flight, mode-S code, or else)
var url = modes_url;
if (this.flight) {
// Linkify title based on what it is (flight, aircraft, ICAO code)
var text = this.flight? this.flight : this.aircraft? this.aircraft : name;
var url = modes_url;
if (this.flight && this.flight.match(/^[A-Z]{3}[0-9]+[A-Z]*$/)) {
name = this.flight;
url = this.flight.match(/^[A-Z]{3}[0-9]+[A-Z]*$/)? flight_url : null;
} else if (this.aircraft) {
url = flight_url;
} else if(this.aircraft) {
name = this.aircraft;
url = flight_url;
}
return '<h3>' + Marker.linkify(name, url) + distance + '</h3>'
return '<h3>' + Marker.linkify(text, url, name) + distance + '</h3>'
+ '<div align="center">' + timeString + ' using ' + this.mode + '</div>'
+ commentString + detailsString + messageString;
};

View File

@ -401,12 +401,6 @@ MapManager.prototype.processUpdates = function(updates) {
case 'latlon':
var marker = self.mman.find(update.callsign);
if (update.location.symbol) {
options.symbol = update.location.symbol;
options.course = update.location.course;
options.speed = update.location.speed;
}
// If new item, create a new marker for it
if (!marker) {
switch(update.mode) {

View File

@ -484,7 +484,7 @@ class Vdl2Parser(AircraftParser):
out["lon"] = p["value"]["loc"]["lon"]
# Ignore dummy altitude value
alt = p["value"]["alt"]
if alt < 255000:
if alt < 192000:
# Convert altitude from feet into meters
out["altitude"] = round(alt)
elif p["name"] == "dst_airport":

View File

@ -341,8 +341,7 @@ class ServiceHandler(SdrSourceEventClient):
return AcarsDemodulator(service=True)
elif mod == "adsb":
from csdr.chain.toolbox import AdsbDemodulator
# return AdsbDemodulator(service=True)
return AdsbDemodulator(service=True, jsonFile="/tmp/dump1090/aircraft.json")
return AdsbDemodulator(service=True)
raise ValueError("unsupported service modulation: {}".format(mod))