2017-07-14 15:57:14 +00:00
|
|
|
# A3XX mCDU by Joshua Davidson (it0uchpods) and Jonathan Redpath
|
2017-07-13 17:30:33 +00:00
|
|
|
|
2017-07-14 15:57:14 +00:00
|
|
|
#######################################
|
|
|
|
# Copyright (c) A3XX Development Team #
|
|
|
|
#######################################
|
2017-06-30 15:45:41 +00:00
|
|
|
|
|
|
|
var initInputB = func(key) {
|
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
|
|
|
if (key == "R2") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/block", 0.0);
|
|
|
|
setprop("/FMGC/internal/block-set", 0);
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
var maxblock = getprop("/options/maxblock");
|
2017-07-20 21:49:06 +00:00
|
|
|
if (tfs >= 1 and tfs <= 5) {
|
2017-06-30 15:45:41 +00:00
|
|
|
if (scratchpad >= 1.0 and scratchpad <= maxblock) {
|
|
|
|
setprop("/FMGC/internal/block", scratchpad);
|
|
|
|
setprop("/FMGC/internal/block-set", 1);
|
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
|
|
|
} else {
|
|
|
|
if (getprop("/MCDU[1]/scratchpad") != "NOT ALLOWED") {
|
|
|
|
setprop("/MCDU[1]/last-scratchpad", getprop("/MCDU[1]/scratchpad"));
|
|
|
|
}
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (getprop("/MCDU[1]/scratchpad") != "NOT ALLOWED") {
|
|
|
|
setprop("/MCDU[1]/last-scratchpad", getprop("/MCDU[1]/scratchpad"));
|
|
|
|
}
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|