From b1a71ccfbf2472a6ed88119938ae79b8ddd10256 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Wed, 22 Jul 2020 18:35:09 +0100 Subject: [PATCH 01/10] Fix power source on right hand side MCDU --- A320-main.xml | 3 + Models/Instruments/MCDU/MCDU.nas | 308 ++++++++++++++++++++++++++- Models/Instruments/MCDU/MCDU1.xml | 25 +++ Models/Instruments/MCDU/MCDU2.xml | 25 +++ Models/Instruments/MCDU/res/mcdu.svg | 125 +++++++++++ Nasal/MCDU/MCDU.nas | 103 +++++++-- Nasal/Systems/Comm/Notification.nas | 25 +++ gui/dialogs/mcdu1-dlg.xml | 10 + gui/dialogs/mcdu2-dlg.xml | 142 ++++++------ 9 files changed, 672 insertions(+), 94 deletions(-) create mode 100644 Nasal/Systems/Comm/Notification.nas diff --git a/A320-main.xml b/A320-main.xml index 8d4aeb36..c9b5f37e 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -4314,6 +4314,9 @@ Aircraft/A320-family/Nasal/Panels/atc.nas + + Aircraft/A320-family/Nasal/Systems/Comm/Notification.nas + Aircraft/A320-family/Nasal/Displays/DMC.nas diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index f2b8e01c..f3422d48 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -197,6 +197,7 @@ var ldg_config_f_set = props.globals.getNode("/FMGC/internal/ldg-config-f-set", # Fetch nodes into vectors var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode("/MCDU[1]/page", 1)]; var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode("/MCDU[1]/active", 1)]; +var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.globals.getNode("/MCDU[1]/atsu-active", 1)]; # Create Nodes: var pageSwitch = [props.globals.initNode("/MCDU[0]/internal/switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/switch", 0, "BOOL")]; @@ -270,7 +271,7 @@ var canvas_MCDU_base = { "FUELPRED_ZFWCG","FUELPRED_ZFWCG_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR", "PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From", "FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R", - "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star"]; + "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT"]; }, update: func() { if (systems.ELEC.Bus.ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) { @@ -288,6 +289,11 @@ var canvas_MCDU_base = { }, updateCommon: func(i) { page = pageProp[i].getValue(); + if (page != "NOTIFICATION") { + me["NOTIFY"].hide(); + me["NOTIFY_FLTNBR"].hide(); + me["NOTIFY_AIRPORT"].hide(); + } if (page == "F-PLNA" or page == "F-PLNB") { if (!pageSwitch[i].getBoolValue()) { me["Simple"].show(); @@ -429,9 +435,9 @@ var canvas_MCDU_base = { me["Simple_L0S"].hide(); me.showLeftS(-1, -1, -1, -1, -1, -1); me.showLeftArrow(1, 1, 1, 1, -1, -1); - me.showRight(-1, -1, -1, -1, -1, 1); + me.showRight(-1, -1, -1, -1, -1, -1); me.showRightS(-1, -1, -1, -1, -1, -1); - me.showRightArrow(-1, -1, -1, -1, -1, 1); + me.showRightArrow(-1, -1, -1, -1, -1, -1); me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); @@ -450,6 +456,8 @@ var canvas_MCDU_base = { me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me["Simple_L3"].setText(" AIDS"); + me["Simple_L4"].setText(" CFDS"); pageSwitch[i].setBoolValue(1); } @@ -463,10 +471,296 @@ var canvas_MCDU_base = { me["Simple_L1"].setText(" FMGC"); me["Simple_L1"].setColor(0.0509,0.7529,0.2941); } - me["Simple_L2"].setText(" ACARS"); - me["Simple_L3"].setText(" AIDS"); - me["Simple_L4"].setText(" CFDS"); - me["Simple_R6"].setText("RETURN "); + + if (activeAtsu[i].getValue() == 0) { + me["Simple_L2"].setText(" ATSU"); + me["Simple_L2"].setColor(1,1,1); + } else if (activeAtsu[i].getValue() == 1) { + me["Simple_L2"].setText(" ATSU(SEL)"); + me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + } else if (activeAtsu[i].getValue() == 2) { + me["Simple_L2"].setText(" ATSU"); + me["Simple_L2"].setColor(0.0509,0.7529,0.2941); + } + } else if (page == "ATSUDLINK") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].hide(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("ATSU DATALINK"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("X/X"); + me["Simple_PageNum"].hide(); + me["ArrowLeft"].hide(); + me["ArrowRight"].hide(); + + me.showLeft(1, -1, -1, -1, -1, -1); + me["Simple_L0S"].hide(); + me.showLeftS(-1, -1, -1, -1, -1, -1); + me.showLeftArrow(1, -1, -1, -1, -1, -1); + me.showRight(1, -1, -1, -1, 1, 1); + me.showRightS(-1, -1, -1, -1, 1, -1); + me.showRightArrow(1, -1, -1, -1, 1, 1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(normal, normal, normal, normal, normal, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); + + me["Simple_L1"].setText(" ATC MENU"); + me["Simple_R1"].setText("AOC MENU "); + me["Simple_R5S"].setText("DATALINK "); + me["Simple_R5"].setText("STATUS "); + me["Simple_R6"].setText("COMM MENU "); + pageSwitch[i].setBoolValue(1); + } + } else if (page == "ATCMENU") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].hide(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("ATC MENU"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("1/2"); + me["Simple_PageNum"].show(); + me["ArrowLeft"].show(); + me["ArrowRight"].show(); + + me.showLeft(1, 1, -1, 1, 1, 1); + me["Simple_L0S"].hide(); + me.showLeftS(-1, -1, -1, -1, -1, 1); + me.showLeftArrow(1, 1, -1, 1, 1, 1); + me.showRight(1, 1, 1, -1, 1, 1); + me.showRightS(-1, -1, -1, -1, 1, -1); + me.showRightArrow(1, 1, 1, -1, 1, 1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(normal, normal, normal, normal, normal, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("wht", "wht", "wht", "wht", "wht", "amb"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "amb"); + + + me["Simple_L1"].setText(" LAT REQ"); + me["Simple_L2"].setText(" WHEN CAN WE"); + me["Simple_L4"].setText(" MSG LOG"); + me["Simple_L5"].setText(" NOTIFICATION"); + me["Simple_L6S"].setText(" ATSU DLK"); + me["Simple_L6"].setText(" RETURN"); + + me["Simple_R1"].setText("VERT REQ "); + me["Simple_R2"].setText("OTHER "); + me["Simple_R3"].setText("TEXT "); + me["Simple_R3"].setText("REPORTS "); + me["Simple_R5"].setText("STATUS "); + me["Simple_R5S"].setText("CONNECTION "); + me["Simple_R6"].setText("EMERGENCY "); + pageSwitch[i].setBoolValue(1); + } + } else if (page == "ATCMENU2") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].hide(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("ATC MENU"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("2/2"); + me["Simple_PageNum"].show(); + me["ArrowLeft"].show(); + me["ArrowRight"].show(); + + me.showLeft(1, 1, -1, -1, -1, 1); + me["Simple_L0S"].hide(); + me.showLeftS(-1, -1, -1, -1, -1, 1); + me.showLeftArrow(1, 1, -1, -1, -1, 1); + me.showRight(1, -1, -1, -1, -1, -1); + me.showRightS(-1, -1, -1, -1, -1, -1); + me.showRightArrow(1, -1, -1, -1, -1, -1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(normal, normal, normal, normal, normal, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); + + + me["Simple_L1"].setText(" DEPART REQ"); + me["Simple_L2"].setText(" OCEANIC REQ"); + me["Simple_L6S"].setText(" ATSU DLK"); + me["Simple_L6"].setText(" RETURN"); + + me["Simple_R1"].setText("ATIS "); + pageSwitch[i].setBoolValue(1); + } + } else if (page == "NOTIFICATION") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].show(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("NOTIFICATION"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("X/X"); + me["Simple_PageNum"].hide(); + me["ArrowLeft"].hide(); + me["ArrowRight"].hide(); + + me.showLeft(1, 1, -1, -1, -1, 1); + me["Simple_L0S"].hide(); + me.showLeftS(1, 1, -1, -1, -1, 1); + me.showLeftArrow(-1, -1, -1, -1, -1, 1); + me.showCenter(-1, 1, -1, -1, -1, -1); + me.showCenterS(-1, -1, -1, -1, -1, -1); + me.showRight(-1, 1, -1, -1, -1, 1); + me.showRightS(-1, -1, -1, -1, -1, 1); + me.showRightArrow(-1, -1, -1, -1, -1, 1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(small, normal, normal, normal, normal, normal); + me.fontSizeCenter(normal, normal, normal, normal, small, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("grn", "blu", "grn", "wht", "wht", "wht"); + me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorCenter("wht", "wht", "wht", "wht", "amb", "wht"); + me.colorRight("wht", "blu", "wht", "wht", "wht", "wht"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); + + me["Simple_L1S"].setText(" ATC FLT NBR"); + me["Simple_L2S"].setText(" ATC CENTER"); + me["Simple_C2"].setText("------------ "); + me["Simple_R2"].setText("NOTIFY "); + me["Simple_C5"].setText("NOTIFICATION UNAVAILABLE"); + + me["Simple_L6S"].setText(" ATC MENU"); + me["Simple_L6"].setText(" RETURN"); + me["Simple_R6"].setText("STATUS "); + me["Simple_R6S"].setText("CONNECTION "); + + + if (fmgc.FMGCInternal.flightNumSet) { + me["NOTIFY_FLTNBR"].hide(); + me["Simple_L1"].setText(fmgc.FMGCInternal.flightNum); + me["Simple_L1"].show(); + me["Simple_C5"].hide(); + } else { + me["Simple_L1"].hide(); + me["NOTIFY_FLTNBR"].show(); + me["Simple_C5"].show(); + } + pageSwitch[i].setBoolValue(1); + } + + if (atsu.notificationSystem.notifyAirport != nil) { + if (!atsu.notificationSystem.hasNotified) { + me["Simple_L2"].setText(atsu.notificationSystem.notifyAirport); + me["Simple_L2"].show(); + me["NOTIFY_AIRPORT"].hide(); + } else { + me["Simple_L2"].hide(); + me["NOTIFY_AIRPORT"].show(); + } + } else { + me["Simple_L2"].hide(); + me["NOTIFY_AIRPORT"].show(); + } + + if (atsu.notificationSystem.hasNotified) { + me["NOTIFY"].hide(); + me["Simple_L3"].setText(atsu.notificationSystem.notifyAirport); + me["Simple_L3"].show(); + me["Simple_L3S"].setText(" ATC NOTIFIED"); + me["Simple_L3S"].show(); + } else { + me["NOTIFY"].show(); + me["Simple_L3"].hide(); + me["Simple_L3S"].hide(); + } } else if (page == "STATUS") { if (!pageSwitch[i].getBoolValue()) { me["Simple"].show(); diff --git a/Models/Instruments/MCDU/MCDU1.xml b/Models/Instruments/MCDU/MCDU1.xml index 37e6bbc9..ff25dd8e 100644 --- a/Models/Instruments/MCDU/MCDU1.xml +++ b/Models/Instruments/MCDU/MCDU1.xml @@ -174,6 +174,31 @@ + + pick + atc_comm + + + false + + nasal + + + + + systems/electrical/bus/ac-1 + 110 + + + controls/lighting/DU/mcdu1 + 0.01 + + + + + + + pick mcdu diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml index 7b3d3818..c9c66f55 100644 --- a/Models/Instruments/MCDU/MCDU2.xml +++ b/Models/Instruments/MCDU/MCDU2.xml @@ -174,6 +174,31 @@ + + pick + atc_comm + + + false + + nasal + + + + + systems/electrical/bus/ac-2 + 110 + + + controls/lighting/DU/mcdu2 + 0.01 + + + + + + + pick mcdu diff --git a/Models/Instruments/MCDU/res/mcdu.svg b/Models/Instruments/MCDU/res/mcdu.svg index a2659979..e24d31c1 100644 --- a/Models/Instruments/MCDU/res/mcdu.svg +++ b/Models/Instruments/MCDU/res/mcdu.svg @@ -2711,4 +2711,129 @@ y="385.6102" style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">= + + + + + + + + + + + + + + + + + + + + + + diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index aa6e21d5..2c3dcdab 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -10,9 +10,10 @@ var MCDU_init = func(i) { var MCDU_reset = func(i) { setprop("/MCDU[" ~ i ~ "]/active", 0); + setprop("/MCDU[" ~ i ~ "]/atsu-active", 0); setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone - setprop("/MCDU[" ~ i ~ "]/last-page", "NONE"); setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS"); + setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK"); setprop("/MCDU[" ~ i ~ "]/page", "MCDU"); setprop("/FMGC/keyboard-left", 0); @@ -199,17 +200,21 @@ var setMode = func(will) { var lskbutton = func(btn, i) { if (btn == "1") { if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") { - if (getprop("/MCDU[" ~ i ~ "]/active") != 2) { - mcdu_message(i, "WAIT FOR SYSTEM RESPONSE"); - setprop("/MCDU[" ~ i ~ "]/active", 1); - settimer(func(){ + 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 { setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); mcdu_scratchpad.scratchpads[i].empty(); - setprop("/MCDU[" ~ i ~ "]/active", 2); - }, 2); - } else { - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); - mcdu_scratchpad.scratchpads[i].empty(); + } } } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { initInputIRS("L1",i); @@ -258,11 +263,30 @@ var lskbutton = func(btn, i) { canvas_mcdu.myDirTo[i].fieldL1(mcdu_scratchpad.scratchpads[i].scratchpad); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(1); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATSUDLINK") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } else { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "2") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + 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") { initInputA("L2",i); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "WINDCLB") { canvas_mcdu.myCLBWIND[i].pushButtonLeft(2); @@ -298,6 +322,15 @@ var lskbutton = func(btn, i) { canvas_mcdu.myDirTo[i].leftFieldBtn(2); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(2); + } 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(); + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -434,6 +467,8 @@ var lskbutton = func(btn, i) { } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") { canvas_mcdu.myClosestAirport[i].manAirportCall(mcdu_scratchpad.scratchpads[i].scratchpad); mcdu_scratchpad.scratchpads[i].empty(); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { + setprop("/MCDU[" ~ i ~ "]/page", "NOTIFICATION"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -491,6 +526,10 @@ var lskbutton = func(btn, i) { canvas_mcdu.myDirTo[i].fieldL6(); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "CLOSESTAIRPORT") { canvas_mcdu.myClosestAirport[i].freeze(); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU" or getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { + setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK"); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -565,6 +604,11 @@ var rskbutton = func(btn, i) { 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 if (getprop("/MCDU[" ~ i ~ "]/page") == "NOTIFICATION") { + var result = atsu.notificationSystem.notify(); + if (result == 1) { + mcdu_message(i, "NOT ALLOWED"); + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -734,14 +778,7 @@ var rskbutton = func(btn, i) { mcdu_message(i, "NOT ALLOWED"); } } else if (btn == "6") { - if (getprop("/MCDU[" ~ i ~ "]/page") == "MCDU") { - if (getprop("/MCDU[" ~ i ~ "]/last-page") != "NONE") { - setprop("/MCDU[" ~ i ~ "]/page", getprop("/MCDU[" ~ i ~ "]/last-page")); - mcdu_scratchpad.scratchpads[i].empty(); - } else { - mcdu_message(i, "NOT ALLOWED"); - } - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { + if (getprop("/MCDU[" ~ i ~ "]/page") == "INITA") { initInputA("R6",i); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "IRSINIT") { initInputIRS("R6",i); @@ -813,6 +850,10 @@ var arrowbutton = func(btn, i) { canvas_mcdu.myArrival[i].scrollLeft(); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") { canvas_mcdu.myPilotWP[i].scrollLeft(); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2"); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } } else if (btn == "right") { if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") { @@ -837,6 +878,10 @@ var arrowbutton = func(btn, i) { canvas_mcdu.myArrival[i].scrollRight(); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "PILOTWP") { canvas_mcdu.myPilotWP[i].scrollRight(); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU2"); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU2") { + setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } } else if (btn == "up") { if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") { @@ -908,8 +953,12 @@ var pagebutton = func(btn, i) { } else if (btn == "data") { setprop("/MCDU[" ~ i ~ "]/page", "DATA"); } else if (btn == "mcdu") { - setprop("/MCDU[" ~ i ~ "]/last-page", getprop("/MCDU[" ~ i ~ "]/page")); - setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page")); + var page = getprop("/MCDU[" ~ i ~ "]/page"); + if (page != "ATSUDLINK" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION") { + setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page")); + } else { + setprop("/MCDU[" ~ i ~ "]/last-atsu-page", getprop("/MCDU[" ~ i ~ "]/page")); + } mcdu_message(i, "SELECT DESIRED SYSTEM"); setprop("/MCDU[" ~ i ~ "]/page", "MCDU"); } else if (btn == "f-pln" or btn == "airport") { @@ -941,6 +990,18 @@ var pagebutton = func(btn, i) { canvas_mcdu.myDirTo[i] = dirTo.new(i); } setprop("/MCDU[" ~ i ~ "]/page", "DIRTO"); + } 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"); + } } } } diff --git a/Nasal/Systems/Comm/Notification.nas b/Nasal/Systems/Comm/Notification.nas new file mode 100644 index 00000000..81472bbb --- /dev/null +++ b/Nasal/Systems/Comm/Notification.nas @@ -0,0 +1,25 @@ +# A3XX Notification System +# Jonathan Redpath + +# Copyright (c) 2020 Josh Davidson (Octal450) +var notificationSystem = { + notifyAirport: nil, + hasNotified: 0, + inputAirport: func(airport) { + if (!fmgc.FMGCInternal.flightNumSet or size(airport) != 4) { return 1; } + var airportList = findAirportsByICAO(airport); + if (size(airportList) == 0) { return 2; } + if (me.hasNotified) { me.hasNotified = 0; } + me.notifyAirport = airportList[0].id; + return 0; + }, + notify: func() { + if (me.notifyAirport != nil) { + me.hasNotified = 1; + # todo - send notification to ATC + return 0; + } else { + return 1; + } + }, +}; \ No newline at end of file diff --git a/gui/dialogs/mcdu1-dlg.xml b/gui/dialogs/mcdu1-dlg.xml index 6a2f0fd8..b2abfed9 100644 --- a/gui/dialogs/mcdu1-dlg.xml +++ b/gui/dialogs/mcdu1-dlg.xml @@ -466,6 +466,16 @@ ATC 25 40 + + nasal + + + + systems/electrical/bus/ac-1 + 110 + + + - false + true @@ -70,7 +70,7 @@ controls/lighting/DU/mcdu1 0.0 1.0 - 0.2 + 0.05 false @@ -81,7 +81,7 @@ DIM - false + true @@ -93,7 +93,7 @@ controls/lighting/DU/mcdu1 0.0 1.0 - -0.2 + -0.05 false diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml index c9c66f55..38324cf0 100644 --- a/Models/Instruments/MCDU/MCDU2.xml +++ b/Models/Instruments/MCDU/MCDU2.xml @@ -58,7 +58,7 @@ BRT - false + true @@ -70,7 +70,7 @@ controls/lighting/DU/mcdu2 0.0 1.0 - 0.2 + 0.05 false @@ -81,7 +81,7 @@ DIM - false + true @@ -93,7 +93,7 @@ controls/lighting/DU/mcdu2 0.0 1.0 - -0.2 + -0.05 false From 92b61ce5f02b456429058abdfa093a2977e6438c Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 23 Jul 2020 16:10:59 +0100 Subject: [PATCH 04/10] Asterisk --- Models/Instruments/MCDU/MCDU.nas | 7 ++++++- Models/Instruments/MCDU/res/mcdu.svg | 30 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index bb89c3c2..afd37041 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -271,7 +271,7 @@ var canvas_MCDU_base = { "FUELPRED_ZFWCG","FUELPRED_ZFWCG_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR", "PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From", "FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R", - "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","COCALL","COCALLTUNE"]; + "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","COMM-ADS","COCALL","COCALLTUNE"]; }, update: func() { if (systems.ELEC.Bus.ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) { @@ -314,6 +314,11 @@ var canvas_MCDU_base = { me["COCALL"].hide(); me["COCALLTUNE"].hide(); } + if (page != "CONNECTSTATUS") { + me["COMM-ADS"].hide(); + } else { + me["COMM-ADS"].show(); + } if (page == "F-PLNA" or page == "F-PLNB") { if (!pageSwitch[i].getBoolValue()) { me["Simple"].show(); diff --git a/Models/Instruments/MCDU/res/mcdu.svg b/Models/Instruments/MCDU/res/mcdu.svg index c166f12c..79ae6313 100644 --- a/Models/Instruments/MCDU/res/mcdu.svg +++ b/Models/Instruments/MCDU/res/mcdu.svg @@ -2896,4 +2896,34 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + + + + + + From c4788d48c3ee48ce2fd1a4f4f83361c2c177f3e8 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 23 Jul 2020 16:21:55 +0100 Subject: [PATCH 05/10] Formatting --- Models/Instruments/MCDU/MCDU.nas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index afd37041..12ec02fb 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -684,7 +684,7 @@ var canvas_MCDU_base = { me["Simple_L1S"].setText(" ATC FLT NBR"); me["Simple_L2S"].setText(" ATC CENTER"); - me["Simple_C2"].setText("------------ "); + me["Simple_C2"].setText("------------ "); me["Simple_R2"].setText("NOTIFY "); me["Simple_C5"].setText("NOTIFICATION UNAVAILABLE"); @@ -787,7 +787,7 @@ var canvas_MCDU_base = { me["Simple_L1S"].setText("ACTIVE ATC"); me["Simple_L2S"].setText("NEXT ATC"); me["Simple_L2"].setText("----"); - me["Simple_C1"].setText("------------- "); + me["Simple_C1"].setText("------------- "); me["Simple_R1"].setText("NOTIFIED "); me["Simple_R3S"].setText("MAX UPLINK DELAY"); me["Simple_R3"].setText("NONE"); @@ -815,13 +815,13 @@ var canvas_MCDU_base = { } if (atsu.ADS.state == 0) { - me["Simple_C4S"].setText("---------------ADS - OFF-------"); + me["Simple_C4S"].setText("--------------ADS - OFF--------"); me["Simple_L4"].setText(" SET ARMED"); } elsif (atsu.ADS.state == 1) { - me["Simple_C4S"].setText("--------------ADS - ARMED------"); + me["Simple_C4S"].setText("-------------ADS - ARMED-------"); me["Simple_L4"].setText(" SET OFF"); } elsif (atsu.ADS.state == 2) { - me["Simple_C4S"].setText("------------ADS - CONNECTED----"); + me["Simple_C4S"].setText("-----------ADS - CONNECTED-----"); me["Simple_L4"].setText(" SET OFF"); } } else if (page == "COMMMENU") { From 3160f436967e06c36afcba306d5421978ba31c57 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 24 Jul 2020 14:18:17 +0100 Subject: [PATCH 06/10] VHF DIRECTORY --- Models/Instruments/MCDU/MCDU.nas | 541 ++++++++------------------- Models/Instruments/MCDU/res/mcdu.svg | 92 +++-- Nasal/MCDU/MCDU.nas | 18 +- 3 files changed, 239 insertions(+), 412 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 12ec02fb..0c6a8140 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -271,7 +271,7 @@ var canvas_MCDU_base = { "FUELPRED_ZFWCG","FUELPRED_ZFWCG_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR", "PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From", "FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R", - "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","COMM-ADS","COCALL","COCALLTUNE"]; + "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","PRINTPAGE","COMM-ADS","COCALL","COCALLTUNE"]; }, update: func() { if (systems.ELEC.Bus.ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) { @@ -303,6 +303,20 @@ var canvas_MCDU_base = { me["PERFGA"].hide(); me["Simple_Title"].show(); }, + hideAllArrows: func(i) { + me["Simple_L1_Arrow"].hide(); + me["Simple_L2_Arrow"].hide(); + me["Simple_L3_Arrow"].hide(); + me["Simple_L4_Arrow"].hide(); + me["Simple_L5_Arrow"].hide(); + me["Simple_L6_Arrow"].hide(); + me["Simple_R1_Arrow"].hide(); + me["Simple_R2_Arrow"].hide(); + me["Simple_R3_Arrow"].hide(); + me["Simple_R4_Arrow"].hide(); + me["Simple_R5_Arrow"].hide(); + me["Simple_R6_Arrow"].hide(); + }, updateCommon: func(i) { page = pageProp[i].getValue(); if (page != "NOTIFICATION") { @@ -319,6 +333,11 @@ var canvas_MCDU_base = { } else { me["COMM-ADS"].show(); } + if (page != "COMMINIT" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "COMMSTATUS") { + me["PRINTPAGE"].hide(); + } else { + me["PRINTPAGE"].show(); + } if (page == "F-PLNA" or page == "F-PLNB") { if (!pageSwitch[i].getBoolValue()) { me["Simple"].show(); @@ -343,18 +362,7 @@ var canvas_MCDU_base = { me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); - me["Simple_L1_Arrow"].hide(); - me["Simple_L2_Arrow"].hide(); - me["Simple_L3_Arrow"].hide(); - me["Simple_L4_Arrow"].hide(); - me["Simple_L5_Arrow"].hide(); - me["Simple_L6_Arrow"].hide(); - me["Simple_R1_Arrow"].hide(); - me["Simple_R2_Arrow"].hide(); - me["Simple_R3_Arrow"].hide(); - me["Simple_R4_Arrow"].hide(); - me["Simple_R5_Arrow"].hide(); - me["Simple_R6_Arrow"].hide(); + me.hideAllArrows(); me.fontLeft(default, default, default, default, default, default); me.fontLeftS(default, default, default, default, default, default); @@ -875,6 +883,83 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } + } else if (page == "VOICEDIRECTORY") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].show(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("VHF3 VOICE DIRECTORY"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("X/X"); + me["Simple_PageNum"].hide(); + me["ArrowLeft"].hide(); + me["ArrowRight"].hide(); + + me.showLeft(1, -1, -1, 1, -1, 1); + me["Simple_L0S"].hide(); + me.showLeftS(1, -1, -1, 1, -1, -1); + me.showLeftArrow(-1, -1, -1, -1, -1, 1); + me.showCenter(-1, -1, -1, -1, -1, -1); + me.showCenterS(1, -1, -1, -1, -1, -1); + me.showRight(1, -1, -1, -1, 1, 1); + me.showRightS(1, -1, -1, -1, 1, 1); + me.showRightArrow(-1, -1, -1, -1, -1, -1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(normal, normal, normal, normal, normal, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("blu", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorCenterS("grn", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("blu", "wht", "wht", "wht", "wht", "wht"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); + + me["Simple_L1S"].setText(" OPS"); + me["Simple_L1"].setText(" 132.225"); + me["Simple_L4S"].setText(" CO CALL"); + me["Simple_L6S"].setText(" RETURN TO"); + me["Simple_L6"].setText(" COMM MENU"); + me["Simple_R1S"].setText("MAINT "); + me["Simple_R1"].setText("132.400 "); + me["Simple_R5S"].setText("MODE "); + me["Simple_R6S"].setText("PAGE "); + me["Simple_R6"].setText("PRINT "); + me["Simple_C1S"].setFontSize(normal); + + pageSwitch[i].setBoolValue(1); + } + if (ecam.vhf3_voice.active) { + me["Simple_C1S"].setText("VOICE"); + me["Simple_R5"].setText("DATA "); + } else { + me["Simple_C1S"].setText("DATA"); + me["Simple_R5"].setText("VOICE "); + } + if (atsu.CompanyCall.frequency != 999.99) { + me["Simple_L4"].setText(" " ~ sprintf("%5.2f", atsu.CompanyCall.frequency)); + } else { + me["Simple_L4"].setText(" ---.--"); + } } else if (page == "COMMINIT") { if (!pageSwitch[i].getBoolValue()) { me.defaultHide(); @@ -891,7 +976,7 @@ var canvas_MCDU_base = { me.showLeftArrow(-1, -1, -1, -1, -1, 1); me.showRight(-1, -1, 1, -1, -1, 1); me.showRightS(-1, -1, 1, -1, -1, 1); - me.showRightArrow(-1, -1, 1, -1, -1, 1); + me.showRightArrow(-1, -1, 1, -1, -1, -1); me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); @@ -940,7 +1025,7 @@ var canvas_MCDU_base = { me.showLeftArrow(-1, -1, -1, -1, -1, 1); me.showRight(1, 1, -1, 1, 1, 1); me.showRightS(-1, 1, 1, 1, 1, 1); - me.showRightArrow(-1, -1, -1, -1, -1, 1); + me.showRightArrow(-1, -1, -1, -1, -1, -1); me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); @@ -999,7 +1084,7 @@ var canvas_MCDU_base = { me.showLeftArrow(-1, -1, -1, -1, -1, 1); me.showRight(1, -1, -1, -1, -1, 1); me.showRightS(1, -1, -1, -1, -1, 1); - me.showRightArrow(-1, -1, -1, -1, -1, 1); + me.showRightArrow(-1, -1, -1, -1, -1, -1); me["Simple_C3B"].hide(); me["Simple_C4B"].hide(); @@ -1046,14 +1131,14 @@ var canvas_MCDU_base = { me["COCALLTUNE"].hide(); } - if (atsu.CompanyCall.activeMsg != "" and !atsu.CompanyCall.received) { + if (atsu.CompanyCall.activeMsg != "") { me["Simple_L2"].setText(sprintf("%s", atsu.CompanyCall.activeMsg)); me["Simple_L2"].show(); } else { me["Simple_L2"].hide(); } - if (atsu.CompanyCall.frequency != 999.99 and !atsu.CompanyCall.received) { + if (atsu.CompanyCall.frequency != 999.99) { me["Simple_L1"].setText(" " ~ sprintf("%5.2f", atsu.CompanyCall.frequency)); } else { me["Simple_L1"].setText(" ---.--"); @@ -1305,41 +1390,11 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myPilotWP[i].title ~ " ")); - forindex (var matrixArrow; myPilotWP[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myPilotWP[i].arrowsMatrix[matrixArrow]) { - if (myPilotWP[i].arrowsMatrix[matrixArrow][item] == 1) { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); - } else { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); - } - } - } + me.dynamicPageArrowFunc(myPilotWP[i]); me.colorLeftArrow(myPilotWP[i].arrowsColour[0][0],myPilotWP[i].arrowsColour[0][1],myPilotWP[i].arrowsColour[0][2],myPilotWP[i].arrowsColour[0][3],myPilotWP[i].arrowsColour[0][4],myPilotWP[i].arrowsColour[0][5]); me.colorRightArrow(myPilotWP[i].arrowsColour[1][0],myPilotWP[i].arrowsColour[1][1],myPilotWP[i].arrowsColour[1][2],myPilotWP[i].arrowsColour[1][3],myPilotWP[i].arrowsColour[1][4],myPilotWP[i].arrowsColour[1][5]); - - forindex (var matrixFont; myPilotWP[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myPilotWP[i].fontMatrix[matrixFont]) { - if (myPilotWP[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } - + me.dynamicPageFontFunc(myPilotWP[i]); me.dynamicPageFunc(myPilotWP[i].L1, "Simple_L1"); me.dynamicPageFunc(myPilotWP[i].L2, "Simple_L2"); @@ -3757,38 +3812,10 @@ var canvas_MCDU_base = { } me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myWind[i].titleColour ~ "/b")); - forindex (var matrixArrow; myWind[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myWind[i].arrowsMatrix[matrixArrow]) { - if (myWind[i].arrowsMatrix[matrixArrow][item] == 1) { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); - } else { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); - } - } - } + me.dynamicPageArrowFunc(myWind[i]); me.colorLeftArrow(myWind[i].arrowsColour[0][0],myWind[i].arrowsColour[0][1],myWind[i].arrowsColour[0][2],myWind[i].arrowsColour[0][3],myWind[i].arrowsColour[0][4],myWind[i].arrowsColour[0][5]); - forindex (var matrixFont; myWind[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myWind[i].fontMatrix[matrixFont]) { - if (myWind[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageFontFunc(myWind[i]); me.dynamicPageFunc(myWind[i].L1, "Simple_L1"); me.dynamicPageFunc(myWind[i].L2, "Simple_L2"); @@ -3879,39 +3906,11 @@ var canvas_MCDU_base = { } else { me["Simple_Center"].hide(); } - forindex (var matrixArrow; myLatRev[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myLatRev[i].arrowsMatrix[matrixArrow]) { - if (myLatRev[i].arrowsMatrix[matrixArrow][item] == 1) { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); - } else { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); - } - } - } + + me.dynamicPageArrowFunc(myLatRev[i]); me.colorLeftArrow(myLatRev[i].arrowsColour[0][0],myLatRev[i].arrowsColour[0][1],myLatRev[i].arrowsColour[0][2],myLatRev[i].arrowsColour[0][3],myLatRev[i].arrowsColour[0][4],myLatRev[i].arrowsColour[0][5]); - - forindex (var matrixFont; myLatRev[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myLatRev[i].fontMatrix[matrixFont]) { - if (myLatRev[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageFontFunc(myLatRev[i]); me.dynamicPageFunc(myLatRev[i].L1, "Simple_L1"); me.dynamicPageFunc(myLatRev[i].L2, "Simple_L2"); @@ -3991,39 +3990,11 @@ var canvas_MCDU_base = { } else { me["Simple_Center"].hide(); } - forindex (var matrixArrow; myVertRev[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myVertRev[i].arrowsMatrix[matrixArrow]) { - if (myVertRev[i].arrowsMatrix[matrixArrow][item] == 1) { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); - } else { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); - } - } - } + + me.dynamicPageArrowFunc(myVertRev[i]); me.colorLeftArrow(myVertRev[i].arrowsColour[0][0],myVertRev[i].arrowsColour[0][1],myVertRev[i].arrowsColour[0][2],myVertRev[i].arrowsColour[0][3],myVertRev[i].arrowsColour[0][4],myVertRev[i].arrowsColour[0][5]); - - forindex (var matrixFont; myVertRev[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myVertRev[i].fontMatrix[matrixFont]) { - if (myVertRev[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageFontFunc(myVertRev[i]); me.dynamicPageFunc(myVertRev[i].L1, "Simple_L1"); me.dynamicPageFunc(myVertRev[i].L2, "Simple_L2"); @@ -4095,42 +4066,8 @@ var canvas_MCDU_base = { if (myDeparture[i] != nil) { me["Simple_Title"].setText(sprintf("%s", myDeparture[i].title[0] ~ myDeparture[i].title[1] ~ myDeparture[i].title[2])); - forindex (var matrixArrow; myDeparture[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDeparture[i].arrowsMatrix[matrixArrow]) { - if (item == 5) { - me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[0][5] ~ "/b")); - continue; - } - if (myDeparture[i].arrowsMatrix[matrixArrow][item] == 1) { - me["arrow" ~ (item + 1) ~ sign].show(); - me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ myDeparture[i].arrowsColour[matrixArrow][item] ~ "/b")); - } else { - me["arrow" ~ (item + 1) ~ sign].hide(); - } - } - } - - forindex (var matrixFont; myDeparture[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDeparture[i].fontMatrix[matrixFont]) { - if (myDeparture[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageArrowFunc(myDeparture[i]); + me.dynamicPageFontFunc(myDeparture[i]); me.dynamicPageFunc(myDeparture[i].L1, "Simple_L1"); me.dynamicPageFunc(myDeparture[i].L2, "Simple_L2"); @@ -4203,39 +4140,10 @@ var canvas_MCDU_base = { if (myDuplicate[i] != nil) { me["Simple_Title"].setText(sprintf("%s", myDuplicate[i].title)); - forindex (var matrixArrow; myDuplicate[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDuplicate[i].arrowsMatrix[matrixArrow]) { - if (myDuplicate[i].arrowsMatrix[matrixArrow][item] == 1) { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); - } else { - me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); - } - } - } + me.dynamicPageArrowFunc(myDuplicate[i]); me.colorLeftArrow(myDuplicate[i].arrowsColour[0][0],myDuplicate[i].arrowsColour[0][1],myDuplicate[i].arrowsColour[0][2],myDuplicate[i].arrowsColour[0][3],myDuplicate[i].arrowsColour[0][4],myDuplicate[i].arrowsColour[0][5]); - - forindex (var matrixFont; myDuplicate[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDuplicate[i].fontMatrix[matrixFont]) { - if (myDuplicate[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageFontFunc(myDuplicate[i]); me.dynamicPageFunc(myDuplicate[i].L1, "Simple_L1"); me.dynamicPageFunc(myDuplicate[i].L2, "Simple_L2"); @@ -4325,43 +4233,8 @@ var canvas_MCDU_base = { if (myArrival[i] != nil) { me["Simple_Title"].setText(sprintf("%s", myArrival[i].title[0] ~ myArrival[i].title[1] ~ myArrival[i].title[2])); - forindex (var matrixArrow; myArrival[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myArrival[i].arrowsMatrix[matrixArrow]) { - if (item == 1) { continue; } - if (item == 5) { - me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/b")); - continue; - } - if (myArrival[i].arrowsMatrix[matrixArrow][item] == 1) { - me["arrow" ~ (item + 1) ~ sign].show(); - me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[matrixArrow][item] ~ "/b")); - } else { - me["arrow" ~ (item + 1) ~ sign].hide(); - } - } - } - - forindex (var matrixFont; myArrival[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myArrival[i].fontMatrix[matrixFont]) { - if (myArrival[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageArrowFunc(myArrival[i]); + me.dynamicPageFontFunc(myArrival[i]); me.dynamicPageFunc(myArrival[i].L1, "Simple_L1"); me.dynamicPageFunc(myArrival[i].L2, "Simple_L2"); @@ -4446,42 +4319,8 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myHold[i].title[0] ~ myHold[i].title[1] ~ myHold[i].title[2])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/b")); - forindex (var matrixArrow; myHold[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myHold[i].arrowsMatrix[matrixArrow]) { - if (item == 5) { - me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[0][5] ~ "/b")); - continue; - } - if (myHold[i].arrowsMatrix[matrixArrow][item] == 1) { - me["arrow" ~ (item + 1) ~ sign].show(); - me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ myHold[i].arrowsColour[matrixArrow][item] ~ "/b")); - } else { - me["arrow" ~ (item + 1) ~ sign].hide(); - } - } - } - - forindex (var matrixFont; myHold[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myHold[i].fontMatrix[matrixFont]) { - if (myHold[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageArrowFunc(myHold[i]); + me.dynamicPageFontFunc(myHold[i]); me.dynamicPageFunc(myHold[i].L1, "Simple_L1"); me.dynamicPageFunc(myHold[i].L2, "Simple_L2"); @@ -4566,42 +4405,8 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myAirways[i].title[0] ~ myAirways[i].title[1] ~ myAirways[i].title[2])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/b")); - forindex (var matrixArrow; myAirways[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myAirways[i].arrowsMatrix[matrixArrow]) { - if (item == 5) { - me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[0][5] ~ "/b")); - continue; - } - if (myAirways[i].arrowsMatrix[matrixArrow][item] == 1) { - me["arrow" ~ (item + 1) ~ sign].show(); - me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ myAirways[i].arrowsColour[matrixArrow][item] ~ "/b")); - } else { - me["arrow" ~ (item + 1) ~ sign].hide(); - } - } - } - - forindex (var matrixFont; myAirways[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myAirways[i].fontMatrix[matrixFont]) { - if (myAirways[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageArrowFunc(myAirways[i]); + me.dynamicPageFontFunc(myAirways[i]); me.dynamicPageFunc(myAirways[i].L1, "Simple_L1"); me.dynamicPageFunc(myAirways[i].L2, "Simple_L2"); @@ -4687,22 +4492,8 @@ var canvas_MCDU_base = { me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[0][5] ~ "/b")); me["Simple_R6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[1][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[1][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myClosestAirport[i].arrowsColour[1][5] ~ "/b")); - forindex (var matrixFont; myClosestAirport[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myClosestAirport[i].fontMatrix[matrixFont]) { - if (myClosestAirport[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + + me.dynamicPageFontFunc(myClosestAirport[i]); me.dynamicPageFunc(myClosestAirport[i].L1, "Simple_L1"); me.dynamicPageFunc(myClosestAirport[i].L2, "Simple_L2"); @@ -4755,18 +4546,7 @@ var canvas_MCDU_base = { me["Simple_Title"].show(); me["ArrowLeft"].hide(); me["ArrowRight"].hide(); - me["Simple_L1_Arrow"].hide(); - me["Simple_L2_Arrow"].hide(); - me["Simple_L3_Arrow"].hide(); - me["Simple_L4_Arrow"].hide(); - me["Simple_L5_Arrow"].hide(); - me["Simple_L6_Arrow"].hide(); - me["Simple_R1_Arrow"].hide(); - me["Simple_R2_Arrow"].hide(); - me["Simple_R3_Arrow"].hide(); - me["Simple_R4_Arrow"].hide(); - me["Simple_R5_Arrow"].hide(); - me["Simple_R6_Arrow"].hide(); + me.hideAllArrows(); me["Simple_L0S"].hide(); me["Simple_C3B"].hide(); @@ -4789,39 +4569,8 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myDirTo[i].title[0])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/b")); - forindex (var matrixArrow; myDirTo[i].arrowsMatrix) { - if (matrixArrow == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDirTo[i].arrowsMatrix[matrixArrow]) { - if (item == 5) { continue; } - if (myDirTo[i].arrowsMatrix[matrixArrow][item] == 1) { - me["arrow" ~ (item + 1) ~ sign].show(); - me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ myDirTo[i].arrowsColour[matrixArrow][item] ~ "/b")); - } else { - me["arrow" ~ (item + 1) ~ sign].hide(); - } - } - } - - forindex (var matrixFont; myDirTo[i].fontMatrix) { - if (matrixFont == 0) { - var sign = "L"; - } else { - var sign = "R"; - } - forindex (var item; myDirTo[i].fontMatrix[matrixFont]) { - if (myDirTo[i].fontMatrix[matrixFont][item] == 1) { - me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); - } else { - me["Simple_" ~ sign ~ (item + 1)].setFont(default); - me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); - } - } - } + me.dynamicPageArrowFunc(myDirTo[i]); + me.dynamicPageFontFunc(myDirTo[i]); if (fmgc.flightPlanController.temporaryFlag[i] and mcdu.dirToFlag) { me["DIRTO_TMPY_group"].show(); @@ -5600,6 +5349,40 @@ var canvas_MCDU_base = { } } }, + dynamicPageArrowFunc: func (dynamic) { + forindex (var matrixArrow; dynamic.arrowsMatrix) { + if (matrixArrow == 0) { + var sign = "L"; + } else { + var sign = "R"; + } + forindex (var item; myLatRev[i].arrowsMatrix[matrixArrow]) { + if (myLatRev[i].arrowsMatrix[matrixArrow][item] == 1) { + me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); + } else { + me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); + } + } + } + }, + dynamicPageFontFunc: func (dynamic) { + forindex (var matrixFont; dynamic.fontMatrix) { + if (matrixFont == 0) { + var sign = "L"; + } else { + var sign = "R"; + } + forindex (var item; myDeparture[i].fontMatrix[matrixFont]) { + if (myDeparture[i].fontMatrix[matrixFont][item] == 1) { + me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); + me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); + } else { + me["Simple_" ~ sign ~ (item + 1)].setFont(default); + me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal); + } + } + } + }, updateScratchpad: func(i) { me["Scratchpad"].setText(sprintf("%s", mcdu_scratchpad.scratchpads[i].scratchpad)); var color_selected = mcdu_scratchpad.scratchpads[i].scratchpadColour; diff --git a/Models/Instruments/MCDU/res/mcdu.svg b/Models/Instruments/MCDU/res/mcdu.svg index 79ae6313..ca826c53 100644 --- a/Models/Instruments/MCDU/res/mcdu.svg +++ b/Models/Instruments/MCDU/res/mcdu.svg @@ -42,8 +42,8 @@ id="namedview371" showgrid="true" inkscape:zoom="1.1488097" - inkscape:cx="169.16726" - inkscape:cy="883.37609" + inkscape:cx="1163.1014" + inkscape:cy="302.3673" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -2897,33 +2897,63 @@ sodipodi:nodetypes="cc" /> - - - - - + style="opacity:0.97000002;stroke:#179ab7;stroke-opacity:1" + id="COMM-ADS" + inkscape:label="#g4324" + transform="matrix(1.0807111,0,0,1.0807111,-1029.7034,213.33078)"> + + + + + + + + + + + diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 4fd8b63c..2d911ad4 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -388,6 +388,8 @@ var lskbutton = func(btn, i) { } } else if (getprop("/MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") { canvas_mcdu.myDuplicate[i].pushButtonLeft(3); + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { + setprop("/MCDU[" ~ i ~ "]/page", "VOICEDIRECTORY"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -428,6 +430,12 @@ var lskbutton = func(btn, i) { } else { atsu.ADS.setState(1); } + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY") { + if (atsu.CompanyCall.frequency != 999.99) { + atsu.CompanyCall.tune(); + } else { + mcdu_message(i, "NOT ALLOWED"); + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -546,7 +554,7 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMINIT" or getprop("/MCDU[" ~ i ~ "]/page") == "COMMSTATUS" or getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMINIT" or getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY" or getprop("/MCDU[" ~ i ~ "]/page") == "COMMSTATUS" or getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU"); } else { mcdu_message(i, "NOT ALLOWED"); @@ -804,6 +812,12 @@ var rskbutton = func(btn, i) { } } else if (getprop("/MCDU[" ~ i ~ "]/page") == "ATCMENU") { setprop("/MCDU[" ~ i ~ "]/page", "CONNECTSTATUS"); + } 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); + } + } } else { mcdu_message(i, "NOT ALLOWED"); } @@ -990,7 +1004,7 @@ var pagebutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/page", "DATA"); } else if (btn == "mcdu") { var page = getprop("/MCDU[" ~ i ~ "]/page"); - if (page != "ATSUDLINK" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT") { + if (page != "ATSUDLINK" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT") { setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page")); } else { setprop("/MCDU[" ~ i ~ "]/last-atsu-page", getprop("/MCDU[" ~ i ~ "]/page")); From 2e0d10ee51337475bd44310c66097aa2b25d2c8a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 24 Jul 2020 17:14:48 +0100 Subject: [PATCH 07/10] COMM completed --- Models/Instruments/MCDU/MCDU.nas | 92 ++++++++++++++++++++++++++-- Models/Instruments/MCDU/res/mcdu.svg | 32 +++++++++- Nasal/MCDU/MCDU.nas | 6 +- 3 files changed, 123 insertions(+), 7 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 0c6a8140..87329b04 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -271,7 +271,7 @@ var canvas_MCDU_base = { "FUELPRED_ZFWCG","FUELPRED_ZFWCG_S","PROG","PROG_UPDATE","PERFTO","PERFTO_V1","PERFTO_VR","PERFTO_V2","PERFTO_FE","PERFTO_SE","PERFTO_OE","PERFAPPR", "PERFAPPR_FE","PERFAPPR_SE","PERFAPPR_OE","PERFAPPR_LDG_3","PERFAPPR_LDG_F","PERFGA","PERFGA_FE","PERFGA_SE","PERFGA_OE","FPLN","FPLN_From", "FPLN_TMPY_group","FPLN_FROM","FPLN_Callsign","departureTMPY", "arrowsDepArr","arrow1L","arrow2L","arrow3L","arrow4L","arrow5L","arrow1R","arrow2R", - "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","PRINTPAGE","COMM-ADS","COCALL","COCALLTUNE"]; + "arrow3R","arrow4R","arrow5R","DIRTO_TMPY_group","IRSINIT","IRSINIT_1","IRSINIT_2","IRSINIT_star","NOTIFY","NOTIFY_FLTNBR","NOTIFY_AIRPORT","MODEVHF3","PRINTPAGE","COMM-ADS","COCALL","COCALLTUNE"]; }, update: func() { if (systems.ELEC.Bus.ac1.getValue() >= 110 and mcdu1_lgt.getValue() > 0.01) { @@ -333,10 +333,20 @@ var canvas_MCDU_base = { } else { me["COMM-ADS"].show(); } - if (page != "COMMINIT" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "COMMSTATUS") { + if (page != "VOICEDIRECTORY") { + me["MODEVHF3"].hide(); + } else { + me["MODEVHF3"].show(); + } + if (page != "COMMINIT" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMSTATUS") { me["PRINTPAGE"].hide(); } else { me["PRINTPAGE"].show(); + if (page == "DATAMODE" or page == "COMMINIT") { + me["PRINTPAGE"].setColor(BLUE); + } else { + me["PRINTPAGE"].setColor(WHITE); + } } if (page == "F-PLNA" or page == "F-PLNB") { if (!pageSwitch[i].getBoolValue()) { @@ -960,6 +970,80 @@ var canvas_MCDU_base = { } else { me["Simple_L4"].setText(" ---.--"); } + } else if (page == "DATAMODE") { + if (!pageSwitch[i].getBoolValue()) { + me["Simple"].show(); + me["Simple_Center"].show(); + me["FPLN"].hide(); + me["DIRTO_TMPY_group"].hide(); + me["INITA"].hide(); + me["IRSINIT"].hide(); + me["INITB"].hide(); + me["FUELPRED"].hide(); + me["PROG"].hide(); + me["PERFTO"].hide(); + me["arrowsDepArr"].hide(); + me["PERFAPPR"].hide(); + me["PERFGA"].hide(); + me["Simple_Title"].show(); + me["Simple_Title"].setText("VHF3 DATA MODE"); + me["Simple_Title"].setColor(1, 1, 1); + me["Simple_PageNum"].setText("X/X"); + me["Simple_PageNum"].hide(); + me["ArrowLeft"].hide(); + me["ArrowRight"].hide(); + + me.showLeft(-1, 1, 1, 1, -1, 1); + me["Simple_L0S"].hide(); + me.showLeftS(1, 1, 1, 1, -1, -1); + me.showLeftArrow(-1, 1, 1, 1, -1, 1); + me.showCenter(-1, -1, -1, -1, -1, -1); + me.showCenterS(1, -1, -1, -1, -1, -1); + me.showRight(-1, 1, 1, -1, -1, 1); + me.showRightS(1, 1, 1, -1, -1, 1); + me.showRightArrow(-1, 1, 1, -1, -1, -1); + me["Simple_C3B"].hide(); + me["Simple_C4B"].hide(); + + me.fontLeft(default, default, default, default, default, default); + me.fontLeftS(default, default, default, default, default, default); + me.fontRight(default, default, default, default, default, default); + me.fontRightS(default, default, default, default, default, default); + + me.fontSizeLeft(normal, normal, normal, normal, normal, normal); + me.fontSizeRight(normal, normal, normal, normal, normal, normal); + + me.colorLeft("wht", "blu", "blu", "blu", "wht", "wht"); + me.colorLeftS("grn", "blu", "blu", "blu", "wht", "wht"); + me.colorLeftArrow("wht", "blu", "blu", "blu", "wht", "wht"); + me.colorCenterS("grn", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("wht", "blu", "blu", "wht", "wht", "blu"); + me.colorRightS("grn", "blu", "blu", "wht", "wht", "blu"); + me.colorRightArrow("wht", "blu", "blu", "wht", "wht", "wht"); + + me["Simple_L1S"].setFontSize(normal); + me["Simple_C1S"].setFontSize(normal); + me["Simple_R1S"].setFontSize(normal); + me["Simple_L1S"].setText(" AUTO"); + me["Simple_C1S"].setText("SITA725 "); + me["Simple_L2S"].setText(" SITA725"); + me["Simple_L2"].setText(" EUROPE"); + me["Simple_L3S"].setText(" SITA550"); + me["Simple_L3"].setText(" ASIA/AUST"); + me["Simple_L4S"].setText(" AVICOM"); + me["Simple_L4"].setText(" JAPAN"); + me["Simple_R1S"].setText(" 131.725"); + me["Simple_R2S"].setText("ARINC "); + me["Simple_R2"].setText("USA "); + me["Simple_R3S"].setText("AIRCANADA "); + me["Simple_R3"].setText("CANADA "); + me["Simple_L6S"].setText(" RETURN TO"); + me["Simple_L6"].setText(" COMM MENU"); + me["Simple_R6S"].setText("PAGE "); + me["Simple_R6"].setText("PRINT "); + + pageSwitch[i].setBoolValue(1); + } } else if (page == "COMMINIT") { if (!pageSwitch[i].getBoolValue()) { me.defaultHide(); @@ -991,8 +1075,8 @@ var canvas_MCDU_base = { me.colorLeft("wht", "blu", "blu", "blu", "wht", "wht"); me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht"); - me.colorRight("wht", "wht", "wht", "wht", "wht", "wht"); - me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); + me.colorRight("wht", "wht", "wht", "wht", "wht", "blu"); + me.colorRightS("wht", "wht", "wht", "wht", "wht", "blu"); me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht"); me["Simple_L2S"].setText(" A/C REGISTR"); diff --git a/Models/Instruments/MCDU/res/mcdu.svg b/Models/Instruments/MCDU/res/mcdu.svg index ca826c53..29bea37f 100644 --- a/Models/Instruments/MCDU/res/mcdu.svg +++ b/Models/Instruments/MCDU/res/mcdu.svg @@ -42,7 +42,7 @@ id="namedview371" showgrid="true" inkscape:zoom="1.1488097" - inkscape:cx="1163.1014" + inkscape:cx="1021.6506" inkscape:cy="302.3673" inkscape:window-x="-8" inkscape:window-y="-8" @@ -2956,4 +2956,34 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> + + + + + + diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 2d911ad4..90a46e41 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -339,6 +339,8 @@ var lskbutton = func(btn, i) { } else { mcdu_scratchpad.scratchpads[i].empty(); } + } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { + setprop("/MCDU[" ~ i ~ "]/page", "DATAMODE"); } else { mcdu_message(i, "NOT ALLOWED"); } @@ -554,7 +556,7 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/page", "ATCMENU"); } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMMENU") { setprop("/MCDU[" ~ i ~ "]/page", "ATSUDLINK"); - } else if (getprop("/MCDU[" ~ i ~ "]/page") == "COMMINIT" or getprop("/MCDU[" ~ i ~ "]/page") == "VOICEDIRECTORY" or getprop("/MCDU[" ~ i ~ "]/page") == "COMMSTATUS" or getprop("/MCDU[" ~ i ~ "]/page") == "COMPANYCALL") { + } 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") { setprop("/MCDU[" ~ i ~ "]/page", "COMMMENU"); } else { mcdu_message(i, "NOT ALLOWED"); @@ -1004,7 +1006,7 @@ var pagebutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/page", "DATA"); } else if (btn == "mcdu") { var page = getprop("/MCDU[" ~ i ~ "]/page"); - if (page != "ATSUDLINK" and page != "ATCMENU" and page != "ATCMENU2" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT") { + if (page != "ATSUDLINK" 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") { setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", getprop("/MCDU[" ~ i ~ "]/page")); } else { setprop("/MCDU[" ~ i ~ "]/last-atsu-page", getprop("/MCDU[" ~ i ~ "]/page")); From ba95771c2e1e3c0132daa38d5d5b22b1c97c9094 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 24 Jul 2020 18:57:23 +0100 Subject: [PATCH 08/10] Fix typo --- Models/Instruments/MCDU/MCDU.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 87329b04..18c6807a 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -303,7 +303,7 @@ var canvas_MCDU_base = { me["PERFGA"].hide(); me["Simple_Title"].show(); }, - hideAllArrows: func(i) { + hideAllArrows: func() { me["Simple_L1_Arrow"].hide(); me["Simple_L2_Arrow"].hide(); me["Simple_L3_Arrow"].hide(); From 35fe108f8e2aad8eebc02086b6dac87fcb3f5013 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 24 Jul 2020 19:01:27 +0100 Subject: [PATCH 09/10] Fix more typos --- Models/Instruments/MCDU/MCDU.nas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 18c6807a..7a99f5b8 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -5440,8 +5440,8 @@ var canvas_MCDU_base = { } else { var sign = "R"; } - forindex (var item; myLatRev[i].arrowsMatrix[matrixArrow]) { - if (myLatRev[i].arrowsMatrix[matrixArrow][item] == 1) { + forindex (var item; dynamic.arrowsMatrix[matrixArrow]) { + if (dynamic.arrowsMatrix[matrixArrow][item] == 1) { me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show(); } else { me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide(); @@ -5456,8 +5456,8 @@ var canvas_MCDU_base = { } else { var sign = "R"; } - forindex (var item; myDeparture[i].fontMatrix[matrixFont]) { - if (myDeparture[i].fontMatrix[matrixFont][item] == 1) { + forindex (var item; dynamic.fontMatrix[matrixFont]) { + if (dynamic.fontMatrix[matrixFont][item] == 1) { me["Simple_" ~ sign ~ (item + 1)].setFont(symbol); me["Simple_" ~ sign ~ (item + 1)].setFontSize(small); } else { From 8ce236592089a81d61a5f639a3fa43d57c2b498d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 25 Jul 2020 01:21:38 +0100 Subject: [PATCH 10/10] Final bugfix --- Models/Instruments/MCDU/MCDU.nas | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 7a99f5b8..8137fe9b 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -4150,7 +4150,7 @@ var canvas_MCDU_base = { if (myDeparture[i] != nil) { me["Simple_Title"].setText(sprintf("%s", myDeparture[i].title[0] ~ myDeparture[i].title[1] ~ myDeparture[i].title[2])); - me.dynamicPageArrowFunc(myDeparture[i]); + me.dynamicPageArrowFuncDepArr(myDeparture[i]); me.dynamicPageFontFunc(myDeparture[i]); me.dynamicPageFunc(myDeparture[i].L1, "Simple_L1"); @@ -4317,7 +4317,7 @@ var canvas_MCDU_base = { if (myArrival[i] != nil) { me["Simple_Title"].setText(sprintf("%s", myArrival[i].title[0] ~ myArrival[i].title[1] ~ myArrival[i].title[2])); - me.dynamicPageArrowFunc(myArrival[i]); + me.dynamicPageArrowFuncDepArr(myArrival[i]); me.dynamicPageFontFunc(myArrival[i]); me.dynamicPageFunc(myArrival[i].L1, "Simple_L1"); @@ -4403,7 +4403,7 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myHold[i].title[0] ~ myHold[i].title[1] ~ myHold[i].title[2])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myHold[i].titleColour ~ "/b")); - me.dynamicPageArrowFunc(myHold[i]); + me.dynamicPageArrowFuncDepArr(myHold[i]); me.dynamicPageFontFunc(myHold[i]); me.dynamicPageFunc(myHold[i].L1, "Simple_L1"); @@ -4489,7 +4489,7 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myAirways[i].title[0] ~ myAirways[i].title[1] ~ myAirways[i].title[2])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myAirways[i].titleColour ~ "/b")); - me.dynamicPageArrowFunc(myAirways[i]); + me.dynamicPageArrowFuncDepArr(myAirways[i]); me.dynamicPageFontFunc(myAirways[i]); me.dynamicPageFunc(myAirways[i].L1, "Simple_L1"); @@ -4653,7 +4653,7 @@ var canvas_MCDU_base = { me["Simple_Title"].setText(sprintf("%s", myDirTo[i].title[0])); me["Simple_Title"].setColor(getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/r"), getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/g"), getprop("/MCDUC/colors/" ~ myDirTo[i].titleColour ~ "/b")); - me.dynamicPageArrowFunc(myDirTo[i]); + me.dynamicPageArrowFuncDepArr(myDirTo[i]); me.dynamicPageFontFunc(myDirTo[i]); if (fmgc.flightPlanController.temporaryFlag[i] and mcdu.dirToFlag) { @@ -5449,6 +5449,27 @@ var canvas_MCDU_base = { } } }, + dynamicPageArrowFuncDepArr: func (dynamic) { + forindex (var matrixArrow; dynamic.arrowsMatrix) { + if (matrixArrow == 0) { + var sign = "L"; + } else { + var sign = "R"; + } + forindex (var item; dynamic.arrowsMatrix[matrixArrow]) { + if (item == 5) { + me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[0][5] ~ "/b")); + continue; + } + if (dynamic.arrowsMatrix[matrixArrow][item] == 1) { + me["arrow" ~ (item + 1) ~ sign].show(); + me["arrow" ~ (item + 1) ~ sign].setColor(getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[matrixArrow][item] ~ "/r"), getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[matrixArrow][item] ~ "/g"), getprop("/MCDUC/colors/" ~ dynamic.arrowsColour[matrixArrow][item] ~ "/b")); + } else { + me["arrow" ~ (item + 1) ~ sign].hide(); + } + } + } + }, dynamicPageFontFunc: func (dynamic) { forindex (var matrixFont; dynamic.fontMatrix) { if (matrixFont == 0) { @@ -5467,6 +5488,7 @@ var canvas_MCDU_base = { } } }, + updateScratchpad: func(i) { me["Scratchpad"].setText(sprintf("%s", mcdu_scratchpad.scratchpads[i].scratchpad)); var color_selected = mcdu_scratchpad.scratchpads[i].scratchpadColour;