Show mode A/C data in aircraft table
This commit is contained in:
parent
15c66a379a
commit
5b4ad4d8d9
|
@ -8,6 +8,7 @@ var SiteCircleFeatures = new ol.Collection();
|
|||
var PlaneIconFeatures = new ol.Collection();
|
||||
var PlaneTrailFeatures = new ol.Collection();
|
||||
var Planes = {};
|
||||
var PlanesModeAc = {};
|
||||
var PlanesOrdered = [];
|
||||
var PlaneFilter = {};
|
||||
var SelectedPlane = null;
|
||||
|
@ -65,13 +66,16 @@ function processReceiverUpdate(data) {
|
|||
for (var j=0; j < acs.length; j++) {
|
||||
var ac = acs[j];
|
||||
var hex = ac.hex;
|
||||
var squawk = ac.squawk;
|
||||
var plane = null;
|
||||
|
||||
// Do we already have this plane object in Planes?
|
||||
// If not make it.
|
||||
|
||||
if (Planes[hex]) {
|
||||
if (hex !== "000000" && Planes[hex]) {
|
||||
plane = Planes[hex];
|
||||
} else if (hex === "000000" && PlanesModeAc[squawk]) {
|
||||
plane = PlanesModeAc[squawk];
|
||||
} else {
|
||||
plane = new PlaneObject(hex);
|
||||
plane.filter = PlaneFilter;
|
||||
|
@ -93,6 +97,7 @@ function processReceiverUpdate(data) {
|
|||
$('img', plane.tr.cells[1]).css('display', 'none');
|
||||
}
|
||||
|
||||
if (hex !== "000000") {
|
||||
plane.tr.addEventListener('click', function(h, evt) {
|
||||
if (evt.srcElement instanceof HTMLAnchorElement) {
|
||||
evt.stopPropagation();
|
||||
|
@ -117,6 +122,9 @@ function processReceiverUpdate(data) {
|
|||
}.bind(undefined, hex));
|
||||
|
||||
Planes[hex] = plane;
|
||||
} else {
|
||||
PlanesModeAc[squawk] = plane;
|
||||
}
|
||||
PlanesOrdered.push(plane);
|
||||
}
|
||||
|
||||
|
@ -665,11 +673,13 @@ function reaper() {
|
|||
var plane = PlanesOrdered[i];
|
||||
if (plane.seen > 300) {
|
||||
// Reap it.
|
||||
//console.log("Reaping " + plane.icao);
|
||||
//console.log("parent " + plane.tr.parentNode);
|
||||
plane.tr.parentNode.removeChild(plane.tr);
|
||||
plane.tr = null;
|
||||
if (plane.icao === "000000") {
|
||||
delete PlanesModeAc[plane.squawk];
|
||||
} else {
|
||||
delete Planes[plane.icao];
|
||||
}
|
||||
plane.destroy();
|
||||
} else {
|
||||
// Keep it.
|
||||
|
@ -1336,7 +1346,7 @@ function getFlightAwareIdentLink(ident, linkText) {
|
|||
}
|
||||
|
||||
function getFlightAwareModeSLink(code, linkText) {
|
||||
if (code !== null && code.length > 0 && code[0] !== '~') {
|
||||
if (code !== null && code.length > 0 && code[0] !== '~' && code !== "000000") {
|
||||
if (!linkText) {
|
||||
linkText = "FlightAware: " + code.toUpperCase();
|
||||
}
|
||||
|
@ -1355,7 +1365,7 @@ function getFlightAwarePhotoLink(registration) {
|
|||
}
|
||||
|
||||
function getAirframesModeSLink(code) {
|
||||
if (code !== null && code.length > 0 && code[0] !== '~') {
|
||||
if (code !== null && code.length > 0 && code[0] !== '~' && code !== "000000") {
|
||||
return "<a href=\"http://www.airframes.org/\" onclick=\"$('#airframes_post_icao').attr('value','" + code + "'); document.getElementById('horrible_hack').submit.call(document.getElementById('airframes_post')); return false;\">Airframes.org: " + code.toUpperCase() + "</a>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue