From b4490c7b4778ca6351bdbbb22869e8be7c7d94be Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Wed, 15 Jul 2015 17:07:28 +0100 Subject: [PATCH] Clear markers and don't color rows if the aircraft sees no positions for 60s, even if they are still receiving other messages. The marker/trail can be redisplayed by selecting the plane from the table. --- public_html/planeObject.js | 6 ++++-- public_html/script.js | 15 +++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 797c5af..318d469 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -326,14 +326,16 @@ PlaneObject.prototype.updateTick = function(receiver_timestamp, last_timestamp) } } else { this.visible = true; - if (this.position !== null) { + if (this.position !== null && (this.selected || this.seen_pos < 60)) { if (this.updateTrack(receiver_timestamp - last_timestamp + (this.position_from_mlat ? 30 : 5))) { this.updateLines(); this.updateMarker(true); } else { this.updateMarker(false); // didn't move } - } + } else { + this.clearMarker(); + } } }; diff --git a/public_html/script.js b/public_html/script.js index b399bc7..3c99fb6 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -634,10 +634,13 @@ function refreshTableInfo() { TrackedAircraft++; var classes = "plane_table_row"; - if (tableplane.position_from_mlat) - classes += " mlat"; - else if (tableplane.position !== null) - classes += " vPosition"; + if (tableplane.position !== null && tableplane.seen_pos < 60) { + ++TrackedAircraftPositions; + if (tableplane.position_from_mlat) + classes += " mlat"; + else + classes += " vPosition"; + } if (tableplane.icao == SelectedPlane) classes += " selected"; @@ -651,10 +654,6 @@ function refreshTableInfo() { tableplane.tr.cells[2].textContent = (tableplane.squawk !== null ? tableplane.squawk : ""); tableplane.tr.cells[3].textContent = format_altitude_brief(tableplane.altitude, tableplane.vert_rate); tableplane.tr.cells[4].textContent = format_speed_brief(tableplane.speed); - - if (tableplane.position !== null) - ++TrackedAircraftPositions; - tableplane.tr.cells[5].textContent = format_distance_brief(tableplane.sitedist); tableplane.tr.cells[6].textContent = format_track_brief(tableplane.track); tableplane.tr.cells[7].textContent = tableplane.messages;