Implement alternate airport on INTA
This commit is contained in:
parent
510bea159c
commit
23142d2959
5 changed files with 39 additions and 6 deletions
|
@ -937,7 +937,11 @@ var canvas_MCDU_base = {
|
|||
me["INITA_FromTo"].hide();
|
||||
me["Simple_L1"].show();
|
||||
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
|
||||
me["Simple_L2"].setText("NONE");
|
||||
if (alt_airport.getValue() == "") {
|
||||
me["Simple_L2"].setText("NONE");
|
||||
} else {
|
||||
me["Simple_L2"].setText(alt_airport.getValue());
|
||||
}
|
||||
me["Simple_R1"].show();
|
||||
me["Simple_R2"].hide();
|
||||
me["Simple_R2S"].hide();
|
||||
|
@ -1249,7 +1253,11 @@ var canvas_MCDU_base = {
|
|||
} else {
|
||||
me["Simple_L1"].setText(arrArpt.getValue());
|
||||
}
|
||||
me["Simple_L2"].setText("----");
|
||||
if (!engrdy.getBoolValue() or alt_airport.getValue() == "") {
|
||||
me["Simple_L2"].setText("----");
|
||||
} else {
|
||||
me["Simple_L2"].setText(alt_airport.getValue());
|
||||
}
|
||||
|
||||
me["Simple_L1S"].setText("AT");
|
||||
me["Simple_L2S"].setText("X");
|
||||
|
|
|
@ -155,13 +155,19 @@ var trimReset = func {
|
|||
var updateARPT = func {
|
||||
dep = getprop("FMGC/internal/dep-arpt");
|
||||
arr = getprop("FMGC/internal/arr-arpt");
|
||||
alt = getprop("FMGC/internal/alt-airport");
|
||||
setprop("autopilot/route-manager/departure/airport", dep);
|
||||
setprop("autopilot/route-manager/destination/airport", arr);
|
||||
setprop("autopilot/route-manager/alternate/airport", alt);
|
||||
if (getprop("autopilot/route-manager/active") != 1) {
|
||||
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
|
||||
}
|
||||
}
|
||||
|
||||
# var updateVSPEEDS = func {
|
||||
#
|
||||
# }
|
||||
|
||||
setlistener("/FMGC/internal/cruise-ft", func {
|
||||
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("FMGC/internal/cruise-ft"));
|
||||
});
|
||||
|
|
|
@ -1,10 +1,29 @@
|
|||
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
|
||||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
||||
|
||||
var initInputA = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L3") {
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 1) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
|
|
|
@ -64,7 +64,7 @@ var MCDU_reset = func(i) {
|
|||
setprop("FMGC/internal/extra-time", "0000");
|
||||
|
||||
#FUELPRED
|
||||
setprop("FMGC/internal/alt-airport", 0);
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("FMGC/internal/pri-utc", "0000");
|
||||
setprop("FMGC/internal/alt-utc", "0000");
|
||||
setprop("FMGC/internal/pri-efob", 0);
|
||||
|
@ -169,7 +169,7 @@ var lskbutton = func(btn, i) {
|
|||
}
|
||||
} else if (btn == "2") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
PerfInput("L2",i);
|
||||
initInputA("L2",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("L2",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||
|
|
|
@ -25,7 +25,7 @@ var perfAPPRInput = func(key, i) {
|
|||
setprop("FMGC/internal/dest-qnh", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (scratchpad >= 0 and scratchpad < 1100) {
|
||||
} else if (scratchpad >= 0 and scratchpad <= 1100) {
|
||||
setprop("FMGC/internal/dest-qnh", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue