2020-03-24 00:14:12 +00:00
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
2019-10-14 16:48:35 +00:00
2020-04-18 05:36:46 +00:00
# Copyright (c) 2020 Josh Davidson (Octal450)
2020-03-24 00:14:12 +00:00
# Copyright (c) 2020 Matthew Maring (hayden2000)
2019-10-14 16:48:35 +00:00
var MCDU_init = func(i) {
MCDU_reset(i); # Reset MCDU, clears data
}
var MCDU_reset = func(i) {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/active", 0);
2020-03-30 01:27:18 +00:00
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
setprop("MCDU[" ~ i ~ "]/last-page", "NONE");
setprop("MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
2020-04-17 22:12:55 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-color", "wht");
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2020-03-30 01:27:18 +00:00
2020-04-02 18:01:13 +00:00
setprop("FMGC/keyboard-left", 0);
setprop("FMGC/keyboard-right", 0);
2020-03-30 01:27:18 +00:00
#ACCONFIG
setprop("FMGC/internal/navdatabase", "01JAN-28JAN");
setprop("FMGC/internal/navdatabase2", "29JAN-26FEB");
setprop("FMGC/internal/navdatabasecode", "AB20170101");
setprop("FMGC/internal/navdatabasecode2", "AB20170102");
setprop("FMGC/print/mcdu/page1/L1auto", 0);
setprop("FMGC/print/mcdu/page1/L2auto", 0);
setprop("FMGC/print/mcdu/page1/L3auto", 0);
setprop("FMGC/print/mcdu/page1/R1req", 0);
setprop("FMGC/print/mcdu/page1/R2req", 0);
setprop("FMGC/print/mcdu/page1/R3req", 0);
setprop("FMGC/print/mcdu/page2/L1auto", 0);
setprop("FMGC/print/mcdu/page2/L2auto", 0);
setprop("FMGC/print/mcdu/page2/L3auto", 0);
setprop("FMGC/print/mcdu/page2/L4auto", 0);
setprop("FMGC/print/mcdu/page2/R1req", 0);
setprop("FMGC/print/mcdu/page2/R2req", 0);
setprop("FMGC/print/mcdu/page2/R3req", 0);
setprop("FMGC/print/mcdu/page2/R4req", 0);
#RADNAV
setprop("FMGC/internal/ils1freq-set", 0);
setprop("FMGC/internal/ils1crs-set", 0);
2020-04-17 22:12:55 +00:00
setprop("FMGC/internal/ils1freq-calculated", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/vor1freq-set", 0);
setprop("FMGC/internal/vor1crs-set", 0);
setprop("FMGC/internal/vor2freq-set", 0);
setprop("FMGC/internal/vor2crs-set", 0);
setprop("FMGC/internal/adf1freq-set", 0);
setprop("FMGC/internal/adf2freq-set", 0);
# INT-A
2020-02-07 16:10:54 +00:00
setprop("MCDUC/flight-num", "");
setprop("MCDUC/flight-num-set", 0);
setprop("FMGC/internal/dep-arpt", "");
setprop("FMGC/internal/arr-arpt", "");
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/tofrom-set", 0);
setprop("FMGC/internal/alt-airport", "");
2020-04-14 20:31:32 +00:00
setprop("FMGC/internal/alt-set", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/cost-index", "0");
setprop("FMGC/internal/cost-index-set", 0);
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/cruise-ft", 10000);
setprop("FMGC/internal/cruise-fl", 100);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/cruise-lvl-set", 0);
setprop("FMGC/internal/tropo", 36090);
setprop("FMGC/internal/tropo-set", 0);
2020-04-14 20:31:32 +00:00
setprop("FMGC/internal/cruise-temp", 15);
setprop("FMGC/internal/cruise-temp-set", 0);
2020-03-23 03:02:25 +00:00
2020-03-30 01:27:18 +00:00
# IRSINIT
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/align-set", 0);
2020-04-16 19:27:10 +00:00
setprop("FMGC/internal/align-ref-lat-degrees", 0);
setprop("FMGC/internal/align-ref-lat-minutes", 0);
setprop("FMGC/internal/align-ref-lat-sign", "");
setprop("FMGC/internal/align-ref-long-degrees", 0);
setprop("FMGC/internal/align-ref-long-minutes", 0);
setprop("FMGC/internal/align-ref-long-sign", "");
setprop("FMGC/internal/align-ref-lat-edit", 0);
setprop("FMGC/internal/align-ref-long-edit", 0);
setprop("FMGC/internal/align1-done", 0);
setprop("FMGC/internal/align2-done", 0);
setprop("FMGC/internal/align3-done", 0);
2020-03-25 14:54:39 +00:00
2020-03-30 01:27:18 +00:00
# ROUTE SELECTION
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/alt-selected", 0);
2020-03-25 14:54:39 +00:00
2020-03-23 03:02:25 +00:00
# INT-B
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/zfw", 0);
2020-03-23 03:02:25 +00:00
setprop("FMGC/internal/zfw-set", 0);
setprop("FMGC/internal/zfwcg", 55.1);
setprop("FMGC/internal/zfwcg-set", 0);
2020-04-11 11:01:37 +00:00
setprop("FMGC/internal/block", 0.0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/block-set", 0);
2020-03-23 03:02:25 +00:00
setprop("FMGC/internal/taxi-fuel", 0.4);
setprop("FMGC/internal/trip-fuel", 0);
setprop("FMGC/internal/trip-time", "0000");
setprop("FMGC/internal/rte-rsv", 0);
setprop("FMGC/internal/rte-percent", 5.0);
setprop("FMGC/internal/alt-fuel", 0);
setprop("FMGC/internal/alt-time", "0000");
setprop("FMGC/internal/final-fuel", 0);
2020-04-14 22:12:38 +00:00
setprop("FMGC/internal/final-time", "0030");
2020-03-23 03:02:25 +00:00
setprop("FMGC/internal/min-dest-fob", 0);
setprop("FMGC/internal/tow", 0);
setprop("FMGC/internal/lw", 0);
setprop("FMGC/internal/trip-wind", "HD000");
2020-04-14 22:12:38 +00:00
setprop("FMGC/internal/fffq-sensor", "FF+FQ");
2020-03-23 03:02:25 +00:00
setprop("FMGC/internal/extra-fuel", 0);
setprop("FMGC/internal/extra-time", "0000");
2020-03-30 01:27:18 +00:00
# FUELPRED
2020-03-24 12:33:40 +00:00
setprop("FMGC/internal/alt-airport", "");
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/pri-utc", "0000");
setprop("FMGC/internal/alt-utc", "0000");
setprop("FMGC/internal/pri-efob", 0);
setprop("FMGC/internal/alt-efob", 0);
setprop("FMGC/internal/fob", 0);
setprop("FMGC/internal/gw", 0);
setprop("FMGC/internal/cg", 0);
2020-03-30 21:11:32 +00:00
# PROG
setprop("FMGC/internal/cruise-fl-prog", 100);
2020-03-30 01:27:18 +00:00
# PERF
2020-03-28 20:40:02 +00:00
#PERF TO
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/v1", 0);
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/v1-set", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/vr", 0);
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/vr-set", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/v2", 0);
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/v2-set", 0);
2020-03-30 01:27:18 +00:00
2020-04-16 11:13:34 +00:00
setprop("FMGC/internal/accel-agl-ft", "1500"); #eventually set to 1500 above runway
2020-03-30 01:27:18 +00:00
setprop("MCDUC/thracc-set", 0);
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/to-flap", 0);
setprop("FMGC/internal/to-ths", "0.0");
setprop("FMGC/internal/flap-ths-set", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/flex", 0);
2020-02-07 16:10:54 +00:00
setprop("FMGC/internal/flex-set", 0);
2020-03-30 01:27:18 +00:00
setprop("FMGC/internal/eng-out-reduc", "1500");
setprop("MCDUC/reducacc-set", 0);
setprop("FMGC/internal/trans-alt", 18000);
2020-03-24 00:14:12 +00:00
2020-03-30 01:27:18 +00:00
# CLB PERF
2020-04-10 12:31:35 +00:00
setprop("FMGC/internal/activate-once", 0);
setprop("FMGC/internal/activate-twice", 0);
2020-03-30 01:27:18 +00:00
# CRZ PERF
# DES PERF
# APPR PERF
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/dest-qnh", -1);
setprop("FMGC/internal/dest-temp", -999);
setprop("FMGC/internal/dest-mag", -1);
setprop("FMGC/internal/dest-wind", -1);
setprop("FMGC/internal/vapp-speed-set", 0);
setprop("FMGC/internal/final", "");
2020-04-18 13:59:05 +00:00
setprop("FMGC/internal/baro", -1);
setprop("FMGC/internal/radio", -1);
setprop("FMGC/internal/radio-no", 0);
setprop("FMGC/internal/ldg-elev", 0);
2020-03-28 20:40:02 +00:00
setprop("FMGC/internal/ldg-config-3-set", 0);
setprop("FMGC/internal/ldg-config-f-set", 1);
2020-03-24 00:14:12 +00:00
2020-03-30 01:27:18 +00:00
# GA PERF
2019-10-14 16:48:35 +00:00
}
2020-03-26 00:27:43 +00:00
var setMode = func(will) {
2020-03-28 20:40:02 +00:00
setprop("MCDU/keyboard-entry", will);
if (will == 0) {
gui.popupTip("MCDU keyboard entry disabled");
} else {
gui.popupTip("MCDU keyboard entry enabled");
}
2020-03-26 00:27:43 +00:00
}
2019-10-14 16:48:35 +00:00
var lskbutton = func(btn, i) {
if (btn == "1") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "MCDU") {
if (getprop("MCDU[" ~ i ~ "]/active") != 2) {
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "WAIT FOR SYSTEM RESPONSE");
setprop("MCDU[" ~ i ~ "]/active", 1);
2019-10-14 16:48:35 +00:00
settimer(func(){
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-fmgc-page"));
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
setprop("MCDU[" ~ i ~ "]/active", 2);
2019-10-14 16:48:35 +00:00
}, 2);
} else {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-fmgc-page"));
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
}
2020-04-16 19:27:10 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("L1",i);
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L1",i);
2020-03-30 21:11:32 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PROGTO") {
progTOInput("L1",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PROGCLB") {
progCLBInput("L1",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PROGCRZ") {
progCRZInput("L1",i);
2020-04-10 18:38:58 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PROGDES") {
progDESInput("L1",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L1",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("L1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L1",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
2020-04-07 16:15:56 +00:00
if (canvas_mcdu.myLatRev[i].type == 0) {
2020-04-07 16:08:26 +00:00
if (canvas_mcdu.myDeparture[i] != nil) {
canvas_mcdu.myDeparture[i].del();
}
canvas_mcdu.myDeparture[i] = nil;
canvas_mcdu.myDeparture[i] = departurePage.new(canvas_mcdu.myLatRev[i].title[2], i);
setprop("MCDU[" ~ i ~ "]/page", "DEPARTURE");
} else {
notAllowed(i);
}
2020-04-12 22:44:02 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(1);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-03-31 15:33:28 +00:00
canvas_mcdu.myDirTo[i].fieldL1(getprop("MCDU[" ~ i ~ "]/scratchpad"));
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(1);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "2") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2020-03-24 12:33:40 +00:00
initInputA("L2",i);
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2020-03-25 14:54:39 +00:00
perfCLBInput("L2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2020-03-25 14:54:39 +00:00
perfCRZInput("L2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFDES") {
2020-03-25 14:54:39 +00:00
perfDESInput("L2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("L2",i);
2020-02-25 09:13:24 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L2",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonLeft(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonLeft(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(2);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "3") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L3",i);
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L3",i);
2020-03-23 13:48:01 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L3",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L3",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "STATUS") {
2019-10-14 16:48:35 +00:00
statusInput("L3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L3",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonLeft(3);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonLeft(3);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(3);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(3);
2020-04-08 21:49:27 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
if (canvas_mcdu.myLatRev[i].type != 0 and canvas_mcdu.myLatRev[i].type != 1) {
if (canvas_mcdu.myHold[i] != nil) {
canvas_mcdu.myHold[i].del();
}
canvas_mcdu.myHold[i] = nil;
canvas_mcdu.myHold[i] = holdPage.new(i, canvas_mcdu.myLatRev[i].id);
setprop("MCDU[" ~ i ~ "]/page", "HOLD");
} else {
notAllowed(i);
}
2020-04-07 15:59:43 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(3);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "4") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
setprop("MCDU[" ~ i ~ "]/page", "STATUS");
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L4",i);
2020-03-23 13:48:01 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L4",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L4",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L4",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L4",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L4",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonLeft(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonLeft(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(4);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "5") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L5",i);
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L5",i);
2020-03-23 13:48:01 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFDES") {
2019-10-14 16:48:35 +00:00
perfDESInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("L5",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L5",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L5",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L5",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonLeft(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].depPushbuttonLeft(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(5);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "6") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L6",i);
2020-03-25 14:54:39 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("L6",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ROUTESELECTION") {
initInputROUTESEL("L6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("L6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("L6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFDES") {
2019-10-14 16:48:35 +00:00
perfDESInput("L6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("L6",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L6",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonLeft(6);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV" or getprop("MCDU[" ~ i ~ "]/page") == "VERTREV" or getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL" or getprop("MCDU[" ~ i ~ "]/page") == "HOLD") {
if (fmgc.flightPlanController.temporaryFlag[i]) {
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
} else {
setprop("MCDU[" ~ i ~ "]/page", "LATREV");
}
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
canvas_mcdu.myDirTo[i].fieldL6();
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
}
}
var lskbutton_b = func(btn, i) {
# Special Middle Click Functions
}
var rskbutton = func(btn, i) {
if (btn == "1") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R1",i);
2020-04-16 19:27:10 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("R1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
2019-10-14 16:48:35 +00:00
initInputB("R1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R1",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R1",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
2020-04-07 16:15:56 +00:00
if (canvas_mcdu.myLatRev[i].type == 1) {
2020-04-07 16:08:26 +00:00
if (canvas_mcdu.myArrival[i] != nil) {
canvas_mcdu.myArrival[i].del();
}
canvas_mcdu.myArrival[i] = nil;
canvas_mcdu.myArrival[i] = arrivalPage.new(canvas_mcdu.myLatRev[i].title[2], i);
setprop("MCDU[" ~ i ~ "]/page", "ARRIVAL");
} else {
notAllowed(i);
}
2020-04-12 22:44:02 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(1);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "2") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
2019-10-14 16:48:35 +00:00
initInputB("R2",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R2",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R2",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonRight(2);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(2);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "3") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R3",i);
2020-03-23 14:59:05 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("R3",i);
2020-03-23 13:48:01 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("R3",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R3",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R3",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R3",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(3);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonRight(3);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
if (canvas_mcdu.myLatRev[i].type != 2) {
canvas_mcdu.myLatRev[i].nextWpt();
} else {
notAllowed(i);
}
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(3);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "4") {
2020-04-14 22:12:38 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("R4",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R4",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R4",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R4",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R4",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonRight(4);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(4);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "5") {
2020-04-20 02:08:42 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("R5",i);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("R5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-03-24 00:14:12 +00:00
perfAPPRInput("R5",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("R5",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R5",i);
2020-02-07 16:10:54 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("R5",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonRight(5);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonRight(5);
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
} else if (btn == "6") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "MCDU") {
if (getprop("MCDU[" ~ i ~ "]/last-page") != "NONE") {
setprop("MCDU[" ~ i ~ "]/page", getprop("MCDU[" ~ i ~ "]/last-page"));
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else {
notAllowed(i);
}
2020-04-20 02:08:42 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("R6",i);
2020-03-25 14:54:39 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("R6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("R6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("R6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFDES") {
2020-02-24 20:54:10 +00:00
perfDESInput("R6",i);
2020-03-30 03:39:31 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-03-22 13:03:02 +00:00
perfAPPRInput("R6",i);
2020-02-07 16:10:54 +00:00
} else if ((getprop("MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) {
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "AOC DISABLED") {
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
2019-10-14 16:48:35 +00:00
} else {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
2019-10-14 16:48:35 +00:00
}
}
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "AOC DISABLED");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R6",i);
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myFpln[i].pushButtonRight(6);
} else if (getprop("MCDU[" ~ i ~ "]/page") == "VERTREV") {
setprop("MCDU/[" ~ i ~ "]/page", "F-PLNA");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
canvas_mcdu.myDirTo[i].fieldR6();
} else {
2019-10-14 16:48:35 +00:00
notAllowed(i);
}
}
}
var rskbutton_b = func(btn, i) {
# Special Middle Click Functions
}
var arrowbutton = func(btn, i) {
if (btn == "left") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2020-02-07 16:10:54 +00:00
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
setprop("MCDU[" ~ i ~ "]/page", "INITB");
2020-03-23 03:02:25 +00:00
} else {
2020-03-28 20:40:02 +00:00
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
2019-10-14 16:48:35 +00:00
}
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "INITA");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollLeft();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].scrollLeft();
}
2019-10-14 16:48:35 +00:00
} else if (btn == "right") {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
2020-02-07 16:10:54 +00:00
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
setprop("MCDU[" ~ i ~ "]/page", "INITB");
2020-03-23 03:02:25 +00:00
} else {
2020-03-28 20:40:02 +00:00
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
2019-10-14 16:48:35 +00:00
}
2020-03-23 03:02:25 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "INITA");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
2020-04-12 22:08:16 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollRight();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].scrollRight();
}
2019-10-14 16:48:35 +00:00
} else if (btn == "up") {
2020-04-12 22:44:02 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].scrollUp();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].scrollUp();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].scrollUp();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
canvas_mcdu.myDirTo[i].scrollUp();
2020-04-16 19:27:10 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("up",i);
2020-04-12 22:44:02 +00:00
}
} else if (btn == "down") {
if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].scrollDn();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
canvas_mcdu.myDeparture[i].scrollDn();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].scrollDn();
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
canvas_mcdu.myDirTo[i].scrollDn();
2020-04-16 19:27:10 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("down",i);
}
2020-04-12 22:44:02 +00:00
}
2019-10-14 16:48:35 +00:00
}
var pagebutton = func(btn, i) {
2020-04-17 22:12:55 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-color", "wht");
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/page") != "MCDU") {
2019-10-14 16:48:35 +00:00
if (btn == "radnav") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "RADNAV");
2020-03-30 03:39:31 +00:00
} else if (btn == "prog") {
if (getprop("FMGC/status/phase") == 0 or getprop("FMGC/status/phase") == 1) {
setprop("MCDU[" ~ i ~ "]/page", "PROGTO");
} else if (getprop("FMGC/status/phase") == 2) {
setprop("MCDU[" ~ i ~ "]/page", "PROGCLB");
} else if (getprop("FMGC/status/phase") == 3) {
setprop("MCDU[" ~ i ~ "]/page", "PROGCRZ");
} else if (getprop("FMGC/status/phase") == 4 or getprop("FMGC/status/phase") == 5 or getprop("FMGC/status/phase") == 6) {
setprop("MCDU[" ~ i ~ "]/page", "PROGDES");
}
2019-10-14 16:48:35 +00:00
} else if (btn == "perf") {
2020-02-07 16:10:54 +00:00
if (getprop("FMGC/status/phase") == 0 or getprop("FMGC/status/phase") == 1) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFTO");
2020-02-07 16:10:54 +00:00
} else if (getprop("FMGC/status/phase") == 2) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFCLB");
2020-02-07 16:10:54 +00:00
} else if (getprop("FMGC/status/phase") == 3) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFCRZ");
2020-02-07 16:10:54 +00:00
} else if (getprop("FMGC/status/phase") == 4) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFDES");
2020-02-24 20:54:10 +00:00
} else if (getprop("FMGC/status/phase") == 5) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
2020-03-22 13:03:02 +00:00
} else if (getprop("FMGC/status/phase") == 6) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFGA");
2020-04-16 12:25:06 +00:00
} else if (getprop("FMGC/status/phase") == 7) {
2020-04-18 20:35:47 +00:00
fmgc.reset_FMGC();
2019-10-14 16:48:35 +00:00
}
} else if (btn == "init") {
2020-04-16 12:25:06 +00:00
if (getprop("FMGC/status/phase") == 7) {
2020-04-18 20:35:47 +00:00
fmgc.reset_FMGC();
2020-04-16 12:25:06 +00:00
}
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "INITA");
2019-10-14 16:48:35 +00:00
} else if (btn == "data") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", "DATA");
2019-10-14 16:48:35 +00:00
} else if (btn == "mcdu") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/last-page", getprop("MCDU[" ~ i ~ "]/page"));
setprop("MCDU[" ~ i ~ "]/last-fmgc-page", getprop("MCDU[" ~ i ~ "]/page"));
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
2019-10-14 16:48:35 +00:00
} else if (btn == "f-pln") {
2020-04-12 22:44:02 +00:00
if (fmgc.flightPlanController.active.getBoolValue()) {
if (canvas_mcdu.myFpln[i] == nil) {
canvas_mcdu.myFpln[i] = fplnPage.new(2, i);
}
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
} else {
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
}
} else if (btn == "fuel-pred") {
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
} else if (btn == "dirto") {
2020-03-28 15:53:50 +00:00
if (fmgc.flightPlanController.active.getBoolValue()) {
if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "INSRT / ERASE TMPY FIRST");
return;
} elsif (canvas_mcdu.myDirTo[i] == nil) {
canvas_mcdu.myDirTo[i] = dirTo.new(i);
}
setprop("MCDU[" ~ i ~ "]/page", "DIRTO");
} else {
2020-04-12 22:44:02 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
}
}
2019-10-14 16:48:35 +00:00
}
}
var button = func(btn, i) {
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 0 and getprop("MCDU[" ~ i ~ "]/page") != "MCDU") {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
2019-10-14 16:48:35 +00:00
if (btn == "A") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "A");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "B") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "B");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "C") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "C");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "D") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "D");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "E") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "E");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "F") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "F");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "G") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "G");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "H") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "H");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "I") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "I");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "J") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "J");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "K") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "K");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "L") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "L");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "M") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "M");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "N") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "N");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "O") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "O");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "P") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "P");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "Q") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Q");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "R") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "R");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "S") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "S");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "T") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "T");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "U") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "U");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "V") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "V");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "W") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "W");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "X") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "X");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "Y") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Y");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "Z") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "Z");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "SLASH") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "/");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "SP") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ " ");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "CLR") {
2020-02-07 16:10:54 +00:00
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
2019-10-14 16:48:35 +00:00
if (size(scratchpad) == 0) {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "CLR");
} else if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (size(scratchpad) > 0) {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad", left(scratchpad, size(scratchpad) - 1));
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
}
} else if (btn == "0") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "0");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "1") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "1");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "2") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "2");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "3") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "3");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "4") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "4");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "5") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "5");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "6") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "6");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "7") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "7");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "8") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "8");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "9") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "9");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "DOT") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ ".");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
} else if (btn == "PLUSMINUS") {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad", scratchpad ~ "-");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
}
} else {
if (btn == "CLR") {
2020-04-17 22:12:55 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-color", "wht");
2020-02-07 16:10:54 +00:00
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
2019-10-14 16:48:35 +00:00
if (size(scratchpad) == 0) {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "CLR");
} else if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/scratchpad", getprop("MCDU[" ~ i ~ "]/last-scratchpad"));
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
2019-10-14 16:48:35 +00:00
}
}
}
}
2020-04-17 22:12:55 +00:00
var genericMessage = func(i, text, color) {
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != text) {
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
} else {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
}
}
setprop("MCDU[" ~ i ~ "]/scratchpad-color", color);
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", text);
}
2019-10-14 16:48:35 +00:00
var notAllowed = func(i) {
2020-04-17 22:12:55 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-color", "wht");
2020-02-07 16:10:54 +00:00
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "NOT ALLOWED") {
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
2019-10-14 16:48:35 +00:00
} else {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
2019-10-14 16:48:35 +00:00
}
}
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
2019-12-29 21:37:52 +00:00
var formatError = func(i) {
2020-04-17 22:12:55 +00:00
setprop("MCDU[" ~ i ~ "]/scratchpad-color", "wht");
2020-04-12 22:44:02 +00:00
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "FORMAT ERROR") {
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
} else {
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
}
}
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "FORMAT ERROR");
2019-12-29 21:37:52 +00:00
}
2019-10-14 16:48:35 +00:00
var screenFlash = func(time, i) {
2020-02-07 16:10:54 +00:00
var page = getprop("MCDU[" ~ i ~ "]/page");
setprop("MCDU[" ~ i ~ "]/page", "NONE");
2019-10-14 16:48:35 +00:00
settimer(func {
2020-02-07 16:10:54 +00:00
setprop("MCDU[" ~ i ~ "]/page", page);
2019-10-14 16:48:35 +00:00
}, time);
2020-04-12 22:08:16 +00:00
}