Fix air/ground status. Tooltip/infoblock changes

This commit is contained in:
James Wilson 2018-08-08 11:37:26 -05:00
parent 540e5f8e95
commit 71f2c99e96
3 changed files with 23 additions and 10 deletions

View file

@ -92,6 +92,17 @@ function format_altitude_long(alt, vr, displayUnits) {
} }
} }
// alt ground/airborne
function format_onground (alt) {
if (alt === null) {
return "n/a";
} else if (alt === "ground") {
return "on ground";
} else {
return "airborne";
}
}
// alt in feet // alt in feet
function convert_altitude(alt, displayUnits) { function convert_altitude(alt, displayUnits) {
if (displayUnits === "metric") { if (displayUnits === "metric") {

View file

@ -272,13 +272,13 @@
<div class="infoblock-container"> <div class="infoblock-container">
<div class="highlightedTitle"> <div class="highlightedTitle">
<span class="identLarge"><span id="selected_callsign">n/a</span></span> <span class="identLarge" title="Typically the air traffic control callsign or the aircraft's registration, as entered into the transponder by the pilot."><span id="selected_callsign">n/a</span></span>
<span class="identSmall"><span id="selected_icao">n/a</span></span> <span class="identSmall" title="The aircraft's unique ICAO identification number shown in hexadecimal format."><span id="selected_icao">n/a</span></span>
</div> </div>
<div class="infoBlockTopSection"> <div class="infoBlockTopSection">
<div class="infoRow removePadding"> <div class="infoRow removePadding">
<div class="infoHeading infoRowFluid">Registration: </div> <div class="infoHeading infoRowFluid"><span title="The alphanumeric registration code assigned by the country in which the aircraft is registered.">Registration</span>: </div>
<div class="infoData infoRowFluid"><span id="selected_registration">n/a</span></div> <div class="infoData infoRowFluid"><span id="selected_registration">n/a</span></div>
</div> </div>
<div class="infoRow removePadding"> <div class="infoRow removePadding">
@ -325,7 +325,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection3"> <div class="infoHeading infoRowFluid fourColumnSection3">
<span title="Whether the aircraft is reporting it is on the ground of airborne.">Air/Ground Status</span>: <span title="Whether the aircraft is reporting it is on the ground or airborne.">Air/Ground Status</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection4"> <div class="infoData infoRowFluid fourColumnSection4">
<span id="selected_onground">n/a</span> <span id="selected_onground">n/a</span>
@ -477,7 +477,7 @@
<div class="infoBlockSection"> <div class="infoBlockSection">
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
<span title="The selected altitude in the aircraft's flight management system.">Nav Altitude</span>: <span title="The selected altitude in the aircraft's flight management system.">Altitude</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_nav_altitude">n/a</span> <span id="selected_nav_altitude">n/a</span>
@ -485,7 +485,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
<span title="The enabled navigation modes as reported by the aircraft (i.e., auto-pilot, Traffic Collision Avoidance System, altitude hold, approach, LNAV approach, and/or VNAV approach).">Nav Modes</span>: <span title="The enabled navigation modes as reported by the aircraft (i.e., auto-pilot, Traffic Collision Avoidance System, altitude hold, approach, LNAV approach, and/or VNAV approach).">Modes</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_nav_modes">n/a</span> <span id="selected_nav_modes">n/a</span>
@ -493,7 +493,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
<span title="The selected heading in the aircraft's flight management system.">Nav Heading</span>: <span title="The selected heading in the aircraft's flight management system.">Heading</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_nav_heading">n/a</span> <span id="selected_nav_heading">n/a</span>
@ -501,7 +501,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
<span title="The altimeter/QNH setting used by the aircraft's navigation systems.">Nav QNH</span>: <span title="The altimeter/QNH setting used by the aircraft's navigation systems.">QNH</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_nav_qnh">n/a</span> <span id="selected_nav_qnh">n/a</span>
@ -549,7 +549,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
Category: <span title="Aircraft category code as reported by the aircraft. This indicates the type of aircraft and, for airplanes, a relative indicator of its size.">Category</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_category">n/a</span> <span id="selected_category">n/a</span>
@ -557,7 +557,7 @@
</div> </div>
<div class="infoRowLine"> <div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1"> <div class="infoHeading infoRowFluid fourColumnSection1">
Last Seen: <span title="The last time your ADS-B site received a message from the aircraft.">Last Seen</span>:
</div> </div>
<div class="infoData infoRowFluid fourColumnSection2"> <div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_seen">n/a</span> <span id="selected_seen">n/a</span>

View file

@ -930,6 +930,8 @@ function refreshSelected() {
$("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate, DisplayUnits)); $("#selected_altitude").text(format_altitude_long(selected.altitude, selected.vert_rate, DisplayUnits));
$('#selected_onground').text(format_onground(selected.altitude));
if (selected.squawk === null || selected.squawk === '0000') { if (selected.squawk === null || selected.squawk === '0000') {
$('#selected_squawk').text('n/a'); $('#selected_squawk').text('n/a');
} else { } else {