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

49 lines
1.6 KiB
Text
Raw Normal View History

2020-04-30 19:26:36 +00:00
# Copyright (c) 2020 Matthew Maring (mattmaring)
2020-03-22 13:46:54 +00:00
# uses universal values, will implement separately once FPLN is finished
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") {
2020-10-04 14:23:37 +00:00
setprop("/systems/thrust/clbreduc-ft", 1500);
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]);
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
2020-10-04 14:23:37 +00:00
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
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") {
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
2020-03-22 13:46:54 +00:00
} else if (key == "R5") {
if (scratchpad == "CLR") {
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);
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
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
}
}
}
}