2020-03-30 03:39:31 +00:00
|
|
|
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
|
|
|
|
|
|
|
var progCRZInput = func(key, i) {
|
2020-03-30 21:11:32 +00:00
|
|
|
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
|
|
|
if (key == "L1") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("FMGC/internal/cruise-fl-prog", getprop("FMGC/internal/cruise-fl"));
|
2020-04-10 18:38:58 +00:00
|
|
|
if (getprop("FMGC/status/phase") == 5) {
|
|
|
|
setprop("FMGC/status/phase", 3);
|
|
|
|
setprop("FMGC/internal/activate-once", 0);
|
|
|
|
setprop("FMGC/internal/activate-twice", 0);
|
|
|
|
setprop("FMGC/internal/decel", 0);
|
|
|
|
}
|
2020-03-30 21:11:32 +00:00
|
|
|
} 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) {
|
|
|
|
setprop("FMGC/internal/cruise-fl-prog", scratchpad);
|
|
|
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
2020-04-10 18:38:58 +00:00
|
|
|
if (getprop("FMGC/status/phase") == 5) {
|
|
|
|
setprop("FMGC/status/phase", 3);
|
|
|
|
setprop("FMGC/internal/activate-once", 0);
|
|
|
|
setprop("FMGC/internal/activate-twice", 0);
|
|
|
|
setprop("FMGC/internal/decel", 0);
|
|
|
|
}
|
2020-03-30 21:11:32 +00:00
|
|
|
} else {
|
|
|
|
notAllowed(i);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
notAllowed(i);
|
|
|
|
}
|
2020-03-30 03:39:31 +00:00
|
|
|
}
|
|
|
|
}
|