Update NAC displays. Add RC

This commit is contained in:
James Wilson 2018-08-02 13:04:44 -05:00
parent 12151ed8f5
commit ea7a2c1c09
4 changed files with 67 additions and 12 deletions

View file

@ -225,3 +225,52 @@ function format_data_source(source) {
return "";
}
function format_nac_p (value) {
switch (value) {
case 0:
return "EPU ≥ 18.52 km";
case 1:
return "EPU < 18.52 km";
case 2:
return "EPU < 7.408 km";
case 3:
return "EPU < 3.704 km";
case 4:
return "EPU < 1852 m";
case 5:
return "EPU < 926 m";
case 6:
return "EPU < 555.6 m";
case 7:
return "EPU < 185.2 m";
case 8:
return "EPU < 92.6 m";
case 9:
return "EPU < 30 m";
case 10:
return "EPU < 10 m";
case 11:
return "EPU < 3 m";
default:
return "n/a";
}
}
function format_nac_v (value) {
switch (value) {
case 0:
return "Unknown or 10 m/s";
case 1:
return "< 10 m/s";
case 2:
return "< 3 m/s";
case 3:
return "< 1 m/s";
case 4:
return "< 0.3 m/s";
default:
return "n/a";
}
}

View file

@ -592,7 +592,7 @@
<span title="Navigation accuracy category of the velocity (95% bound on velocities).">NAC<sub>V</sub></span>:
</div>
<div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_nac_p">n/a</span>
<span id="selected_nac_v">n/a</span>
</div>
</div>
<div class="infoRowLine">
@ -603,7 +603,14 @@
<span id="selected_nic_baro">n/a</span>
</div>
</div>
<!-- </div> -->
<div class="infoRowLine">
<div class="infoHeading infoRowFluid fourColumnSection1">
RC:
</div>
<div class="infoData infoRowFluid fourColumnSection2">
<span id="selected_rc">n/a</span>
</div>
</div>
</div>

View file

@ -29,6 +29,7 @@ function PlaneObject(icao) {
this.nav_heading = null;
this.nav_modes = null;
this.nav_qnh = null;
this.rc = null;
this.nac_p = null;
this.nac_v = null;
@ -446,7 +447,7 @@ PlaneObject.prototype.updateData = function(receiver_timestamp, data) {
"track_rate", "mag_heading", "true_heading", "mach",
"roll", "nav_altitude", "nav_heading", "nav_modes",
"nac_p", "nac_v", "nic_baro", "sil_type", "sil",
"nav_qnh", "baro_rate", "geom_rate",
"nav_qnh", "baro_rate", "geom_rate", "rc",
"squawk", "category", "version"];
for (var i = 0; i < fields.length; ++i) {

View file

@ -249,7 +249,6 @@ function initialize() {
// to make the infoblock responsive
$('#sidebar_container').on('resize', function() {
console.log('sidebar resize', $('#sidebar_canvas').width());
if ($('#sidebar_container').width() < 500) {
$('#selected_infoblock').addClass('infoblock-container-small');
} else {
@ -1037,16 +1036,15 @@ function refreshSelected() {
$('#selected_nic_baro').text("not cross-checked");
}
}
if (selected.nac_p == null) {
$('#selected_nac_p').text("n/a");
$('#selected_nac_p').text(format_nac_p(selected.nac_p));
$('#selected_nac_v').text(format_nac_v(selected.nac_v));
if (selected.rc == null) {
$('#selected_rc').text("n/a");
} else {
$('#selected_nac_p').text(selected.nac_p);
}
if (selected.nac_v == null) {
$('#selected_nac_v').text("n/a");
} else {
$('#selected_nac_v').text(selected.nac_v);
$('#selected_rc').text(format_distance_long(selected.rc, DisplayUnits));
}
if (selected.sil == null || selected.sil_type == null) {
$('#selected_sil').text("n/a");
} else {