fix wind / temperature being bogus when viewing traces

This commit is contained in:
Matthias Wirth
2020-04-22 08:53:27 +02:00
parent cfbbeb66a1
commit ce369caa78
2 changed files with 17 additions and 3 deletions

View File

@@ -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');