1
0
Fork 0
A320-family/Nasal/MCDU/PERFCRZ.nas

37 lines
1,017 B
Text
Raw Normal View History

# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
2019-10-14 16:48:35 +00:00
# Copyright (c) 2020 Matthew Maring (hayden2000)
2019-10-14 16:48:35 +00:00
var perfCRZInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
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) {
if (ci == nil) {
notAllowed(i);
} else if (ci >= 0 and ci <= 999) {
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-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "CLB");
2019-10-14 16:48:35 +00:00
}
if (key == "R6") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "DES");
2019-10-14 16:48:35 +00:00
}
}