Re-enable radio/baro clear, new INIT-A page, fix CLR nasal errors
This commit is contained in:
parent
c7ccadb458
commit
b647909f1a
11 changed files with 73 additions and 36 deletions
|
@ -107,6 +107,8 @@ var cruiseTemp = props.globals.getNode("FMGC/internal/cruise-temp", 1);
|
|||
var cruiseTempSet = props.globals.getNode("FMGC/internal/cruise-temp-set", 1);
|
||||
var tropo = props.globals.getNode("FMGC/internal/tropo", 1);
|
||||
var tropoSet = props.globals.getNode("FMGC/internal/tropo-set", 1);
|
||||
var gndtemp = props.globals.getNode("FMGC/internal/gndtemp", 1);
|
||||
var gndtempSet = props.globals.getNode("FMGC/internal/gndtemp-set", 1);
|
||||
var ADIRSMCDUBTN = props.globals.getNode("controls/adirs/mcducbtn", 1);
|
||||
|
||||
# IRSINIT variables
|
||||
|
@ -1108,13 +1110,13 @@ var canvas_MCDU_base = {
|
|||
me["ArrowLeft"].show();
|
||||
me["ArrowRight"].show();
|
||||
|
||||
me.showLeft(0, 1, 0, 1, 0, 1);
|
||||
me.showLeft(0, 1, 0, -1, 0, 1);
|
||||
me["Simple_L0S"].hide();
|
||||
me.showLeftS(1, 1, 1, 1, 1, 1);
|
||||
me.showLeftS(1, 1, 1, -1, 1, 1);
|
||||
me.showLeftArrow(-1, -1, -1, -1, -1, -1);
|
||||
me.showRight(0, 0, 1, 1, 1, 1);
|
||||
me.showRightS(1, 0, -1, 1, -1, 1);
|
||||
me.showRightArrow(-1, -1, -1, -1, 1, -1);
|
||||
me.showRightS(1, 0, -1, -1, 1, 1);
|
||||
me.showRightArrow(-1, -1, -1, 1, -1, -1);
|
||||
|
||||
me.fontLeft(default, default, default, default, default, default);
|
||||
me.fontLeftS(default, default, default, default, default, default);
|
||||
|
@ -1127,7 +1129,7 @@ var canvas_MCDU_base = {
|
|||
me.colorLeft("blu", "wht", "blu", "blu", "ack", "ack");
|
||||
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorRight("blu", "amb", "amb", "blu", "wht", "blu");
|
||||
me.colorRight("blu", "amb", "amb", "wht", "blu", "blu");
|
||||
me.colorRightS("wht", "amb", "wht", "wht", "wht", "wht");
|
||||
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
|
||||
|
@ -1187,16 +1189,6 @@ var canvas_MCDU_base = {
|
|||
me.showRight(1, -1, 0, 0, 0, 0);
|
||||
me["Simple_R2S"].hide();
|
||||
me["INITA_InitRequest"].hide();
|
||||
dms = getprop("FMGC/flightplan[2]/wp[0]/lat");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "N" : "S";
|
||||
me["Simple_L4"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign);
|
||||
dms = getprop("FMGC/flightplan[2]/wp[0]/lon");
|
||||
degrees = int(dms);
|
||||
minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||
sign = degrees >= 0 ? "E" : "W";
|
||||
me["Simple_R4"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign);
|
||||
} else {
|
||||
me["INITA_CoRoute"].show();
|
||||
me["INITA_FromTo"].show();
|
||||
|
@ -1206,8 +1198,6 @@ var canvas_MCDU_base = {
|
|||
me.showRight(-1, 1, 0, 0, 0, 0);
|
||||
me["Simple_R2S"].show();
|
||||
me["INITA_InitRequest"].show();
|
||||
me["Simple_L4"].setText("----.-");
|
||||
me["Simple_R4"].setText("-----.--");
|
||||
}
|
||||
if (ADIRSMCDUBTN.getValue() != 1) {
|
||||
me["INITA_AlignIRS"].show();
|
||||
|
@ -1219,28 +1209,41 @@ var canvas_MCDU_base = {
|
|||
me.showRightArrow(0, 0, 1, 0, 0, 0);
|
||||
}
|
||||
if (tropoSet.getValue() == 1) {
|
||||
me["Simple_R6"].setFontSize(normal);
|
||||
me["Simple_R5"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_R5"].setFontSize(small);
|
||||
}
|
||||
|
||||
me["Simple_R6S"].setText("GND TEMP");
|
||||
if (getprop("FMGC/status/phase") == 0 and !getprop("FMGC/internal/gndtemp-set")) {
|
||||
setprop("FMGC/internal/gndtemp", 15 - (2 * getprop("position/gear-agl-ft") / 1000));
|
||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
||||
me["Simple_R6"].setFontSize(small);
|
||||
} else {
|
||||
if (getprop("FMGC/internal/gndtemp-set")) {
|
||||
me["Simple_R6"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_R6"].setFontSize(small);
|
||||
}
|
||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
||||
}
|
||||
|
||||
me["Simple_L1S"].setText(" CO RTE");
|
||||
me["Simple_L2S"].setText("ALTN/CO RTE");
|
||||
me["Simple_L3S"].setText("FLT NBR");
|
||||
me["Simple_L4S"].setText("LAT");
|
||||
me["Simple_L5S"].setText("COST INDEX");
|
||||
me["Simple_L6S"].setText("CRZ FL/TEMP");
|
||||
me["Simple_L1"].setText("NONE");
|
||||
me["Simple_L3"].setText(sprintf("%s", flightNum.getValue()));
|
||||
me["Simple_R1S"].setText("FROM/TO ");
|
||||
me["Simple_R2S"].setText("INIT ");
|
||||
me["Simple_R4S"].setText("LONG");
|
||||
me["Simple_R6S"].setText("TROPO");
|
||||
me["Simple_R5S"].setText("TROPO");
|
||||
|
||||
me["Simple_R1"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
||||
me["Simple_R2"].setText("REQUEST ");
|
||||
me["Simple_R3"].setText("IRS INIT ");
|
||||
me["Simple_R5"].setText("WIND ");
|
||||
me["Simple_R6"].setText(sprintf("%5.0f", tropo.getValue()));
|
||||
me["Simple_R4"].setText("WIND ");
|
||||
me["Simple_R5"].setText(sprintf("%5.0f", tropo.getValue()));
|
||||
} else if (page == "IRSINIT") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
me["Simple"].show();
|
||||
|
|
|
@ -33,6 +33,7 @@ var fuelPredInput = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -64,6 +65,7 @@ var fuelPredInput = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -100,6 +102,7 @@ var fuelPredInput = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -187,6 +190,7 @@ var fuelPredInput = func(key, i) {
|
|||
} else if (key == "R4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/fffq-sensor", "FF+FQ");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (find("/", scratchpad) == 0) {
|
||||
var sensor = substr(scratchpad, 1);
|
||||
|
|
|
@ -190,7 +190,7 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
} else if (key == "R3") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "IRSINIT");
|
||||
} else if (key == "R6") {
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
|
@ -206,5 +206,17 @@ var initInputA = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/gndtemp-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and getprop("FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||
setprop("FMGC/internal/gndtemp", scratchpad);
|
||||
setprop("FMGC/internal/gndtemp-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ var initInputB = func(key, i) {
|
|||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -78,6 +79,7 @@ var initInputB = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/rte-rsv", 0.05 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -109,6 +111,7 @@ var initInputB = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-fuel", 0.0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -145,6 +148,7 @@ var initInputB = func(key, i) {
|
|||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/final-fuel", 0.0);
|
||||
setprop("FMGC/internal/final-time", "0030");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
|
@ -272,6 +276,7 @@ var initInputB = func(key, i) {
|
|||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trip-wind", "HD000");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
if (find("TL", scratchpad) != -1 or find("HD", scratchpad) != -1) {
|
||||
|
|
|
@ -528,7 +528,9 @@ var rskbutton = func(btn, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("R5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
|
||||
perfTOInput("R5",i);
|
||||
|
@ -558,6 +560,8 @@ var rskbutton = func(btn, i) {
|
|||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R6",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
|
||||
initInputIRS("R6",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
|
||||
|
|
|
@ -83,11 +83,11 @@ var perfAPPRInput = func(key, i) {
|
|||
} else if (key == "L6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFDES");
|
||||
} else if (key == "R2") {
|
||||
# if (scratchpad == "CLR") {
|
||||
# setprop("FMGC/internal/baro", -1);
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
# } else
|
||||
if (int(scratchpad) != nil and scratchpad >= getprop("FMGC/internal/ldg-elev") and scratchpad <= 5000 + getprop("FMGC/internal/ldg-elev")) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/baro", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and scratchpad >= getprop("FMGC/internal/ldg-elev") and scratchpad <= 5000 + getprop("FMGC/internal/ldg-elev")) {
|
||||
if (getprop("FMGC/internal/radio-no") == 0) {
|
||||
setprop("FMGC/internal/radio", -1);
|
||||
}
|
||||
|
@ -97,12 +97,12 @@ var perfAPPRInput = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
# if (scratchpad == "CLR") {
|
||||
# setprop("FMGC/internal/radio", -1);
|
||||
# setprop("FMGC/internal/radio-no", 0);
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
# } else
|
||||
if (scratchpad == "NO") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/radio", -1);
|
||||
setprop("FMGC/internal/radio-no", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (scratchpad == "NO") {
|
||||
setprop("FMGC/internal/radio", -1);
|
||||
setprop("FMGC/internal/radio-no", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -70,6 +70,7 @@ var perfTOInput = func(key, i) {
|
|||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
|
|
|
@ -11,6 +11,8 @@ var progCLBInput = func(key, i) {
|
|||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
|
|
|
@ -11,6 +11,8 @@ var progCRZInput = func(key, i) {
|
|||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
|
|
|
@ -11,6 +11,8 @@ var progDESInput = func(key, i) {
|
|||
setprop("FMGC/internal/activate-twice", 0);
|
||||
setprop("FMGC/internal/decel", 0);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100) {
|
||||
|
|
|
@ -7,6 +7,8 @@ var progTOInput = func(key, i) {
|
|||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil) {
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and altSet.getValue() <= scratchpad * 100 and getprop("FMGC/internal/cruise-lvl-set")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue