2020-04-30 19:26:36 +00:00
|
|
|
# Copyright (c) 2020 Matthew Maring (mattmaring)
|
2020-03-22 13:03:02 +00:00
|
|
|
|
2020-03-22 13:46:54 +00:00
|
|
|
# uses universal values, will implement separately once FPLN is finished
|
|
|
|
|
2020-03-22 13:03:02 +00:00
|
|
|
var perfGAInput = func(key, i) {
|
2020-05-23 00:40:01 +00:00
|
|
|
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
2020-03-22 13:46:54 +00:00
|
|
|
if (key == "L5") {
|
|
|
|
if (scratchpad == "CLR") {
|
2021-04-22 21:44:17 +00:00
|
|
|
setprop("/fdm/jsbsim/fadec/clbreduc-ft", 1500);
|
2020-09-20 19:52:54 +00:00
|
|
|
setprop("/FMGC/internal/accel-agl-ft", 1500);
|
2020-03-22 13:46:54 +00:00
|
|
|
setprop("MCDUC/thracc-set", 0);
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_scratchpad.scratchpads[i].empty();
|
2020-03-22 13:46:54 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs >= 7 and tfs <= 9 and find("/", scratchpad) != -1) {
|
|
|
|
var thracc = split("/", scratchpad);
|
|
|
|
var thrred = size(thracc[0]);
|
|
|
|
var acc = size(thracc[1]);
|
2020-03-30 01:27:18 +00:00
|
|
|
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
2021-04-22 21:44:17 +00:00
|
|
|
setprop("/fdm/jsbsim/fadec/clbreduc-ft", thracc[0]);
|
2020-05-02 00:26:05 +00:00
|
|
|
setprop("/FMGC/internal/accel-agl-ft", thracc[1]);
|
2020-03-22 13:46:54 +00:00
|
|
|
setprop("MCDUC/thracc-set", 1);
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_scratchpad.scratchpads[i].empty();
|
2020-03-22 13:46:54 +00:00
|
|
|
} else {
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_message(i, "NOT ALLOWED");
|
2020-03-22 13:46:54 +00:00
|
|
|
}
|
|
|
|
} else {
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_message(i, "NOT ALLOWED");
|
2020-03-22 13:46:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L6") {
|
2020-03-30 03:39:31 +00:00
|
|
|
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
|
2020-03-22 13:46:54 +00:00
|
|
|
} else if (key == "R5") {
|
|
|
|
if (scratchpad == "CLR") {
|
2020-05-02 00:26:05 +00:00
|
|
|
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
2020-03-22 13:46:54 +00:00
|
|
|
setprop("MCDUC/reducacc-set", 0);
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_scratchpad.scratchpads[i].empty();
|
2020-03-22 13:46:54 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
2020-03-30 01:27:18 +00:00
|
|
|
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
|
2020-05-02 00:26:05 +00:00
|
|
|
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
2020-03-22 13:46:54 +00:00
|
|
|
setprop("MCDUC/reducacc-set", 1);
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_scratchpad.scratchpads[i].empty();
|
2020-03-22 13:46:54 +00:00
|
|
|
} else {
|
2020-05-23 11:16:20 +00:00
|
|
|
mcdu_message(i, "NOT ALLOWED");
|
2020-03-22 13:46:54 +00:00
|
|
|
}
|
|
|
|
}
|
2020-03-22 13:03:02 +00:00
|
|
|
}
|
|
|
|
}
|