2020-04-30 19:26:36 +00:00
|
|
|
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
|
2019-10-14 16:48:35 +00:00
|
|
|
|
2020-04-30 19:26:36 +00:00
|
|
|
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
2019-10-14 16:48:35 +00:00
|
|
|
|
|
|
|
var perfDESInput = func(key, i) {
|
2020-03-28 20:40:02 +00:00
|
|
|
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
2020-03-25 14:54:39 +00:00
|
|
|
if (key == "L2") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("FMGC/internal/cost-index", 0);
|
|
|
|
setprop("FMGC/internal/cost-index-set", 0);
|
|
|
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
|
|
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
|
|
|
} else {
|
|
|
|
var ci = int(scratchpad);
|
|
|
|
var cis = size(scratchpad);
|
|
|
|
if (cis >= 1 and cis <= 3) {
|
2020-03-30 01:27:18 +00:00
|
|
|
if (ci != nil and ci >= 0 and ci <= 999) {
|
2020-03-25 14:54:39 +00:00
|
|
|
setprop("FMGC/internal/cost-index", ci);
|
|
|
|
setprop("FMGC/internal/cost-index-set", 1);
|
|
|
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
|
|
|
} else {
|
|
|
|
notAllowed(i);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
notAllowed(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L6") {
|
2020-04-10 18:38:58 +00:00
|
|
|
if (getprop("FMGC/status/phase") == 4) {
|
|
|
|
if (getprop("FMGC/internal/activate-once") == 1) {
|
|
|
|
if (getprop("FMGC/internal/activate-twice") == 0) {
|
|
|
|
setprop("FMGC/internal/activate-twice", 1);
|
|
|
|
setprop("FMGC/status/phase", 5);
|
|
|
|
setprop("FMGC/internal/decel", 1);
|
|
|
|
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
|
|
|
} else {
|
|
|
|
notAllowed(i);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setprop("FMGC/internal/activate-once", 1);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setprop("MCDU[" ~ i ~ "]/page", "PERFCRZ");
|
|
|
|
}
|
2020-02-24 20:54:10 +00:00
|
|
|
} else if (key == "R6") {
|
2020-03-30 03:39:31 +00:00
|
|
|
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
}
|