1
0
Fork 0

Improvements to winds format entry, fixes for nasal error

This commit is contained in:
legoboyvdlp R 2020-06-14 18:30:58 +01:00
parent b0807111a9
commit ed66593c1b
8 changed files with 78 additions and 73 deletions

View file

@ -2296,7 +2296,7 @@ var canvas_MCDU_base = {
me["Simple_L4S"].setText("TRANS ALT");
me["Simple_L5S"].setText("THR RED/ACC");
me["Simple_L6S"].setText(" UPLINK");
me["Simple_R2"].setText("[ ] ");
me["Simple_R2"].setText("[ ] ");
me["Simple_R5"].setText(sprintf("%3.0f", engOutAcc.getValue()));
me["Simple_R6"].setText("PHASE ");
me["Simple_R1S"].setText("RWY ");
@ -2372,7 +2372,7 @@ var canvas_MCDU_base = {
} else {
me["Simple_R3"].setFont(symbol);
me["Simple_R3"].setFontSize(small);
me["Simple_R3"].setText("[ ]/[ ]");
me["Simple_R3"].setText("[ ]/[ ]");
}
if (flexSet.getValue() == 1) {
me["Simple_R4"].setFont(default);

View file

@ -430,6 +430,12 @@ var ITAF = {
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue()) {
flightPlanController.autoSequencing();
}
#if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWPTemp).fly_type == "flyBy") {
# flightPlanController.autoSequencing();
#} elsif (FPLN.wp0Dist.getValue() <= 0.1) {
# flightPlanController.autoSequencing();
#}
}
}
},

View file

@ -269,9 +269,9 @@ var updateFuel = func {
temp = getprop("/FMGC/internal/cruise-temp");
dist = flightPlanController.arrivalDist;
wind = getprop("/FMGC/internal/trip-wind");
trpWind = getprop("/FMGC/internal/trip-wind");
wind_value = getprop("/FMGC/internal/trip-wind-value");
if (find("HD", wind) != -1 or find("-", wind) != -1 or find("H", wind) != -1) {
if (find("HD", trpWind) != -1 or find("-", trpWind) != -1 or find("H", trpWind) != -1) {
wind_value = wind_value * -1;
}
dist = dist - (dist * wind_value * 0.002);

View file

@ -52,7 +52,7 @@ var latRev = {
me.L3 = [" HOLD", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["FIX INFO ", nil, "wht"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.arrowsMatrix = [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0]];
me.arrowsColour = [["ack", "wht", "wht", "ack", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0]];
@ -77,7 +77,7 @@ var latRev = {
me.L2 = [" OFFSET", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R1 = ["FIX INFO ", nil, "wht"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
me.R4 = ["[ ]", "NEW DEST", "blu"];
me.arrowsMatrix = [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0]];

View file

@ -35,12 +35,10 @@ var perfAPPRInput = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
var weather = split("/", scratchpad);
var mag = int(weather[0]);
var mags = size(weather[0]);
var wind = int(weather[1]);
var winds = size(weather[1]);
if (mags >= 1 and mags <= 3 and winds >= 1 and winds <= 3) {
if (mag != nil and wind != nil and mag >= 0 and mag <= 360 and wind >= 0 and wind <= 200) {
if (num(weather[0]) != nil and num(weather[1]) != nil and int(weather[0]) >= 0 and int(weather[0]) <= 360 and int(weather[1]) >= 0 and int(weather[1]) <= 200) {
setprop("/FMGC/internal/dest-mag", weather[0]);
setprop("/FMGC/internal/dest-wind", weather[1]);
mcdu_scratchpad.scratchpads[i].empty();

View file

@ -70,10 +70,10 @@ var windCLBPage = {
}
if (me.items >= 5) {
var wind = 0;
wind = fmgc.windController.clb_winds[computer_temp].wind5;
if (wind.altitude != "") {
me.L5 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
var windStore = 0;
windStore = fmgc.windController.clb_winds[computer_temp].wind5;
if (windStore.altitude != "") {
me.L5 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -84,9 +84,9 @@ var windCLBPage = {
}
if (me.items >= 4) {
wind = fmgc.windController.clb_winds[computer_temp].wind4;
if (wind.altitude != "") {
me.L4 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.clb_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -97,9 +97,9 @@ var windCLBPage = {
}
if (me.items >= 3) {
wind = fmgc.windController.clb_winds[computer_temp].wind3;
if (wind.altitude != "") {
me.L3 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.clb_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -110,9 +110,9 @@ var windCLBPage = {
}
if (me.items >= 2) {
wind = fmgc.windController.clb_winds[computer_temp].wind2;
if (wind.altitude != "") {
me.L2 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.clb_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -123,9 +123,9 @@ var windCLBPage = {
}
if (me.items >= 1) {
wind = fmgc.windController.clb_winds[computer_temp].wind1;
if (wind.altitude != "") {
me.L1 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, "TRU WIND/ALT", "blu"];
windStore = fmgc.windController.clb_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];

View file

@ -96,9 +96,10 @@ var windCRZPage = {
# load data
if (me.singleCRZ == 1) {
if (me.items >= 4) {
wind = fmgc.windController.crz_winds[computer_temp].wind4;
if (wind.altitude != "") {
me.L4 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
var windStore = 0;
windStore = fmgc.windController.crz_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -109,9 +110,9 @@ var windCRZPage = {
}
if (me.items >= 3) {
wind = fmgc.windController.crz_winds[computer_temp].wind3;
if (wind.altitude != "") {
me.L3 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.crz_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -122,9 +123,9 @@ var windCRZPage = {
}
if (me.items >= 2) {
wind = fmgc.windController.crz_winds[computer_temp].wind2;
if (wind.altitude != "") {
me.L2 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.crz_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -135,9 +136,9 @@ var windCRZPage = {
}
if (me.items >= 1) {
wind = fmgc.windController.crz_winds[computer_temp].wind1;
if (wind.altitude != "") {
me.L1 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, "TRU WIND/ALT", "blu"];
windStore = fmgc.windController.crz_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
@ -145,9 +146,9 @@ var windCRZPage = {
}
}
wind = fmgc.windController.crz_winds[computer_temp].sat1;
if (wind.altitude != "") {
me.L5 = [wind.temp ~ "/" ~ wind.altitude, "SAT / ALT", "blu"];
windStore = fmgc.windController.crz_winds[computer_temp].sat1;
if (windStore.altitude != "") {
me.L5 = [windStore.temp ~ "/" ~ windStore.altitude, "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]", "SAT / ALT", "blu"];
@ -155,9 +156,9 @@ var windCRZPage = {
}
} else {
if (me.items >= 4) {
wind = fmgc.windController.winds[computer_temp][me.match_location].wind4;
if (wind.altitude != "") {
me.L4 = [sprintf("%03.0f", wind.heading) ~ "°/" ~sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.winds[computer_temp][me.match_location].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -168,9 +169,9 @@ var windCRZPage = {
}
if (me.items >= 3) {
wind = fmgc.windController.winds[computer_temp][me.match_location].wind3;
if (wind.altitude != "") {
me.L3 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.winds[computer_temp][me.match_location].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -181,9 +182,9 @@ var windCRZPage = {
}
if (me.items >= 2) {
wind = fmgc.windController.winds[computer_temp][me.match_location].wind2;
if (wind.altitude != "") {
me.L2 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.winds[computer_temp][me.match_location].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -194,9 +195,9 @@ var windCRZPage = {
}
if (me.items >= 1) {
wind = fmgc.windController.winds[computer_temp][me.match_location].wind1;
if (wind.altitude != "") {
me.L1 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, "TRU WIND/ALT", "blu"];
windStore = fmgc.windController.winds[computer_temp][me.match_location].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
@ -204,9 +205,9 @@ var windCRZPage = {
}
}
wind = fmgc.windController.winds[computer_temp][me.match_location].sat1;
if (wind.altitude != "") {
me.L5 = [wind.temp ~ "/" ~ wind.altitude, "SAT / ALT", "blu"];
windStore = fmgc.windController.winds[computer_temp][me.match_location].sat1;
if (windStore.altitude != "") {
me.L5 = [windStore.temp ~ "/" ~ windStore.altitude, "SAT / ALT", "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]", "SAT / ALT", "blu"];

View file

@ -71,10 +71,10 @@ var windDESPage = {
}
if (me.items >= 5) {
var wind = 0;
wind = fmgc.windController.des_winds[computer_temp].wind5;
var windStore = 0;
windStore = fmgc.windController.des_winds[computer_temp].wind5;
if (wind.altitude != "") {
me.L5 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
me.L5 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][4] = 1;
} else {
me.L5 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -85,9 +85,9 @@ var windDESPage = {
}
if (me.items >= 4) {
wind = fmgc.windController.des_winds[computer_temp].wind4;
if (wind.altitude != "") {
me.L4 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.des_winds[computer_temp].wind4;
if (windStore.altitude != "") {
me.L4 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][3] = 1;
} else {
me.L4 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -98,9 +98,9 @@ var windDESPage = {
}
if (me.items >= 3) {
wind = fmgc.windController.des_winds[computer_temp].wind3;
if (wind.altitude != "") {
me.L3 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.des_winds[computer_temp].wind3;
if (windStore.altitude != "") {
me.L3 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -111,9 +111,9 @@ var windDESPage = {
}
if (me.items >= 2) {
wind = fmgc.windController.des_winds[computer_temp].wind2;
if (wind.altitude != "") {
me.L2 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, nil, "blu"];
windStore = fmgc.windController.des_winds[computer_temp].wind2;
if (windStore.altitude != "") {
me.L2 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, nil, "blu"];
me.fontMatrix[0][1] = 1;
} else {
me.L2 = ["[ ]/[ ]/[ ]", nil, "blu"];
@ -124,9 +124,9 @@ var windDESPage = {
}
if (me.items >= 1) {
wind = fmgc.windController.des_winds[computer_temp].wind1;
if (wind.altitude != "") {
me.L1 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude) ~ "/" ~ wind.altitude, "TRU WIND/ALT", "blu"];
windStore = fmgc.windController.des_winds[computer_temp].wind1;
if (windStore.altitude != "") {
me.L1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude) ~ "/" ~ windStore.altitude, "TRU WIND/ALT", "blu"];
me.fontMatrix[0][0] = 1;
} else {
me.L1 = ["[ ]/[ ]/[ ]", "TRU WIND/ALT", "blu"];
@ -137,9 +137,9 @@ var windDESPage = {
me.L6 = [" RETURN", nil, "wht"];
if (getprop("/FMGC/internal/alt-set")) {
wind = fmgc.windController.des_winds[computer_temp].alt1;
if (wind.heading != 0 and wind.magnitude != 0) {
me.R1 = [sprintf("%03.0f", wind.heading) ~ "°/" ~ sprintf("%03.0f", wind.magnitude), "ALTN WIND ", "blu"];
windStore = fmgc.windController.des_winds[computer_temp].alt1;
if (windStore.heading != 0 and windStore.magnitude != 0) {
me.R1 = [sprintf("%03.0f", windStore.heading) ~ "°/" ~ sprintf("%03.0f", windStore.magnitude), "ALTN WIND ", "blu"];
me.fontMatrix[1][0] = 1;
} else {
me.R1 = ["[ ]/[ ]", "ALTN WIND ", "blu"];