diff --git a/html/planeObject.js b/html/planeObject.js index 5875523..9e73033 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -50,6 +50,12 @@ function PlaneObject(icao) { this.geom_rate = null; this.vert_rate = null; + + this.wd = null; + this.ws = null; + this.oat = null; + this.tat = null; + this.version = null; this.prev_position = null; @@ -1297,6 +1303,7 @@ PlaneObject.prototype.updateData = function(now, last, data, init) { this.wd = data.wd; this.ws = data.ws; this.oat = data.oat; + this.tat = data.tat; // fields with more complex behaviour @@ -2145,7 +2152,7 @@ PlaneObject.prototype.updateTraceData = function(state, _now) { this.track = null; } else { this.track = track; - this.true_heading = null; + //this.true_heading = null; } if (track) @@ -2275,6 +2282,11 @@ PlaneObject.prototype.setNull = function() { this.geom_rate = null; this.vert_rate = null; + this.wd = null; + this.ws = null; + this.oat = null; + this.tat = null; + this.version = null; this.prev_position = null; diff --git a/html/script.js b/html/script.js index b39d894..608b3bc 100644 --- a/html/script.js +++ b/html/script.js @@ -1853,14 +1853,16 @@ function refreshSelected() { let oat = null; + let tat = null; - if (selected.oat != null && selected.mach != null) { + if (selected.tat != null && selected.oat != null) { oat = selected.oat; + tat = selected.tat; } else if (!globeIndex && selected.mach != null && selected.tas != null) { oat = Math.pow((selected.tas / 661.47 / selected.mach), 2) * 288.15 - 273.15; + tat = -273.15 + (oat + 273.15) * (1 + 0.2 * selected.mach * selected.mach); } - let tat = -273.15 + (selected.oat + 273.15) * (1 + 0.2 * selected.mach * selected.mach); if (oat != null) $('#selected_temp').text(Math.round(tat) + ' / ' + Math.round(oat) + ' °C');