2020-04-30 19:26:36 +00:00
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
2019-10-14 16:48:35 +00:00
2020-04-18 05:36:46 +00:00
# Copyright (c) 2020 Josh Davidson (Octal450)
2020-04-30 19:26:36 +00:00
# Copyright (c) 2020 Matthew Maring (mattmaring)
2019-10-14 16:48:35 +00:00
2020-05-16 14:48:26 +00:00
var scratchpadNode = [nil, nil];
2019-10-14 16:48:35 +00:00
var MCDU_init = func(i) {
2020-05-23 11:16:20 +00:00
MCDU_reset(i);
2019-10-14 16:48:35 +00:00
}
var MCDU_reset = func(i) {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/active", 0);
2020-07-22 17:35:09 +00:00
setprop("/MCDU[" ~ i ~ "]/atsu-active", 0);
2020-03-30 01:27:18 +00:00
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
2020-07-22 17:35:09 +00:00
setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK");
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
2020-03-30 01:27:18 +00:00
2020-05-02 00:26:05 +00:00
setprop("/FMGC/keyboard-left", 0);
setprop("/FMGC/keyboard-right", 0);
2020-03-30 01:27:18 +00:00
#ACCONFIG
2020-05-02 00:26:05 +00:00
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);
2020-03-30 01:27:18 +00:00
#RADNAV
2020-05-02 00:26:05 +00:00
setprop("/FMGC/internal/ils1freq-set", 0);
setprop("/FMGC/internal/ils1crs-set", 0);
setprop("/FMGC/internal/ils1freq-calculated", 0);
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);
2020-03-30 01:27:18 +00:00
# INT-A
2020-07-10 00:25:25 +00:00
fmgc.FMGCInternal.altAirport = "";
fmgc.FMGCInternal.altAirportSet = 0;
2020-07-10 19:54:13 +00:00
fmgc.FMGCInternal.arrApt = "";
fmgc.FMGCInternal.costIndex = 0;
fmgc.FMGCInternal.costIndexSet = 0;
2020-07-10 00:09:19 +00:00
fmgc.FMGCInternal.crzFt = 10000;
fmgc.altvert();
fmgc.updateRouteManagerAlt();
fmgc.FMGCInternal.crzFl = 100;
fmgc.FMGCInternal.crzSet = 0;
updateCrzLvlCallback();
fmgc.FMGCInternal.crzTemp = 15;
fmgc.FMGCInternal.crzTempSet = 0;
2020-07-10 19:54:13 +00:00
fmgc.FMGCInternal.depApt = "";
fmgc.FMGCInternal.flightNum = "";
fmgc.FMGCInternal.flightNumSet = 0;
2020-07-10 00:25:25 +00:00
fmgc.FMGCInternal.gndTemp = -99;
fmgc.FMGCInternal.gndTempSet = 0;
2020-07-10 19:54:13 +00:00
fmgc.FMGCInternal.toFromSet = 0;
fmgc.FMGCNodes.toFromSet.setValue(0);
fmgc.FMGCInternal.tropo = 36090;
fmgc.FMGCInternal.tropoSet = 0;
2020-03-23 03:02:25 +00:00
2020-03-30 01:27:18 +00:00
# IRSINIT
2020-05-02 00:26:05 +00:00
setprop("/FMGC/internal/align-set", 0);
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-07-10 00:25:25 +00:00
fmgc.FMGCInternal.altSelected = 0;
2020-03-25 14:54:39 +00:00
2020-03-23 03:02:25 +00:00
# INT-B
2020-08-01 13:57:19 +00:00
fmgc.FMGCInternal.zfw = 0;
fmgc.FMGCInternal.zfwSet = 0;
fmgc.FMGCInternal.zfwcg = 25.0;
fmgc.FMGCInternal.zfwcgSet = 0;
fmgc.FMGCInternal.block = 0.0;
fmgc.FMGCInternal.blockSet = 0;
fmgc.FMGCInternal.taxiFuel = 0.4;
fmgc.FMGCInternal.taxiFuelSet = 0;
fmgc.FMGCInternal.tripFuel = 0;
fmgc.FMGCInternal.tripTime = "0000";
fmgc.FMGCInternal.rteRsv = 0;
fmgc.FMGCInternal.rteRsvSet = 0;
fmgc.FMGCInternal.rtePercent = 5.0;
fmgc.FMGCInternal.rtePercentSet = 0;
fmgc.FMGCInternal.altFuel = 0;
fmgc.FMGCInternal.altFuelSet = 0;
fmgc.FMGCInternal.altTime = "0000";
fmgc.FMGCInternal.finalFuel = 0;
fmgc.FMGCInternal.finalFuelSet = 0;
fmgc.FMGCInternal.finalTime = "0030";
fmgc.FMGCInternal.finalTimeSet = 0;
fmgc.FMGCInternal.minDestFob = 0;
fmgc.FMGCInternal.minDestFobSet = 0;
fmgc.FMGCInternal.tow = 0;
fmgc.FMGCInternal.lw = 0;
fmgc.FMGCInternal.tripWind = "HD000";
fmgc.FMGCInternal.tripWindValue = 0;
fmgc.FMGCInternal.fffqSensor = "FF+FQ";
fmgc.FMGCInternal.extraFuel = 0;
fmgc.FMGCInternal.extraTime = "0000";
2020-05-02 00:26:05 +00:00
setprop("/FMGC/internal/fuel-request-set", 0);
setprop("/FMGC/internal/block-calculating", 0);
setprop("/FMGC/internal/block-confirmed", 0);
setprop("/FMGC/internal/fuel-calculating", 0);
2020-03-23 03:02:25 +00:00
2020-03-30 01:27:18 +00:00
# FUELPRED
2020-08-01 13:57:19 +00:00
fmgc.FMGCInternal.priUtc = "0000";
fmgc.FMGCInternal.altUtc = "0000";
fmgc.FMGCInternal.priEfob = 0;
fmgc.FMGCInternal.altEfob = 0;
fmgc.FMGCInternal.fob = 0;
fmgc.FMGCInternal.fuelPredGw = 0;
fmgc.FMGCInternal.cg = 0;
2020-03-28 20:40:02 +00:00
2020-03-30 21:11:32 +00:00
# PROG
2020-07-10 00:09:19 +00:00
fmgc.FMGCInternal.crzProg = 100;
2020-03-30 21:11:32 +00:00
2020-03-30 01:27:18 +00:00
# PERF
2020-03-28 20:40:02 +00:00
#PERF TO
2020-07-09 23:09:46 +00:00
fmgc.FMGCInternal.v1 = 0;
fmgc.FMGCInternal.v1set = 0;
fmgc.FMGCInternal.vr = 0;
fmgc.FMGCInternal.vrset = 0;
fmgc.FMGCInternal.v2 = 0;
fmgc.FMGCInternal.v2set = 0;
2020-04-16 11:13:34 +00:00
setprop("FMGC/internal/accel-agl-ft", "1500"); #eventually set to 1500 above runway
2020-05-15 22:30:53 +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");
2020-05-15 22:30:53 +00:00
setprop("/MCDUC/reducacc-set", 0);
2020-05-16 14:48:26 +00:00
fmgc.FMGCInternal.transAlt = 18000;
2020-03-24 00:14:12 +00:00
2020-03-30 01:27:18 +00:00
# CLB PERF
2020-05-02 00:26:05 +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-05-02 00:26:05 +00:00
setprop("/FMGC/internal/dest-qnh", -1);
setprop("/FMGC/internal/dest-temp", -999);
2020-07-29 23:24:03 +00:00
fmgc.FMGCInternal.destMag = 0;
fmgc.FMGCInternal.destMagSet = 0;
fmgc.FMGCInternal.destWind = 0;
fmgc.FMGCInternal.destWindSet = 0;
2020-05-02 00:26:05 +00:00
setprop("/FMGC/internal/vapp-speed-set", 0);
setprop("/FMGC/internal/final", "");
setprop("/FMGC/internal/baro", 99999);
setprop("/FMGC/internal/radio", 99999);
setprop("/FMGC/internal/radio-no", 0);
setprop("/FMGC/internal/ldg-elev", 0);
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-05-15 22:30:53 +00:00
setprop("/MCDU/keyboard-entry", will);
2020-03-28 20:40:02 +00:00
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-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
2020-07-22 17:35:09 +00:00
if (getprop("/MCDU[" ~ i ~ "]/atsu-active") == 1) {
mcdu_message(i, "NOT ALLOWED");
} else {
if (getprop("/MCDU[" ~ i ~ "]/active") != 2) {
mcdu_message(i, "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[" ~ i ~ "]/active", 1);
settimer(func(){
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/active", 2);
}, 2);
} else {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].empty();
2020-07-22 17:35:09 +00:00
}
2019-10-14 16:48:35 +00:00
}
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
2020-04-16 19:27:10 +00:00
initInputIRS("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("L1",i);
2020-05-31 18:15:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(1);
2020-06-01 01:30:49 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(1);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(1);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGTO") {
2020-03-30 21:11:32 +00:00
progTOInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGCLB") {
2020-03-30 21:11:32 +00:00
progCLBInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGCRZ") {
2020-03-30 21:11:32 +00:00
progCRZInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PROGDES") {
2020-04-10 18:38:58 +00:00
progDESInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L1",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "DEPARTURE");
2020-04-07 16:08:26 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-04-07 16:08:26 +00:00
}
2020-05-15 22:30:53 +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(1);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-05-23 00:40:01 +00:00
canvas_mcdu.myDirTo[i].fieldL1(mcdu_scratchpad.scratchpads[i].scratchpad);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(1);
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "COMMINIT");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") {
if (atsu.CompanyCall.frequency != 999.99) {
atsu.CompanyCall.tune();
} else {
mcdu_message(i, "NOT ALLOWED");
}
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") {
setprop("/MCDU[" ~ i ~ "]/page", "WEATHERTYPE");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERTYPE") {
atsu.AOC.selectedType = "HOURLY WX";
setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ");
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].leftKey(1);
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "2") {
2020-07-22 17:35:09 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") {
if (getprop("/MCDU[" ~ i ~ "]/active") == 1) {
mcdu_message(i, "NOT ALLOWED");
} else {
if (getprop("/MCDU[" ~ i ~ "]/atsu-active") != 2) {
mcdu_message(i, "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[" ~ i ~ "]/atsu-active", 1);
settimer(func(){
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
}, 2);
} else {
setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
mcdu_scratchpad.scratchpads[i].empty();
}
}
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2020-03-24 12:33:40 +00:00
initInputA("L2",i);
2020-05-31 18:15:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(2);
2020-06-01 01:30:49 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(2);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(2);
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-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2020-03-25 14:54:39 +00:00
perfCLBInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2020-03-25 14:54:39 +00:00
perfCRZInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") {
2020-03-25 14:54:39 +00:00
perfDESInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L2",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonLeft(2);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonLeft(2);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(2);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(2);
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") {
var result = atsu.notificationSystem.inputAirport(mcdu_scratchpad.scratchpads[i].scratchpad);
if (result == 1) {
mcdu_message(i, "NOT ALLOWED");
} elsif (result == 2) {
mcdu_message(i, "NOT IN DATA BASE");
} else {
mcdu_scratchpad.scratchpads[i].empty();
}
2020-07-24 16:14:48 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "DATAMODE");
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].leftKey(2);
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "3") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-03-23 13:48:01 +00:00
fuelPredInput("L3",i);
2020-05-31 18:15:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(3);
2020-06-01 01:30:49 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(3);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") {
2019-10-14 16:48:35 +00:00
statusInput("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L3",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonLeft(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonLeft(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") {
2020-04-08 21:49:27 +00:00
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;
2020-04-24 11:50:52 +00:00
canvas_mcdu.myHold[i] = holdPage.new(i, canvas_mcdu.myLatRev[i].wpt);
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "HOLD");
2020-04-08 21:49:27 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-04-08 21:49:27 +00:00
}
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(3);
2020-07-24 13:18:17 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "VOICEDIRECTORY");
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].leftKey(3);
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "4") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
setprop("/MCDU[" ~ i ~ "]/page", "STATUS");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("L4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-03-23 13:48:01 +00:00
fuelPredInput("L4",i);
2020-05-31 18:15:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(4);
2020-06-01 01:30:49 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(4);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(4);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L4",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonLeft(4);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonLeft(4);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(4);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(4);
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") {
if (atsu.ADS.state != 0) {
atsu.ADS.setState(0);
} else {
atsu.ADS.setState(1);
}
2020-07-24 13:18:17 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY") {
if (atsu.CompanyCall.frequency != 999.99) {
atsu.CompanyCall.tune();
} else {
mcdu_message(i, "NOT ALLOWED");
}
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].leftKey(4);
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "5") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-03-23 13:48:01 +00:00
fuelPredInput("L5",i);
2020-05-31 18:15:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(5);
2020-06-11 18:09:16 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(5);
2020-06-01 01:30:49 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") {
2019-10-14 16:48:35 +00:00
perfDESInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
2020-05-04 15:22:13 +00:00
dataInput("L5",i);
2020-06-13 01:28:14 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") {
data2Input("L5",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonLeft(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonLeft(5);
2020-06-13 02:12:28 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV") {
canvas_mcdu.myVertRev[i].pushButtonLeft(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-07 15:59:43 +00:00
canvas_mcdu.myDirTo[i].leftFieldBtn(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDuplicate[i].pushButtonLeft(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") {
2020-05-23 00:40:01 +00:00
canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad);
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].empty();
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "NOTIFICATION");
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].leftKey(5);
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "6") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("L6",i);
2020-05-02 00:55:22 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
initInputB("L6",i);
2020-05-02 01:21:57 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
fuelPredInput("L6",i);
2020-03-25 14:54:39 +00:00
} else if (getprop("MCDU[" ~ i ~ "]/page") == "IRSINIT") {
initInputIRS("L6",i);
2020-06-11 00:18:11 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonLeft(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonLeft(6);
2020-05-31 14:30:33 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") {
2020-05-31 18:15:53 +00:00
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
2020-06-01 01:10:47 +00:00
} else {
canvas_mcdu.myCLBWIND[i].reload();
2020-05-31 14:30:33 +00:00
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ROUTESELECTION") {
2020-03-25 14:54:39 +00:00
initInputROUTESEL("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") {
2019-10-14 16:48:35 +00:00
perfDESInput("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("L6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("L6",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} 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");
2020-06-01 20:55:15 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(6);
2020-07-25 15:40:35 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("/MCDU[" ~ i ~ "]/page") == "HOLD" or getprop("/MCDU[" ~ i ~ "]/page") == "AIRWAYS") {
2020-04-12 22:44:02 +00:00
if (fmgc.flightPlanController.temporaryFlag[i]) {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
2020-04-12 22:44:02 +00:00
} else {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "LATREV");
2020-04-12 22:44:02 +00:00
}
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDirTo[i].fieldL6();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") {
2020-05-04 15:22:13 +00:00
canvas_mcdu.myClosestAirport[i].freeze();
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU" or getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU" or getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") {
2020-07-22 17:35:09 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK");
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION" or getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") {
2020-07-22 17:35:09 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ" or getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
setprop("/MCDU[" ~ i ~ "]/page", "AOCMENU");
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") {
setprop("/MCDU[" ~ i ~ "]/page", "RECEIVEDMSGS");
canvas_mcdu.myReceivedMessages[i].update();
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK");
2020-07-24 16:14:48 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMINIT" or getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY" or getprop("/MCDU[" ~ i ~ "]/page") == "DATAMODE" or getprop("/MCDU[" ~ i ~ "]/page") == "COMMSTATUS" or getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") {
2020-07-23 14:29:44 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
}
}
var rskbutton = func(btn, i) {
if (btn == "1") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
2020-04-16 19:27:10 +00:00
initInputIRS("R1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2019-10-14 16:48:35 +00:00
initInputB("R1",i);
2020-05-31 14:30:33 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
2020-08-05 09:36:25 +00:00
if (fmgc.FMGCInternal.phase == 0) {
if (canvas_mcdu.myHISTWIND[i] == nil) {
canvas_mcdu.myHISTWIND[i] = windHISTPage.new(i);
} else {
canvas_mcdu.myHISTWIND[i].reload();
}
setprop("MCDU[" ~ i ~ "]/page", "WINDHIST");
2020-06-01 01:10:47 +00:00
} else {
2020-08-05 09:36:25 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-05-31 14:30:33 +00:00
}
2020-06-11 18:09:16 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonRight(1);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R1",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R1",i);
2020-05-15 22:30:53 +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);
2020-04-24 09:34:28 +00:00
canvas_mcdu.myArrival[i]._setupPageWithData();
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "ARRIVAL");
2020-04-07 16:08:26 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-04-07 16:08:26 +00:00
}
2020-05-15 22:30:53 +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(1);
2020-05-19 22:37:04 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") {
2020-05-21 18:02:59 +00:00
if (fmgc.WaypointDatabase.getCount() > 0) {
if (canvas_mcdu.myPilotWP[i] != nil) {
canvas_mcdu.myPilotWP[i].del();
}
canvas_mcdu.myPilotWP[i] = nil;
canvas_mcdu.myPilotWP[i] = pilotWaypointPage.new(i);
2020-05-31 14:05:44 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "PILOTWP");
2020-05-21 18:02:59 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED"); # todo spawn new waypoints page
2020-05-19 22:37:04 +00:00
}
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "COMMSTATUS");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") {
if (atsu.CompanyCall.frequency != 999.99) {
atsu.CompanyCall.ack();
} else {
mcdu_message(i, "NOT ALLOWED");
}
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") {
setprop("/MCDU[" ~ i ~ "]/page", "AOCMENU");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") {
var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i);
if (result == 1) {
mcdu_message(i, "NOT ALLOWED");
} elsif (result == 2) {
mcdu_message(i, "NOT IN DATA BASE");
} else {
mcdu_scratchpad.scratchpads[i].empty();
}
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERTYPE") {
atsu.AOC.selectedType = "TERM FCST";
setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "2") {
2020-08-01 13:04:33 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("R2",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2019-10-14 16:48:35 +00:00
initInputB("R2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R2",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(2);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonRight(2);
2020-05-15 22:30:53 +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(2);
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") {
var result = atsu.notificationSystem.notify();
if (result == 1) {
mcdu_message(i, "NOT ALLOWED");
}
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "COMPANYCALL");
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "WEATHERREQ");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "3") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 14:59:05 +00:00
initInputB("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-03-23 13:48:01 +00:00
fuelPredInput("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
2019-10-14 16:48:35 +00:00
printInput("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R3",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonRight(3);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") {
2020-04-12 22:44:02 +00:00
if (canvas_mcdu.myLatRev[i].type != 2) {
canvas_mcdu.myLatRev[i].nextWpt();
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-04-12 22:44:02 +00:00
}
2020-05-15 22:30:53 +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(3);
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "AOCMENU") {
if (canvas_mcdu.myReceivedMessages[i] != nil) {
canvas_mcdu.myReceivedMessages[i].del();
}
canvas_mcdu.myReceivedMessages[i] = nil;
canvas_mcdu.myReceivedMessages[i] = receivedMessagesPage.new(i);
setprop("/MCDU[" ~ i ~ "]/page", "RECEIVEDMSGS");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "4") {
2020-05-31 14:05:44 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
initInputA("R4",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
2020-04-14 22:12:38 +00:00
fuelPredInput("R4",i);
2020-05-31 16:55:32 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
2020-05-31 18:15:53 +00:00
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
2020-06-01 01:10:47 +00:00
} else {
canvas_mcdu.myCLBWIND[i].reload();
2020-05-31 16:55:32 +00:00
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
2020-05-31 17:12:43 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
2020-06-01 22:12:33 +00:00
if (fmgc.flightPlanController.temporaryFlag[i]) {
2020-07-10 19:28:17 +00:00
if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[i]) > 0) {
2020-06-01 22:12:33 +00:00
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
2020-06-10 23:22:08 +00:00
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[i].getWP(fmgc.windController.nav_indicies[i][0]), 0);
2020-06-01 22:12:33 +00:00
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
2020-06-01 01:10:47 +00:00
}
} else {
2020-07-10 19:28:17 +00:00
if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[2]) > 0) {
2020-06-01 22:12:33 +00:00
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
2020-06-10 23:22:08 +00:00
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[2].getWP(fmgc.windController.nav_indicies[2][0]), 0);
2020-06-01 22:12:33 +00:00
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
2020-06-01 01:10:47 +00:00
}
2020-05-31 17:12:43 +00:00
}
2020-06-01 22:12:33 +00:00
setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ");
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-02-24 20:54:10 +00:00
perfAPPRInput("R4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
2019-10-14 16:48:35 +00:00
printInput2("R4",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(4);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonRight(4);
2020-05-15 22:30:53 +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(4);
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "5") {
2020-05-15 22:30:53 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2020-05-01 02:44:47 +00:00
initInputA("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB") {
2020-03-23 03:02:25 +00:00
initInputB("R5",i);
2020-05-31 16:55:32 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
2020-06-01 22:12:33 +00:00
if (fmgc.flightPlanController.temporaryFlag[i]) {
2020-07-10 19:28:17 +00:00
if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[i]) > 0) {
2020-06-01 22:12:33 +00:00
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
2020-06-10 23:22:08 +00:00
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[i].getWP(fmgc.windController.nav_indicies[i][0]), 0);
2020-06-01 22:12:33 +00:00
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
2020-06-01 01:10:47 +00:00
}
} else {
2020-07-10 19:28:17 +00:00
if (fmgc.FMGCInternal.toFromSet and size(fmgc.windController.nav_indicies[2]) > 0) {
2020-06-01 22:12:33 +00:00
if (canvas_mcdu.myCRZWIND[i] != nil) {
canvas_mcdu.myCRZWIND[i].del();
}
canvas_mcdu.myCRZWIND[i] = nil;
2020-06-10 23:22:08 +00:00
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, fmgc.flightPlanController.flightplans[2].getWP(fmgc.windController.nav_indicies[2][0]), 0);
2020-06-01 22:12:33 +00:00
} else {
if (canvas_mcdu.myCRZWIND[i] == nil) {
canvas_mcdu.myCRZWIND[i] = windCRZPage.new(i, nil, nil);
} else {
canvas_mcdu.myCRZWIND[i].reload();
}
2020-06-01 01:10:47 +00:00
}
2020-05-31 16:55:32 +00:00
}
setprop("MCDU[" ~ i ~ "]/page", "WINDCRZ");
2020-05-31 17:12:43 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
2020-05-31 18:15:53 +00:00
if (canvas_mcdu.myDESWIND[i] == nil) {
canvas_mcdu.myDESWIND[i] = windDESPage.new(i, "");
2020-06-01 01:10:47 +00:00
} else {
canvas_mcdu.myDESWIND[i].reload();
2020-05-31 17:12:43 +00:00
}
setprop("MCDU[" ~ i ~ "]/page", "WINDDES");
2020-05-17 16:53:43 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "STATUS") {
statusInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-03-24 00:14:12 +00:00
perfAPPRInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFGA") {
2020-03-22 13:03:02 +00:00
perfGAInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RADNAV") {
2019-10-14 16:48:35 +00:00
radnavInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
2019-10-14 16:48:35 +00:00
dataInput("R5",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].depPushbuttonRight(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].arrPushbuttonRight(5);
2020-05-15 22:30:53 +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(5);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "LATREV") {
2020-05-04 10:48:22 +00:00
if (canvas_mcdu.myLatRev[i].type == 3) {
if (canvas_mcdu.myAirways[i] != nil) {
canvas_mcdu.myAirways[i].del();
}
canvas_mcdu.myAirways[i] = nil;
canvas_mcdu.myAirways[i] = airwaysPage.new(i, canvas_mcdu.myLatRev[i].wpt);
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "AIRWAYS");
2020-05-04 10:48:22 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2020-05-04 10:48:22 +00:00
}
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "CONNECTSTATUS");
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WEATHERREQ") {
var result = atsu.AOC.sendReq(i);
if (result == 1) {
mcdu_message(i, "NOT ALLOWED");
2020-07-31 13:30:41 +00:00
} elsif (result == 3) {
mcdu.mcdu_message(i, "VHF3 VOICE MSG NOT GEN");
} elsif (result == 4) {
mcdu.mcdu_message(i, "NO COMM MSG NOT GEN");
} else {
2020-07-30 18:36:00 +00:00
mcdu_scratchpad.scratchpads[i].empty();
}
2020-07-24 13:18:17 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY") {
for (var i = 0; i < 3; i = i + 1) {
if (getprop("/systems/radio/rmp[" ~ i ~ "]/sel_chan") == "vhf3") {
rmp.transfer(i + 1);
}
}
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
} else if (btn == "6") {
2020-07-22 17:35:09 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2020-04-20 02:08:42 +00:00
initInputA("R6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
2020-03-25 14:54:39 +00:00
initInputIRS("R6",i);
2020-06-11 00:18:11 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") {
canvas_mcdu.myCLBWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonRight(6);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDDES") {
canvas_mcdu.myDESWIND[i].pushButtonRight(6);
2020-08-05 09:36:25 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDHIST") {
canvas_mcdu.myHISTWIND[i].pushButtonRight(6);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFTO") {
2019-10-14 16:48:35 +00:00
perfTOInput("R6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCLB") {
2019-10-14 16:48:35 +00:00
perfCLBInput("R6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFCRZ") {
2019-10-14 16:48:35 +00:00
perfCRZInput("R6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFDES") {
2020-02-24 20:54:10 +00:00
perfDESInput("R6",i);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PERFAPPR") {
2020-03-22 13:03:02 +00:00
perfAPPRInput("R6",i);
2020-05-15 22:30:53 +00:00
} else if ((getprop("/MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "AOC DISABLED");
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2019-10-14 16:48:35 +00:00
initInputA("R6",i);
2020-05-15 22:30:53 +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);
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "VERTREV") {
2020-05-18 16:10:22 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDirTo[i].fieldR6();
2020-05-19 22:37:04 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") {
if (canvas_mcdu.myPilotWP[i] != nil) {
2020-05-21 18:02:59 +00:00
if (fmgc.WaypointDatabase.confirm[i]) {
fmgc.WaypointDatabase.confirm[i] = 0;
2020-05-19 22:37:04 +00:00
canvas_mcdu.myPilotWP[i].deleteCmd();
} else {
2020-05-21 18:02:59 +00:00
fmgc.WaypointDatabase.confirm[i] = 1;
2020-05-21 18:18:57 +00:00
canvas_mcdu.myPilotWP[i].deleteCmd();
2020-05-19 22:37:04 +00:00
}
}
2020-07-23 14:29:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") {
setprop("/MCDU[" ~ i ~ "]/page", "CONNECTSTATUS");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") {
setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "CONNECTSTATUS") {
setprop("/MCDU[" ~ i ~ "]/page", "NOTIFICATION");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "NOT ALLOWED");
2019-10-14 16:48:35 +00:00
}
}
}
var arrowbutton = func(btn, i) {
if (btn == "left") {
2020-05-15 22:30:53 +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");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") {
2020-05-01 02:44:47 +00:00
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "INITB");
2020-05-01 02:44:47 +00:00
} else {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
2020-05-01 02:44:47 +00:00
}
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB" or getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
setprop("/MCDU[" ~ i ~ "]/page", "INITA");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollLeft();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].scrollLeft();
2020-05-19 22:37:04 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") {
canvas_mcdu.myPilotWP[i].scrollLeft();
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].scrollLeft();
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") {
canvas_mcdu.myReceivedMessage[i].scrollLeft();
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
2020-04-12 22:44:02 +00:00
}
2019-10-14 16:48:35 +00:00
} else if (btn == "right") {
2020-05-15 22:30:53 +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");
} 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) {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "INITB");
2020-03-23 03:02:25 +00:00
} else {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
2019-10-14 16:48:35 +00:00
}
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITB" or getprop("/MCDU[" ~ i ~ "]/page") == "FUELPRED") {
setprop("/MCDU[" ~ i ~ "]/page", "INITA");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
setprop("/MCDU[" ~ i ~ "]/page", "PRINTFUNC");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollRight();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].scrollRight();
2020-05-19 22:37:04 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") {
canvas_mcdu.myPilotWP[i].scrollRight();
2020-07-30 18:36:00 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSGS") {
canvas_mcdu.myReceivedMessages[i].scrollRight();
2020-07-31 13:12:44 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "RECEIVEDMSG") {
canvas_mcdu.myReceivedMessage[i].scrollRight();
2020-07-22 17:35:09 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2");
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
2020-04-12 22:44:02 +00:00
}
2019-10-14 16:48:35 +00:00
} else if (btn == "up") {
2020-05-15 22:30:53 +00:00
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].scrollUp();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollUp();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].scrollUp();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDirTo[i].scrollUp();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
2020-04-16 19:27:10 +00:00
initInputIRS("up",i);
2020-06-01 01:10:47 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonUp();
2020-04-12 22:44:02 +00:00
}
} else if (btn == "down") {
2020-05-15 22:30:53 +00:00
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].scrollDn();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDeparture[i].scrollDn();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myArrival[i].scrollDn();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DIRTO") {
2020-04-12 22:44:02 +00:00
canvas_mcdu.myDirTo[i].scrollDn();
2020-05-15 22:30:53 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") {
2020-04-16 19:27:10 +00:00
initInputIRS("down",i);
2020-06-01 01:10:47 +00:00
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCRZ") {
canvas_mcdu.myCRZWIND[i].pushButtonDown();
}
2020-04-12 22:44:02 +00:00
}
2019-10-14 16:48:35 +00:00
}
var pagebutton = func(btn, i) {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
2019-10-14 16:48:35 +00:00
if (btn == "radnav") {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "RADNAV");
2020-03-30 03:39:31 +00:00
} else if (btn == "prog") {
2020-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PROGTO");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 2) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PROGCLB");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 3) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PROGCRZ");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PROGDES");
}
2019-10-14 16:48:35 +00:00
} else if (btn == "perf") {
2020-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFTO");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 2) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFCLB");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 3) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFCRZ");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 4) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFDES");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 5) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFAPPR");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.phase == 6) {
2020-03-30 03:39:31 +00:00
setprop("MCDU[" ~ i ~ "]/page", "PERFGA");
2020-07-10 21:15:37 +00:00
} else if (fmgc.FMGCInternal.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-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 7) {
2020-04-18 20:35:47 +00:00
fmgc.reset_FMGC();
2020-04-16 12:25:06 +00:00
}
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "INITA");
2019-10-14 16:48:35 +00:00
} else if (btn == "data") {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "DATA");
2019-10-14 16:48:35 +00:00
} else if (btn == "mcdu") {
2020-07-22 17:35:09 +00:00
var page = getprop("/MCDU[" ~ i ~ "]/page");
2020-08-01 20:53:57 +00:00
if (page != "ATSUDLINK" and page != "AOCMENU" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT") {
2020-07-22 17:35:09 +00:00
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page"));
} else {
setprop("/MCDU[" ~ i ~ "]/last-atsu-page", getprop("/MCDU[" ~ i ~ "]/page"));
}
2020-05-23 11:16:20 +00:00
mcdu_message(i, "SELECT DESIRED SYSTEM");
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "MCDU");
} else if (btn == "f-pln" or btn == "airport") {
2020-05-21 20:02:28 +00:00
if (canvas_mcdu.myFpln[i] == nil) {
canvas_mcdu.myFpln[i] = fplnPage.new(2, i);
}
if (btn == "airport") {
2020-07-10 21:15:37 +00:00
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
2020-05-21 20:02:28 +00:00
canvas_mcdu.myFpln[i].scroll = 0;
} else {
if (fmgc.flightPlanController.temporaryFlag[i]) {
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[i];
2020-05-15 22:30:53 +00:00
} else {
2020-05-21 20:02:28 +00:00
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[2];
2020-05-15 22:30:53 +00:00
}
}
2020-05-22 23:21:51 +00:00
} else {
canvas_mcdu.myFpln[i].scroll = 0;
2020-04-12 22:44:02 +00:00
}
2020-05-21 20:02:28 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "F-PLNA");
2020-04-12 22:44:02 +00:00
} else if (btn == "fuel-pred") {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "FUELPRED");
2020-04-12 22:44:02 +00:00
} else if (btn == "dirto") {
2020-05-21 20:02:28 +00:00
if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
2020-05-23 11:16:20 +00:00
mcdu_message(i, "INSERT/ERASE TMPY FIRST");
2020-05-21 20:02:28 +00:00
return;
} elsif (canvas_mcdu.myDirTo[i] == nil) {
canvas_mcdu.myDirTo[i] = dirTo.new(i);
2020-04-12 22:44:02 +00:00
}
2020-05-21 20:02:28 +00:00
setprop("/MCDU[" ~ i ~ "]/page", "DIRTO");
2020-07-22 17:35:09 +00:00
} else if (btn == "atc") {
if (getprop("/MCDU[" ~ i ~ "]/atsu-active") != 2) {
mcdu_message(i, "WAIT FOR SYSTEM RESPONSE");
setprop("/MCDU[" ~ i ~ "]/atsu-active", 1);
settimer(func(){
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
}, 2);
} else {
setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU");
}
2020-04-12 22:44:02 +00:00
}
2019-10-14 16:48:35 +00:00
}
}
var button = func(btn, i) {
2020-05-23 11:16:20 +00:00
if (getprop("/MCDU[" ~ i ~ "]/page") != "MCDU") {
2020-05-23 00:40:01 +00:00
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
2020-05-15 22:30:53 +00:00
if (btn == "SLASH") {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar("/");
2019-10-14 16:48:35 +00:00
} else if (btn == "SP") {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar(" ");
2019-10-14 16:48:35 +00:00
} else if (btn == "CLR") {
2020-05-23 00:40:01 +00:00
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
2019-10-14 16:48:35 +00:00
if (size(scratchpad) == 0) {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar("CLR");
} else {
mcdu_scratchpad.scratchpads[i].clear();
2019-10-14 16:48:35 +00:00
}
} else if (btn == "DOT") {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar(".");
2019-10-14 16:48:35 +00:00
} else if (btn == "PLUSMINUS") {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar("-");
2020-04-12 22:44:02 +00:00
} else {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].addChar(btn);
2020-04-12 22:44:02 +00:00
}
}
2019-12-29 21:37:52 +00:00
}
2020-05-23 11:37:22 +00:00
var mcdu_message = func(i, string, overrideStr = "") {
2020-05-23 11:16:20 +00:00
mcdu_scratchpad.scratchpads[i].showTypeI(mcdu_scratchpad.MessageController.getTypeIMsgByText(string));
2020-05-23 11:37:22 +00:00
mcdu_scratchpad.scratchpads[i].override(overrideStr);
2019-12-29 21:37:52 +00:00
}
2019-10-14 16:48:35 +00:00
var screenFlash = func(time, i) {
2020-05-15 22:30:53 +00:00
var page = getprop("/MCDU[" ~ i ~ "]/page");
setprop("/MCDU[" ~ i ~ "]/page", "NONE");
2019-10-14 16:48:35 +00:00
settimer(func {
2020-05-15 22:30:53 +00:00
setprop("/MCDU[" ~ i ~ "]/page", page);
2019-10-14 16:48:35 +00:00
}, time);
2020-04-12 22:08:16 +00:00
}