1
0
Fork 0

Fix FL in history wind

This commit is contained in:
Matthew Maring 2020-08-08 08:55:49 -04:00
parent 0aefdda66d
commit 601d733e46
2 changed files with 7 additions and 7 deletions

View file

@ -716,10 +716,10 @@ var masterFMGC = maketimer(0.2, func {
if (FMGCInternal.phase == 3 or FMGCInternal.phase == 4 or FMGCInternal.phase == 6) {
var windsDidChange = 0;
if (FMGCInternal.crzFt > 5000 and alt > 4980 and alt < 5020) {
if (sprintf("%03d", getprop("/environment/wind-from-heading-deg/")) != fmgc.windController.fl050_wind[0] or sprintf("%03d", getprop("/environment/wind-speed-kt/")) != fmgc.windController.fl050_wind[1]) {
fmgc.windController.fl050_wind[0] = sprintf("%03d", getprop("/environment/wind-from-heading-deg/"));
fmgc.windController.fl050_wind[1] = sprintf("%03d", getprop("/environment/wind-speed-kt/"));
fmgc.windController.fl050_wind[2] = "FL050";
if (sprintf("%03d", getprop("/environment/wind-from-heading-deg/")) != fmgc.windController.fl50_wind[0] or sprintf("%03d", getprop("/environment/wind-speed-kt/")) != fmgc.windController.fl50_wind[1]) {
fmgc.windController.fl50_wind[0] = sprintf("%03d", getprop("/environment/wind-from-heading-deg/"));
fmgc.windController.fl50_wind[1] = sprintf("%03d", getprop("/environment/wind-speed-kt/"));
fmgc.windController.fl50_wind[2] = "FL50";
windsDidChange = 1;
}
}

View file

@ -94,7 +94,7 @@ var windController = {
crz_winds: [0, 0, 0],
des_winds: [0, 0, 0],
hist_winds: 0,
fl050_wind: [-1, -1, ""],
fl50_wind: [-1, -1, ""],
fl150_wind: [-1, -1, ""],
fl250_wind: [-1, -1, ""],
flcrz_wind: [-1, -1, ""],
@ -271,8 +271,8 @@ var windController = {
var file = io.open(path, "wb");
var winds_added = 0;
if (me.fl050_wind[2] != "") {
io.write(file, me.fl050_wind[0] ~ "," ~ me.fl050_wind[1] ~ "," ~ me.fl050_wind[2] ~ "\n");
if (me.fl50_wind[2] != "") {
io.write(file, me.fl50_wind[0] ~ "," ~ me.fl50_wind[1] ~ "," ~ me.fl50_wind[2] ~ "\n");
winds_added += 1;
}