diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index cf581c08..2792cb38 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -273,6 +273,7 @@ $.fn.pocsagMessagePanel = function() { AdsbMessagePanel = function(el) { MessagePanel.call(this, el); this.aircraft = {} + this.aircraftTrackingService = false; this.initClearTimer(); } @@ -287,13 +288,12 @@ AdsbMessagePanel.prototype.render = function() { '
| ICAO | ' + - 'Callsign | ' + + 'Flight | ' + 'Altitude | ' + 'Speed | ' + 'Track | ' + 'V/S | ' + - 'Lat | ' + - 'Long | ' + + 'Position | ' + '' + '' + state.icao + ' | ' + - '' + ifDefined(state.identification) + ' | ' + + '' + this.linkify(state, state.icao) + ' | ' + + '' + this.linkify(state, ifDefined(state.identification)) + ' | ' + '' + ifDefined(state.altitude) + ' | ' + '' + ifDefined(state.groundspeed || state.IAS || state.TAS, Math.round) + ' | ' + '' + ifDefined(state.groundtrack || state.heading, Math.round) + ' | ' + '' + ifDefined(state.verticalspeed) + ' | ' + - '' + ifDefined(state.lat, coordRound) + ' | ' + - '' + ifDefined(state.lon, coordRound) + ' | ' + + '' + getPosition(state) + ' | ' + '' + state.messages + ' | ' ); }; @@ -361,6 +365,28 @@ AdsbMessagePanel.prototype.initClearTimer = function() { }, 15000); }; +AdsbMessagePanel.prototype.setAircraftTrackingService = function(service) { + this.aircraftTrackingService = service; +}; + +AdsbMessagePanel.prototype.linkify = function(state, text) { + var link = false; + switch (this.aircraftTrackingService) { + case 'flightaware': + link = 'https://flightaware.com/live/modes/' + state.icao; + if (state.identification) link += "/ident/" + state.identification + link += '/redirect'; + break; + case 'planefinder': + if (state.identification) link = 'https://planefinder.net/flight/' + state.identification; + break; + } + if (link) { + return '' + text + ''; + } + return text; + +}; $.fn.adsbMessagePanel = function () { if (!this.data('panel')) { diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index d3767774..40f5240f 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -788,6 +788,9 @@ function on_ws_recv(evt) { if ('tuning_precision' in config) $('#openwebrx-panel-receiver').demodulatorPanel().setTuningPrecision(config['tuning_precision']); + if ('aircraft_tracking_service' in config) + $('#openwebrx-panel-adsb-message').adsbMessagePanel().setAircraftTrackingService(config['aircraft_tracking_service']); + break; case "secondary_config": var s = json['value']; diff --git a/owrx/connection.py b/owrx/connection.py index 450f5a0a..ee8f0745 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -137,6 +137,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): "fft_compression", "max_clients", "tuning_precision", + "aircraft_tracking_service", ] def __init__(self, conn):
|---|