Added TTL to aircraft markers, updated ADSB display.
This commit is contained in:
parent
dcd0dbd202
commit
0b222a3ce1
|
|
@ -109,7 +109,10 @@ MarkerManager.prototype.ageAll = function() {
|
|||
var now = new Date().getTime();
|
||||
var data = this.markers;
|
||||
$.each(data, function(id, x) {
|
||||
if (!x.age(now - x.lastseen)) delete data[id];
|
||||
if (x.ttl && now >= x.ttl)
|
||||
delete data[id];
|
||||
else if (x.lastseen && !x.age(now - x.lastseen))
|
||||
delete data[id];
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -651,6 +654,7 @@ AircraftMarker.prototype = new Marker();
|
|||
|
||||
AircraftMarker.prototype.update = function(update) {
|
||||
this.lastseen = update.lastseen;
|
||||
this.ttl = update.ttl;
|
||||
this.mode = update.mode;
|
||||
this.comment = update.location.comment;
|
||||
// HFDL, ACARS, VDL2, ADSB
|
||||
|
|
|
|||
|
|
@ -523,10 +523,10 @@ AdsbMessagePanel.prototype.render = function() {
|
|||
'<th class="flight">Flight</th>' +
|
||||
'<th class="aircraft">Aircraft</th>' +
|
||||
'<th class="squawk">Squawk</th>' +
|
||||
'<th class="distance">Dist (km)</th>' +
|
||||
'<th class="distance">Dist</th>' +
|
||||
'<th class="altitude">Alt (ft)</th>' +
|
||||
'<th class="speed">Speed (kt)</th>' +
|
||||
'<th class="rssi">Sig (dB)</th>' +
|
||||
'<th class="rssi">Signal</th>' +
|
||||
'</tr></thead>' +
|
||||
'<tbody></tbody>' +
|
||||
'</table>'
|
||||
|
|
@ -542,7 +542,7 @@ AdsbMessagePanel.prototype.pushMessage = function(msg) {
|
|||
var odd = false;
|
||||
msg.aircraft.forEach(entry => {
|
||||
// Signal strength
|
||||
var rssi = entry.rssi? entry.rssi : '';
|
||||
var rssi = entry.rssi? entry.rssi + ' dB' : '';
|
||||
|
||||
// Flight identificators
|
||||
var flight =
|
||||
|
|
@ -583,7 +583,7 @@ AdsbMessagePanel.prototype.pushMessage = function(msg) {
|
|||
: entry.flight? entry.flight
|
||||
: null;
|
||||
|
||||
distance = this.distanceKm(entry, this.receiver_pos);
|
||||
distance = this.distanceKm(entry, this.receiver_pos) + ' km';
|
||||
if (id) distance = this.linkToMap(id, distance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ MODE_S_FORMATS = [
|
|||
ADSB_CATEGORIES = {
|
||||
"A0": (0, 0), # No ADS-B emitter category information
|
||||
"A1": (3, 0), # Light (< 15500 lbs)
|
||||
"A2": (5, 0), # Small (15500 to 75000 lbs)
|
||||
"A3": (4, 0), # Large (75000 to 300000 lbs)
|
||||
"A4": (0, 0), # High vortex large (aircraft such as B-757)
|
||||
"A2": (4, 1), # Small (15500 to 75000 lbs)
|
||||
"A3": (5, 0), # Large (75000 to 300000 lbs)
|
||||
"A4": (4, 0), # High vortex large (aircraft such as B-757)
|
||||
"A5": (1, 7), # Heavy (> 300000 lbs)
|
||||
"A6": (7, 0), # High performance (> 5g acceleration and 400 kts)
|
||||
"A7": (6, 5), # Rotorcraft, regardless of weight
|
||||
|
|
@ -81,7 +81,7 @@ class AircraftLocation(LatLngLocation):
|
|||
# Add APRS-like aircraft symbol (red or blue, depending on mode)
|
||||
res["symbol"] = { "x": 0, "y": 0 }
|
||||
# Convert aircraft-specific data into APRS-like data
|
||||
for x in ["icao", "aircraft", "flight", "speed", "altitude", "course", "destination", "origin", "vspeed", "squawk", "rssi", "msglog"]:
|
||||
for x in ["ttl", "icao", "aircraft", "flight", "speed", "altitude", "course", "destination", "origin", "vspeed", "squawk", "rssi", "msglog"]:
|
||||
if x in self.data:
|
||||
res[x] = self.data[x]
|
||||
# Return APRS-like dictionary object
|
||||
|
|
|
|||
Loading…
Reference in New Issue