From 78f88c6f8a13ee91cec85e2b81e62cb8a9bdd965 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 14 Oct 2016 21:52:04 +0100 Subject: [PATCH] Use the json type field to show finer-grained datasource info in the table mode. --- public_html/formatter.js | 12 +++++++++++- public_html/planeObject.js | 9 +++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public_html/formatter.js b/public_html/formatter.js index d04448b..8d6dca9 100644 --- a/public_html/formatter.js +++ b/public_html/formatter.js @@ -201,8 +201,18 @@ function format_data_source(source) { switch (source) { case 'mlat': return "MLAT"; - case 'adsb': + case 'adsb_icao': + case 'adsb_other': return "ADS-B"; + case 'adsb_icao_nt': + return "ADS-B (non transponder)"; + case 'adsr_icao': + case 'adsr_other': + return "ADS-R"; + case 'tisb_icao': + case 'tisb_trackfile': + case 'tisb_other': + return "TIS-B"; case 'mode_s': return "Mode S"; case 'mode_ac': diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 27f8468..ddd2130 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -218,9 +218,9 @@ PlaneObject.prototype.getDataSource = function() { return 'mlat'; } - // Not MLAT, but position reported - ADSB + // Not MLAT, but position reported - ADSB or variants if (this.position !== null) { - return 'adsb'; + return this.addrtype; } // Otherwise Mode S @@ -395,6 +395,11 @@ PlaneObject.prototype.updateData = function(receiver_timestamp, data) { this.rssi = data.rssi; this.last_message_time = receiver_timestamp - data.seen; + if (typeof data.type !== "undefined") + this.addrtype = data.type; + else + this.addrtype = 'adsb_icao'; + if (typeof data.altitude !== "undefined") this.altitude = data.altitude; if (typeof data.vert_rate !== "undefined")