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

34 lines
1.2 KiB
Text
Raw Normal View History

2020-04-30 19:26:36 +00:00
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progDESInput = func(key, i) {
2020-05-23 00:40:01 +00:00
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
2020-07-10 00:09:19 +00:00
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
2020-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
2020-07-11 13:03:30 +00:00
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
2020-07-10 19:28:17 +00:00
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
2020-07-10 00:09:19 +00:00
fmgc.FMGCInternal.crzProg = scratchpad;
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].empty();
2020-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
2020-07-11 13:03:30 +00:00
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
}
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
}
}
}