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