2017-05-13 14:45:26 +00:00
|
|
|
##################################################################
|
2017-05-21 17:20:14 +00:00
|
|
|
# A3XX mCDU by Joshua Davidson (it0uchpods) and Jonathan Redpath #
|
2017-05-13 14:45:26 +00:00
|
|
|
##################################################################
|
|
|
|
|
|
|
|
var MCDU_init = func {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/brightness", "1.0");
|
2017-05-13 14:45:26 +00:00
|
|
|
MCDU_reset(); # Reset MCDU, clears data
|
|
|
|
}
|
|
|
|
|
|
|
|
var MCDU_reset = func {
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/it-autoflight/settings/togaspd", 157);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/last-fmgc-page", "STATUS");
|
2017-06-04 20:05:27 +00:00
|
|
|
setprop("/MCDU[1]/page", "MCDU");
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-21 17:20:14 +00:00
|
|
|
setprop("/MCDUC/flight-num", "");
|
2017-05-26 04:58:04 +00:00
|
|
|
setprop("/MCDUC/thracc-set", 0);
|
2017-05-27 04:15:06 +00:00
|
|
|
setprop("/MCDUC/reducacc-set", 0);
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/MCDUC/flight-num-set", 0);
|
|
|
|
setprop("/FMGC/internal/flex", 0);
|
2017-05-21 17:20:14 +00:00
|
|
|
setprop("/FMGC/internal/dep-arpt", "");
|
|
|
|
setprop("/FMGC/internal/arr-arpt", "");
|
|
|
|
setprop("/FMGC/internal/cruise-ft", 10000);
|
|
|
|
setprop("/FMGC/internal/cruise-fl", 100);
|
|
|
|
setprop("/FMGC/internal/cost-index", "0");
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/FMGC/internal/trans-alt", 18000);
|
2017-05-27 04:15:06 +00:00
|
|
|
setprop("/FMGC/internal/reduc-agl-ft", "3000");
|
|
|
|
setprop("/FMGC/internal/eng-out-reduc", "3500");
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/FMGC/internal/v1", 0);
|
|
|
|
setprop("/FMGC/internal/vr", 0);
|
|
|
|
setprop("/FMGC/internal/v2", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/FMGC/internal/block", 0.0);
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/FMGC/internal/v1-set", 0);
|
|
|
|
setprop("/FMGC/internal/vr-set", 0);
|
|
|
|
setprop("/FMGC/internal/v2-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/FMGC/internal/block-set", 0);
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/FMGC/internal/to-flap", 0);
|
|
|
|
setprop("/FMGC/internal/to-ths", "0.0");
|
|
|
|
setprop("/FMGC/internal/tofrom-set", 0);
|
2017-05-18 20:39:14 +00:00
|
|
|
setprop("/FMGC/internal/cost-index-set", 0);
|
2017-05-18 18:41:33 +00:00
|
|
|
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
2017-05-26 17:50:53 +00:00
|
|
|
setprop("/FMGC/internal/flap-ths-set", 0);
|
|
|
|
setprop("/FMGC/internal/flex-set", 0);
|
2017-05-13 17:08:49 +00:00
|
|
|
}
|
|
|
|
|
2017-05-18 18:41:33 +00:00
|
|
|
var lskbutton = func(btn) {
|
2017-05-26 17:50:53 +00:00
|
|
|
if (btn == "1") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "MCDU") {
|
|
|
|
setprop("/MCDU[1]/page", getprop("/MCDU[1]/last-fmgc-page"));
|
2017-06-04 20:05:27 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "GPS PRIMARY");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("L1");
|
|
|
|
}
|
|
|
|
} else if (btn == "2") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-19 13:36:39 +00:00
|
|
|
PerfInput("L2");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("L2");
|
2017-05-19 13:36:39 +00:00
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (btn == "3") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-21 17:20:14 +00:00
|
|
|
initInputA("L3");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("L3");
|
2017-05-21 17:20:14 +00:00
|
|
|
}
|
2017-05-19 13:36:39 +00:00
|
|
|
} else if (btn == "4") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "DATA") {
|
|
|
|
setprop("/MCDU[1]/page", "STATUS");
|
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("L4");
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
2017-05-18 20:39:14 +00:00
|
|
|
} else if (btn == "5") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-18 20:39:14 +00:00
|
|
|
initInputA("L5");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 04:58:04 +00:00
|
|
|
PerfTOInput("L5");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "CLB") {
|
2017-05-19 19:20:54 +00:00
|
|
|
perfCLBInput("L5");
|
2017-05-18 20:39:14 +00:00
|
|
|
}
|
2017-05-18 18:41:33 +00:00
|
|
|
} else if (btn == "6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-18 18:41:33 +00:00
|
|
|
initInputA("L6");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "CLB") {
|
2017-05-19 19:20:54 +00:00
|
|
|
perfCLBInput("L6");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "CRZ") {
|
2017-05-19 19:20:54 +00:00
|
|
|
perfCRZInput("L6");
|
2017-05-18 18:41:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-29 17:23:26 +00:00
|
|
|
var lskbutton_b = func(btn) {
|
|
|
|
# Special Middle Click Functions
|
|
|
|
}
|
|
|
|
|
2017-05-21 17:20:14 +00:00
|
|
|
var rskbutton = func(btn) {
|
|
|
|
if (btn == "1") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-21 17:20:14 +00:00
|
|
|
initInputA("R1");
|
|
|
|
}
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (btn == "2") {
|
|
|
|
if (getprop("/MCDU[1]/page") == "INITB") {
|
|
|
|
initInputB("R2");
|
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (btn == "3") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
2017-05-21 17:20:14 +00:00
|
|
|
initInputA("R3");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("R3");
|
|
|
|
}
|
|
|
|
} else if (btn == "4") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-26 17:50:53 +00:00
|
|
|
PerfTOInput("R4");
|
2017-05-21 17:20:14 +00:00
|
|
|
}
|
2017-05-27 04:15:06 +00:00
|
|
|
} else if (btn == "5") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-27 04:15:06 +00:00
|
|
|
PerfTOInput("R5");
|
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (btn == "6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "TO") {
|
2017-05-21 17:20:14 +00:00
|
|
|
PerfTOInput("R6");
|
2017-05-27 05:11:14 +00:00
|
|
|
} else if (getprop("/MCDU[1]/page") == "CLB") {
|
2017-05-21 17:20:14 +00:00
|
|
|
perfCLBInput("R6");
|
2017-05-27 05:11:14 +00:00
|
|
|
} # else if (getprop("/MCDU[1]/page") == "CRZ") {
|
2017-05-21 17:20:14 +00:00
|
|
|
# perfCRZInput("R6");
|
|
|
|
#}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-29 17:23:26 +00:00
|
|
|
var rskbutton_b = func(btn) {
|
|
|
|
# Special Middle Click Functions
|
|
|
|
}
|
|
|
|
|
2017-05-18 18:41:33 +00:00
|
|
|
var initInputA = func(key) {
|
2017-05-27 05:11:14 +00:00
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
2017-05-21 17:20:14 +00:00
|
|
|
if (key == "L3") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/MCDUC/flight-num", "");
|
|
|
|
setprop("/MCDUC/flight-num-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else {
|
|
|
|
var flts = size(scratchpad);
|
|
|
|
if (flts >= 1 and flts <= 8) {
|
|
|
|
setprop("/MCDUC/flight-num", scratchpad);
|
|
|
|
setprop("/MCDUC/flight-num-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-21 17:20:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L5") {
|
2017-05-18 20:39:14 +00:00
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/cost-index", 0);
|
|
|
|
setprop("/FMGC/internal/cost-index-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-18 20:39:14 +00:00
|
|
|
} else {
|
|
|
|
var ci = int(scratchpad);
|
|
|
|
var cis = size(scratchpad);
|
|
|
|
if (cis >= 1 and cis <= 3) {
|
2017-05-21 17:20:14 +00:00
|
|
|
if (ci == nil) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (ci >= 0 and ci <= 120) {
|
2017-05-18 20:39:14 +00:00
|
|
|
setprop("/FMGC/internal/cost-index", ci);
|
|
|
|
setprop("/FMGC/internal/cost-index-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-18 20:39:14 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-18 20:39:14 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-18 20:39:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L6") {
|
2017-05-18 18:41:33 +00:00
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/cruise-ft", 10000);
|
|
|
|
setprop("/FMGC/internal/cruise-fl", 100);
|
|
|
|
setprop("/FMGC/internal/cruise-lvl-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-18 18:41:33 +00:00
|
|
|
} else {
|
|
|
|
var crz = int(scratchpad);
|
|
|
|
var crzs = size(scratchpad);
|
|
|
|
if (crzs >= 1 and crzs <= 3) {
|
2017-05-21 17:20:14 +00:00
|
|
|
if (crz == nil) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (crz > 0 and crz <= 430) {
|
2017-05-18 20:04:05 +00:00
|
|
|
setprop("/FMGC/internal/cruise-ft", crz * 100);
|
|
|
|
setprop("/FMGC/internal/cruise-fl", crz);
|
|
|
|
setprop("/FMGC/internal/cruise-lvl-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-18 20:04:05 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-18 20:04:05 +00:00
|
|
|
}
|
2017-05-18 18:41:33 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-18 18:41:33 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (key == "R1") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/dep-arpt", "");
|
|
|
|
setprop("/FMGC/internal/arr-arpt", "");
|
|
|
|
setprop("/FMGC/internal/tofrom-set", 0);
|
|
|
|
fmgc.updateARPT();
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 9) {
|
|
|
|
var fromto = split("/", scratchpad);
|
2017-05-26 04:58:04 +00:00
|
|
|
var froms = size(fromto[0]);
|
|
|
|
var tos = size(fromto[1]);
|
|
|
|
if (froms == 4 and tos == 4) {
|
|
|
|
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
|
|
|
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
|
|
|
setprop("/FMGC/internal/tofrom-set", 1);
|
2017-06-05 14:19:40 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 04:58:04 +00:00
|
|
|
fmgc.updateARPT();
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 04:58:04 +00:00
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-21 17:20:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "R3") {
|
|
|
|
if (getprop("/controls/adirs/mcducbtn") == 0) {
|
|
|
|
setprop("/controls/adirs/mcducbtn", 1);
|
|
|
|
}
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-27 05:11:14 +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", "");
|
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
2017-06-05 17:28:38 +00:00
|
|
|
if (tfs == 2 or tfs == 4) {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (scratchpad >= 1.0 and scratchpad <= 45.0) {
|
|
|
|
setprop("/FMGC/internal/block", scratchpad);
|
|
|
|
setprop("/FMGC/internal/block-set", 1);
|
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
|
|
|
} else {
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-26 04:58:04 +00:00
|
|
|
var PerfTOInput = func(key) {
|
2017-05-27 05:11:14 +00:00
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
2017-05-26 17:50:53 +00:00
|
|
|
if (key == "L1") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/v1", 0);
|
|
|
|
setprop("/FMGC/internal/v1-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 3) {
|
|
|
|
if (scratchpad >= 100 and scratchpad <= 200) {
|
|
|
|
setprop("/FMGC/internal/v1", scratchpad);
|
|
|
|
setprop("/FMGC/internal/v1-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L2") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/vr", 0);
|
|
|
|
setprop("/FMGC/internal/vr-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 3) {
|
|
|
|
if (scratchpad >= 100 and scratchpad <= 200) {
|
|
|
|
setprop("/FMGC/internal/vr", scratchpad);
|
|
|
|
setprop("/FMGC/internal/vr-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L3") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/v2", 0);
|
|
|
|
setprop("/FMGC/internal/v2-set", 0);
|
|
|
|
setprop("/it-autoflight/settings/togaspd", 157);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 3) {
|
|
|
|
if (scratchpad >= 100 and scratchpad <= 200) {
|
|
|
|
setprop("/FMGC/internal/v2", scratchpad);
|
|
|
|
setprop("/FMGC/internal/v2-set", 1);
|
2017-06-03 21:33:07 +00:00
|
|
|
setprop("/it-autoflight/settings/togaspd", scratchpad + 10);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L4") {
|
|
|
|
if (scratchpad == "CLR") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 4 or tfs == 5) {
|
|
|
|
if (scratchpad >= 1000 and scratchpad <= 18000) {
|
|
|
|
setprop("/FMGC/internal/trans-alt", scratchpad);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L5") {
|
2017-05-26 04:58:04 +00:00
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/systems/thrust/clbreduc-ft", "1500");
|
2017-05-27 04:15:06 +00:00
|
|
|
setprop("/FMGC/internal/reduc-agl-ft", "3000");
|
2017-05-26 04:58:04 +00:00
|
|
|
setprop("/MCDUC/thracc-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 04:58:04 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 9) {
|
|
|
|
var thracc = split("/", scratchpad);
|
|
|
|
var thrred = size(thracc[0]);
|
|
|
|
var acc = size(thracc[1]);
|
2017-05-26 17:50:53 +00:00
|
|
|
if ((thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
2017-05-26 04:58:04 +00:00
|
|
|
setprop("/systems/thrust/clbreduc-ft", thracc[0]);
|
2017-05-27 04:15:06 +00:00
|
|
|
setprop("/FMGC/internal/reduc-agl-ft", thracc[1]);
|
2017-05-26 04:58:04 +00:00
|
|
|
setprop("/MCDUC/thracc-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 04:58:04 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 04:58:04 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 04:58:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "R6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "CLB");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else if (key == "R3") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/to-flap", 0);
|
|
|
|
setprop("/FMGC/internal/to-ths", "0.0");
|
|
|
|
setprop("/FMGC/internal/flap-ths-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 7) {
|
|
|
|
var flapths = split("/UP", scratchpad);
|
|
|
|
if ((flapths[0] >= 1 and flapths[0] <= 4) and (flapths[1] >= 0.0 and flapths[1] <= 2.5)) {
|
|
|
|
setprop("/FMGC/internal/to-flap", flapths[0]);
|
|
|
|
setprop("/FMGC/internal/to-ths", flapths[1]);
|
|
|
|
setprop("/FMGC/internal/flap-ths-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "R4") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/flex", 0);
|
|
|
|
setprop("/FMGC/internal/flex-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs == 1 or tfs == 2) {
|
|
|
|
if (scratchpad >= 0 and scratchpad <= 70) {
|
|
|
|
setprop("/FMGC/internal/flex", scratchpad);
|
|
|
|
setprop("/FMGC/internal/flex-set", 1);
|
2017-05-27 00:37:11 +00:00
|
|
|
var flex_calc = getprop("/FMGC/internal/flex") - getprop("/environment/temperature-degc");
|
|
|
|
setprop("/FMGC/internal/flex-cmd", flex_calc);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-26 17:50:53 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-27 04:15:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "R5") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/eng-out-reduc", "3500");
|
|
|
|
setprop("/MCDUC/reducacc-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-27 04:15:06 +00:00
|
|
|
} else {
|
|
|
|
var tfs = size(scratchpad);
|
|
|
|
if (tfs >= 3 and tfs <= 5) {
|
|
|
|
setprop("/FMGC/internal/eng-out-reduc", scratchpad);
|
|
|
|
setprop("/MCDUC/reducacc-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-27 04:15:06 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-26 17:50:53 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-26 04:58:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-19 19:20:54 +00:00
|
|
|
var perfCLBInput = func(key) {
|
2017-05-27 05:11:14 +00:00
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
2017-05-19 13:36:39 +00:00
|
|
|
if (key == "L5") {
|
|
|
|
if (scratchpad == "CLR") {
|
|
|
|
setprop("/FMGC/internal/cost-index", 0);
|
|
|
|
setprop("/FMGC/internal/cost-index-set", 0);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-19 13:36:39 +00:00
|
|
|
} else {
|
|
|
|
var ci = int(scratchpad);
|
|
|
|
var cis = size(scratchpad);
|
|
|
|
if (cis >= 1 and cis <= 3) {
|
2017-05-21 17:20:14 +00:00
|
|
|
if (ci == nil) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (ci >= 0 and ci <= 120) {
|
2017-05-19 13:36:39 +00:00
|
|
|
setprop("/FMGC/internal/cost-index", ci);
|
|
|
|
setprop("/FMGC/internal/cost-index-set", 1);
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
2017-05-19 13:36:39 +00:00
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-19 13:36:39 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "NOT ALLOWED");
|
2017-05-19 13:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (key == "L6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "TO");
|
2017-05-19 16:20:08 +00:00
|
|
|
} else if (key == "R6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "CRZ");
|
2017-05-19 13:36:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-19 19:20:54 +00:00
|
|
|
var perfCRZInput = func(key) {
|
2017-05-19 16:20:08 +00:00
|
|
|
if (key == "L6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "CLB");
|
2017-05-19 13:36:39 +00:00
|
|
|
}
|
2017-05-21 17:20:14 +00:00
|
|
|
# if (key == "R6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
# setprop("/MCDU[1]/page", "DES");
|
2017-05-21 17:20:14 +00:00
|
|
|
# }
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var arrowbutton = func(btn) {
|
|
|
|
if (btn == "left") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "DATA") {
|
|
|
|
setprop("/MCDU[1]/page", "DATA2");
|
|
|
|
} else if (getprop("/MCDU[1]/page") == "DATA2") {
|
|
|
|
setprop("/MCDU[1]/page", "DATA");
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
|
|
|
setprop("/MCDU[1]/page", "INITB");
|
|
|
|
} else if (getprop("/MCDU[1]/page") == "INITB") {
|
|
|
|
setprop("/MCDU[1]/page", "INITA");
|
2017-05-18 18:52:02 +00:00
|
|
|
}
|
2017-05-18 13:53:16 +00:00
|
|
|
} else if (btn == "right") {
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "DATA") {
|
|
|
|
setprop("/MCDU[1]/page", "DATA2");
|
|
|
|
} else if (getprop("/MCDU[1]/page") == "DATA2") {
|
|
|
|
setprop("/MCDU[1]/page", "DATA");
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
2017-05-27 05:11:14 +00:00
|
|
|
if (getprop("/MCDU[1]/page") == "INITA") {
|
|
|
|
setprop("/MCDU[1]/page", "INITB");
|
|
|
|
} else if (getprop("/MCDU[1]/page") == "INITB") {
|
|
|
|
setprop("/MCDU[1]/page", "INITA");
|
2017-05-18 18:52:02 +00:00
|
|
|
}
|
2017-05-18 13:53:16 +00:00
|
|
|
} else if (btn == "up") {
|
|
|
|
# Nothing for now
|
|
|
|
} else if (btn == "down") {
|
|
|
|
# Nothing for now
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-15 22:38:20 +00:00
|
|
|
var pagebutton = func(btn) {
|
2017-06-07 00:46:23 +00:00
|
|
|
if (btn == "radnav") {
|
|
|
|
setprop("/MCDU[1]/page", "RADNAV");
|
|
|
|
} else if (btn == "perf") {
|
2017-05-18 13:53:16 +00:00
|
|
|
if (getprop("/FMGC/status/phase") == 0 or getprop("/FMGC/status/phase") == 1) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "TO");
|
2017-05-26 16:42:19 +00:00
|
|
|
} else if (getprop("/FMGC/status/phase") == 2) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "CLB");
|
2017-05-26 16:42:19 +00:00
|
|
|
} else if (getprop("/FMGC/status/phase") == 3) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "CRZ");
|
2017-05-18 13:53:16 +00:00
|
|
|
}
|
|
|
|
} else if (btn == "init") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "INITA");
|
2017-05-18 13:53:16 +00:00
|
|
|
} else if (btn == "data") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", "DATA");
|
2017-05-26 16:42:19 +00:00
|
|
|
} else if (btn == "mcdu") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/last-fmgc-page", getprop("/MCDU[1]/page"));
|
|
|
|
setprop("/MCDU[1]/page", "MCDU");
|
2017-05-15 22:38:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-13 17:08:49 +00:00
|
|
|
var button = func(btn) {
|
2017-05-27 05:11:14 +00:00
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
2017-05-13 17:08:49 +00:00
|
|
|
if (btn == "A") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "A");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "B") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "B");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "C") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "C");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "D") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "D");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "E") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "E");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "F") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "F");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "G") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "G");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "H") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "H");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "I") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "I");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "J") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "J");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "K") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "K");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "L") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "L");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "M") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "M");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "N") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "N");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "O") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "O");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "P") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "P");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "Q") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Q");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "R") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "R");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "S") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "S");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "T") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "T");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "U") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "U");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "V") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "V");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "W") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "W");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "X") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "X");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "Y") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Y");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "Z") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "Z");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "SLASH") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "/");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "SP") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ " ");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-15 22:38:20 +00:00
|
|
|
} else if (btn == "CLR") {
|
2017-05-27 05:11:14 +00:00
|
|
|
var scratchpad = getprop("/MCDU[1]/scratchpad");
|
2017-05-18 18:41:33 +00:00
|
|
|
if (size(scratchpad) == 0) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad", "CLR");
|
|
|
|
} else if (getprop("/MCDU[1]/scratchpad-msg") == 1) {
|
|
|
|
setprop("/MCDU[1]/scratchpad", "");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-16 14:29:05 +00:00
|
|
|
} else if (size(scratchpad) > 0) {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", left(scratchpad, size(scratchpad)-1));
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-15 22:38:20 +00:00
|
|
|
}
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "0") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "0");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "1") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "1");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "2") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "2");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "3") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "3");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "4") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "4");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "5") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "5");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "6") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "6");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "7") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "7");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "8") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "8");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "9") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "9");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
} else if (btn == "DOT") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ ".");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-21 17:20:14 +00:00
|
|
|
} else if (btn == "PLUSMINUS") {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/scratchpad", scratchpad ~ "-");
|
|
|
|
setprop("/MCDU[1]/scratchpad-msg", "0");
|
2017-05-13 17:08:49 +00:00
|
|
|
}
|
2017-05-18 18:41:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var screenFlash = func(time) {
|
2017-05-27 05:11:14 +00:00
|
|
|
var page = getprop("/MCDU[1]/page");
|
|
|
|
setprop("/MCDU[1]/page", "NONE");
|
2017-05-18 18:41:33 +00:00
|
|
|
settimer(func {
|
2017-05-27 05:11:14 +00:00
|
|
|
setprop("/MCDU[1]/page", page);
|
2017-05-18 18:41:33 +00:00
|
|
|
}, time);
|
|
|
|
}
|