From c0c43cd734dc9a376fea2d9bfb39e3a5e16c950d Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 16 Mar 2021 22:15:15 +0100 Subject: [PATCH] display PIA / LADD --- html/planeObject.js | 4 ++++ html/script.js | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/html/planeObject.js b/html/planeObject.js index 8c1043b..8e9b57a 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -2068,6 +2068,8 @@ PlaneObject.prototype.getAircraftData = function() { this.interesting = (data[2][1] == '1'); this.pia = (data[2][2] == '1'); this.ladd = (data[2][3] == '1'); + if (this.pia) + this.registration = null; } this.dataChanged(); @@ -2617,6 +2619,8 @@ PlaneObject.prototype.checkForDB = function(t) { this.interesting = t.dbFlags & 2; this.pia = t.dbFlags & 4; this.ladd = t.dbFlags & 8; + if (this.pia) + this.registration = null; } this.regLoaded = true; this.dataChanged(); diff --git a/html/script.js b/html/script.js index c3177f8..698fd1f 100644 --- a/html/script.js +++ b/html/script.js @@ -2225,14 +2225,19 @@ function refreshSelected() { $('#anon_mlat_info').addClass('hidden'); $('#reg_info').removeClass('hidden'); } - if (selected.registration != selReg) { - selReg = selected.registration + let checkReg = selected.registration + ' ' + selected.regLoaded; + if (checkReg != selReg) { + selReg = checkReg; if (selected.registration) { if (flightawareLinks) { $('#selected_registration').html(getFlightAwareIdentLink(selected.registration, selected.registration)); + } else if (selected.ladd) { + $('#selected_registration').html(selected.registration + ' (LADD)'); } else { $('#selected_registration').text(selected.registration); } + } else if (selected.pia) { + $('#selected_registration').html('n/a (PIA)'); } else { $('#selected_registration').text("n/a"); }