From 2298a87e4b12e978337f7c7f8aa44cab0d8882c7 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 31 Dec 2020 20:03:47 +0000 Subject: [PATCH 1/4] Manual merge of work completed by inuyaksa: - long pressing CLR button (keyboard/MCDU panel) clears scratchpad - abort button for panel state dialog, when error occurs on state script, you can't close panel - fix MCDU starting page, arrow color and REQ state (https://youtu.be/twwUjHXdNVU?t=57) - PERFTO, validation on insert of V1/Vr/V2 values and type II error messages - PERFTO, basic validation of THRRED/ACC --- A320-main.xml | 21 ++++- AircraftConfig/acconfig.nas | 18 +++- AircraftConfig/psload.xml | 10 +++ Models/Instruments/MCDU/MCDU.nas | 143 ++++++++++++++++++------------ Models/Instruments/MCDU/MCDU1.xml | 20 ++++- Models/Instruments/MCDU/MCDU2.xml | 20 ++++- Nasal/FMGC/FMGC.nas | 3 + Nasal/FMGC/SimbriefParser.nas | 39 +++++++- Nasal/FMGC/mcdu-messages.nas | 7 ++ Nasal/MCDU/F-PLN.nas | 36 +++++--- Nasal/MCDU/INITA.nas | 40 ++++++++- Nasal/MCDU/PERFTO.nas | 38 +++++++- 12 files changed, 313 insertions(+), 82 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index af12a503..499d15b2 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1918,20 +1918,37 @@ Del CLR + true /FMGC/keyboard-left nasal - + /FMGC/keyboard-right nasal - + + + + + /FMGC/keyboard-left + + nasal + + + + + /FMGC/keyboard-right + + nasal + + + Disable MCDU keyboard mode diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 9eca731c..72b5dfaf 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -196,10 +196,10 @@ var renderingSettings = { check: func() { var rembrandt = getprop("/sim/rendering/rembrandt/enabled"); var ALS = getprop("/sim/rendering/shaders/skydome"); - var customSettings = getprop("/sim/rendering/shaders/custom-settings") == 1; + var landmass = getprop("/sim/rendering/shaders/landmass") >= 4; var model = getprop("/sim/rendering/shaders/model") >= 2; - if (!rembrandt and (!ALS or !customSettings or !landmass or !model)) { + if (!rembrandt and (!ALS or !landmass or !model)) { rendering_dlg.open(); } }, @@ -255,6 +255,15 @@ var writeSettings = func { # Panel States # ################ +# Abort auto-config and close dialog +var abortPanelStates = func { + if (getprop("/systems/acconfig/autoconfig-running") == 1) { + setprop("/systems/acconfig/autoconfig-running", 0); + } + ps_load_dlg.close(); + spinning.stop(); +} + # Cold and Dark var colddark = func { if (getprop("/systems/acconfig/mismatch-code") == "0x000") { @@ -301,6 +310,7 @@ var colddark = func { } } var colddark_b = func { + if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted # Continues the Cold and Dark script, after engines fully shutdown. setprop("/controls/apu/master", 0); settimer(func { @@ -351,6 +361,7 @@ var beforestart = func { } } var beforestart_b = func { + if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted # Continue with engine start prep. systems.FUEL.Switches.pumpLeft1.setValue(1); systems.FUEL.Switches.pumpLeft2.setValue(1); @@ -438,6 +449,7 @@ var taxi = func { } } var taxi_b = func { + if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted # Continue with engine start prep, and start engines. systems.FUEL.Switches.pumpLeft1.setValue(1); systems.FUEL.Switches.pumpLeft2.setValue(1); @@ -491,6 +503,7 @@ var taxi_b = func { settimer(taxi_c, 2); } var taxi_c = func { + if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted setprop("/controls/engines/engine-start-switch", 2); setprop("/controls/engines/engine[0]/cutoff-switch", 0); setprop("/controls/engines/engine[1]/cutoff-switch", 0); @@ -499,6 +512,7 @@ var taxi_c = func { }, 10); } var taxi_d = func { + if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted # After Start items. setprop("/controls/engines/engine-start-switch", 1); setprop("/controls/apu/master", 0); diff --git a/AircraftConfig/psload.xml b/AircraftConfig/psload.xml index 8245b84e..fd7f9e19 100644 --- a/AircraftConfig/psload.xml +++ b/AircraftConfig/psload.xml @@ -37,6 +37,16 @@ /systems/acconfig/spin 1 + diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index e44fcf4a..b90bd043 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -155,6 +155,8 @@ var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode 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)]; +var reqFMGC = [0,0]; # flag = 1 when REQ is show + # Conversion factor pounds to kilogram var LBS2KGS = 0.4535924; @@ -198,23 +200,23 @@ var canvas_MCDU_base = { me["PERFTO_FE"].setFont(symbol); me["PERFTO_SE"].setFont(symbol); me["PERFTO_OE"].setFont(symbol); - me["PERFTO_FE"].setColor(0.8078,0.8039,0.8078); - me["PERFTO_SE"].setColor(0.8078,0.8039,0.8078); - me["PERFTO_OE"].setColor(0.8078,0.8039,0.8078); + me["PERFTO_FE"].setColor(BLUE); + me["PERFTO_SE"].setColor(BLUE); + me["PERFTO_OE"].setColor(BLUE); me["PERFAPPR_FE"].setFont(symbol); me["PERFAPPR_SE"].setFont(symbol); me["PERFAPPR_OE"].setFont(symbol); - me["PERFAPPR_FE"].setColor(0.8078,0.8039,0.8078); - me["PERFAPPR_SE"].setColor(0.8078,0.8039,0.8078); - me["PERFAPPR_OE"].setColor(0.8078,0.8039,0.8078); + me["PERFAPPR_FE"].setColor(BLUE); + me["PERFAPPR_SE"].setColor(BLUE); + me["PERFAPPR_OE"].setColor(BLUE); me["PERFGA_FE"].setFont(symbol); me["PERFGA_SE"].setFont(symbol); me["PERFGA_OE"].setFont(symbol); - me["PERFGA_FE"].setColor(0.8078,0.8039,0.8078); - me["PERFGA_SE"].setColor(0.8078,0.8039,0.8078); - me["PERFGA_OE"].setColor(0.8078,0.8039,0.8078); + me["PERFGA_FE"].setColor(BLUE); + me["PERFGA_SE"].setColor(BLUE); + me["PERFGA_OE"].setColor(BLUE); me.page = canvas_group; @@ -280,7 +282,7 @@ var canvas_MCDU_base = { me["PERFTO"].hide(); }, defaultPageNumbers: func() { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("X/X"); me["Simple_PageNum"].hide(); me["ArrowLeft"].hide(); @@ -497,29 +499,42 @@ var canvas_MCDU_base = { me.standardFontColour(); me["Simple_L3"].setText(" AIDS"); me["Simple_L4"].setText(" CFDS"); + pageSwitch[i].setBoolValue(1); } - if (active[i].getValue() == 0) { + if (active[i].getValue() == 0 and reqFMGC[i] == 0) { me["Simple_L1"].setText(" FMGC"); - me["Simple_L1"].setColor(1,1,1); + me["Simple_L1"].setColor(GREEN); + me["Simple_L1_Arrow"].setColor(GREEN); + reqFMGC[i] = 1; + settimer(func { + if (active[i].getValue() == 0) { + me["Simple_L1"].setText(" FMGC (REQ)"); + } + },1.4); #delay estimated } else if (active[i].getValue() == 1) { - me["Simple_L1"].setText(" FMGC(SEL)"); - me["Simple_L1"].setColor(0.0901,0.6039,0.7176); + me["Simple_L1"].setText(" FMGC (SEL)"); + me["Simple_L1"].setColor(BLUE); + me["Simple_L1_Arrow"].setColor(BLUE); } else if (active[i].getValue() == 2) { me["Simple_L1"].setText(" FMGC"); - me["Simple_L1"].setColor(0.0509,0.7529,0.2941); + me["Simple_L1"].setColor(GREEN); + me["Simple_L1_Arrow"].setColor(GREEN); } if (activeAtsu[i].getValue() == 0) { me["Simple_L2"].setText(" ATSU"); - me["Simple_L2"].setColor(1,1,1); + me["Simple_L2"].setColor(WHITE); + me["Simple_L2_Arrow"].setColor(WHITE); } else if (activeAtsu[i].getValue() == 1) { - me["Simple_L2"].setText(" ATSU(SEL)"); - me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + me["Simple_L2"].setText(" ATSU (SEL)"); + me["Simple_L2"].setColor(BLUE); + me["Simple_L2_Arrow"].setColor(BLUE); } else if (activeAtsu[i].getValue() == 2) { me["Simple_L2"].setText(" ATSU"); - me["Simple_L2"].setColor(0.0509,0.7529,0.2941); + me["Simple_L2"].setColor(GREEN); + me["Simple_L2_Arrow"].setColor(GREEN); } } else if (page == "ATSUDLINK") { if (!pageSwitch[i].getBoolValue()) { @@ -912,7 +927,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHide(); me["Simple_Title"].setText("ATC MENU"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("1/2"); me["Simple_PageNum"].show(); me["ArrowLeft"].show(); @@ -958,7 +973,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHideWithCenter(); me["Simple_Title"].setText("TEXT"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("1/2"); me["Simple_PageNum"].show(); me["ArrowLeft"].show(); @@ -1049,7 +1064,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHideWithCenter(); me["Simple_Title"].setText("ATC MENU"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("2/2"); me["Simple_PageNum"].show(); me["ArrowLeft"].show(); @@ -1146,7 +1161,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHideWithCenter(); me["Simple_Title"].setText("ATS623 ATIS MENU"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].hide(); me["ArrowLeft"].hide(); me["ArrowRight"].hide(); @@ -1907,7 +1922,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHide(); me["Simple_Title"].setText("DATA INDEX"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("1/2"); me["Simple_PageNum"].show(); me["ArrowLeft"].show(); @@ -1947,7 +1962,7 @@ var canvas_MCDU_base = { if (!pageSwitch[i].getBoolValue()) { me.defaultHide(); me["Simple_Title"].setText("DATA INDEX"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("2/2"); me["Simple_PageNum"].show(); me["ArrowLeft"].show(); @@ -2228,7 +2243,7 @@ var canvas_MCDU_base = { me["PERFGA"].hide(); me["Simple_Title"].show(); me["Simple_Title"].setText("INIT"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("X/X"); me["Simple_PageNum"].hide(); me["ArrowLeft"].show(); @@ -2272,12 +2287,12 @@ var canvas_MCDU_base = { if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.costIndexSet) { me["INITA_CostIndex"].hide(); - me["Simple_L5"].setColor(1,1,1); + me["Simple_L5"].setColor(WHITE); me["Simple_L5"].show(); me["Simple_L5"].setText("---"); } else if (fmgc.FMGCInternal.costIndexSet) { me["INITA_CostIndex"].hide(); - me["Simple_L5"].setColor(0.0901,0.6039,0.7176); + me["Simple_L5"].setColor(BLUE); me["Simple_L5"].show(); me["Simple_L5"].setText(sprintf("%s", fmgc.FMGCInternal.costIndex)); } else { @@ -2286,28 +2301,40 @@ var canvas_MCDU_base = { } if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.crzSet) { me["INITA_CruiseFLTemp"].hide(); - me["Simple_L6"].setColor(1,1,1); + me["Simple_L6"].setColor(WHITE); me["Simple_L6"].setText("-----/---g"); } else if (fmgc.FMGCInternal.crzSet and fmgc.FMGCInternal.crzTempSet) { me["INITA_CruiseFLTemp"].hide(); - me["Simple_L6"].setColor(0.0901,0.6039,0.7176); + me["Simple_L6"].setColor(BLUE); me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp)); } else if (fmgc.FMGCInternal.crzSet) { me["INITA_CruiseFLTemp"].hide(); - me["Simple_L6"].setColor(0.0901,0.6039,0.7176); + me["Simple_L6"].setColor(BLUE); fmgc.FMGCInternal.crzTemp = 15 - (2 * fmgc.FMGCInternal.crzFl / 10); fmgc.FMGCInternal.crzTempSet = 1; me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp)); } else { me["INITA_CruiseFLTemp"].show(); - me["Simple_L6"].setColor(0.7333,0.3803,0); + me["Simple_L6"].setColor(AMBER); me["Simple_L6"].setText(" g"); } + + if (fmgc.FMGCInternal.coRouteSet) { # show coRoute when valid + me["INITA_CoRoute"].hide(); + me["Simple_L1"].setText(fmgc.FMGCInternal.coRoute); + me["Simple_L1"].setColor(BLUE); + me["Simple_L1"].show(); + } else { + me["Simple_L1"].hide(); + me["INITA_CoRoute"].show(); + me["Simple_L1"].setText("NONE"); + } + if (fmgc.FMGCInternal.toFromSet) { me["INITA_CoRoute"].hide(); me["INITA_FromTo"].hide(); me["Simple_L1"].show(); - me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + me["Simple_L2"].setColor(BLUE); if (fmgc.FMGCInternal.altAirportSet) { me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport); } else { @@ -2320,7 +2347,7 @@ var canvas_MCDU_base = { me["INITA_CoRoute"].show(); me["INITA_FromTo"].show(); me["Simple_L1"].hide(); - me["Simple_L2"].setColor(1,1,1); + me["Simple_L2"].setColor(WHITE); me["Simple_L2"].setText("----/----------"); me.showRight(-1, 1, 0, 0, 0, 0); me["Simple_R2S"].show(); @@ -2364,7 +2391,7 @@ var canvas_MCDU_base = { me["Simple_L3S"].setText("FLT NBR"); me["Simple_L5S"].setText("COST INDEX"); me["Simple_L6S"].setText("CRZ FL/TEMP"); - me["Simple_L1"].setText("NONE"); + #me["Simple_L1"].setText("NONE"); # manage before (coRoute) me["Simple_L3"].setText(sprintf("%s", fmgc.FMGCInternal.flightNum)); me["Simple_R1S"].setText("FROM/TO "); me["Simple_R2S"].setText("INIT "); @@ -2666,7 +2693,7 @@ var canvas_MCDU_base = { me["Simple_R5"].setText(fmgc.FMGCInternal.tripWind); me["Simple_R6S"].setText("EXTRA/TIME"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); if (!fmgc.FMGCInternal.fuelRequest) { me["Simple_L2"].setText("---.-/----"); @@ -2706,7 +2733,7 @@ var canvas_MCDU_base = { me["Simple_R6"].setText("---.-/----"); me["Simple_Title"].setText("INIT"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me.colorLeft("ack", "wht", "wht", "wht", "wht", "wht"); me.colorRight("ack", "blu", "amb", "wht", "ack", "wht"); @@ -3059,7 +3086,7 @@ var canvas_MCDU_base = { me["PERFGA"].hide(); me["Simple_Title"].show(); me["Simple_Title"].setText("FUEL PRED"); - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me["Simple_PageNum"].setText("X/X"); me["Simple_PageNum"].hide(); me["ArrowLeft"].show(); @@ -3387,7 +3414,7 @@ var canvas_MCDU_base = { } me["Simple_Title"].show(); - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); me["Simple_PageNum"].setText("X/X"); me["Simple_PageNum"].hide(); me["ArrowLeft"].hide(); @@ -3570,9 +3597,9 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 1) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); } if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) { @@ -3701,7 +3728,7 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 2) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showLeftS(0, 0, 0, 0, 1, 0); me.showLeftArrow(0, 0, 0, 0, 1, 1); @@ -3742,7 +3769,7 @@ var canvas_MCDU_base = { setprop("/FMGC/internal/activate-twice", 0); } } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me.showLeft(0, 0, 0, 0, -1, 0); me.showLeftS(0, 0, 0, 0, -1, 0); me.showLeftArrow(0, 0, 0, 0, -1, 0); @@ -3776,10 +3803,10 @@ var canvas_MCDU_base = { me["Simple_L2S"].setText(" CI"); if (fmgc.FMGCInternal.costIndexSet) { - me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + me["Simple_L2"].setColor(BLUE); me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex)); } else { - me["Simple_L2"].setColor(1,1,1); + me["Simple_L2"].setColor(WHITE); me["Simple_L2"].setText(" ---"); } @@ -3854,7 +3881,7 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 3) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); if (managedSpeed.getValue() == 1) { me.showLeft(0, 0, 0, -1, 0, 0); @@ -3889,7 +3916,7 @@ var canvas_MCDU_base = { setprop("/FMGC/internal/activate-twice", 0); } } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me.colorLeft("ack", "ack", "ack", "ack", "ack", "wht"); me.colorLeftS("ack", "ack", "ack", "ack", "ack", "wht"); @@ -3916,10 +3943,10 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.costIndexSet) { - me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + me["Simple_L2"].setColor(BLUE); me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex)); } else { - me["Simple_L2"].setColor(1,1,1); + me["Simple_L2"].setColor(WHITE); me["Simple_L2"].setText(" ---"); } @@ -3992,7 +4019,7 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 4) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); me.showLeft(0, 0, 0, 0, 1, 0); me.showRight(0, 1, 0, 1, 0, 0); me.showRightS(0, 0, 1, 0, 0, 0); @@ -4032,7 +4059,7 @@ var canvas_MCDU_base = { setprop("/FMGC/internal/activate-twice", 0); } } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); me.showLeft(0, 0, 0, 0, -1, 0); me.showRight(0, -1, 0, -1, 0, 0); me.showRightS(0, 0, -1, 0, 0, 0); @@ -4064,10 +4091,10 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.costIndexSet) { - me["Simple_L2"].setColor(0.0901,0.6039,0.7176); + me["Simple_L2"].setColor(BLUE); me["Simple_L2"].setText(sprintf(" %2.0f", fmgc.FMGCInternal.costIndex)); } else { - me["Simple_L2"].setColor(1,1,1); + me["Simple_L2"].setColor(WHITE); me["Simple_L2"].setText(" ---"); } @@ -4148,9 +4175,9 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 5) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); } me["Simple_L0S"].setText("DEST"); @@ -4331,9 +4358,9 @@ var canvas_MCDU_base = { } if (fmgc.FMGCInternal.phase == 6) { - me["Simple_Title"].setColor(0.0509,0.7529,0.2941); + me["Simple_Title"].setColor(GREEN); } else { - me["Simple_Title"].setColor(1, 1, 1); + me["Simple_Title"].setColor(WHITE); } if (thrAccSet.getValue() == 1) { @@ -5967,6 +5994,8 @@ setlistener("sim/signals/fdm-initialized", func { mcdu.mcdu_message(0, "SELECT DESIRED SYSTEM"); mcdu.mcdu_message(1, "SELECT DESIRED SYSTEM"); + + reqFMGC = [0,0]; # reset FMGC REQ status - on MCDU restart MCDU_update.start(); }); diff --git a/Models/Instruments/MCDU/MCDU1.xml b/Models/Instruments/MCDU/MCDU1.xml index 51439c6d..1b7c9182 100644 --- a/Models/Instruments/MCDU/MCDU1.xml +++ b/Models/Instruments/MCDU/MCDU1.xml @@ -1705,7 +1705,7 @@ true nasal - + @@ -1719,6 +1719,24 @@ + + + nasal + + + + + systems/electrical/bus/ac-1 + 110 + + + controls/lighting/DU/mcdu1 + 0.01 + + + + + diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml index 38324cf0..78516b3e 100644 --- a/Models/Instruments/MCDU/MCDU2.xml +++ b/Models/Instruments/MCDU/MCDU2.xml @@ -1705,7 +1705,7 @@ true nasal - + @@ -1719,6 +1719,24 @@ + + + nasal + + + + + systems/electrical/bus/ac-2 + 110 + + + controls/lighting/DU/mcdu2 + 0.01 + + + + + diff --git a/Nasal/FMGC/FMGC.nas b/Nasal/FMGC/FMGC.nas index 56bc2ecd..1ca929bb 100644 --- a/Nasal/FMGC/FMGC.nas +++ b/Nasal/FMGC/FMGC.nas @@ -169,6 +169,8 @@ var FMGCInternal = { altAirportSet: 0, altSelected: 0, arrApt: "", + coRoute: "", + coRouteSet: 0, costIndex: 0, costIndexSet: 0, crzFt: 10000, @@ -309,6 +311,7 @@ var updateArptLatLon = func { updateRouteManagerAlt = func() { setprop("autopilot/route-manager/cruise/altitude-ft", FMGCInternal.crzFt); + # TODO - update FMGCInternal.phase when DES to re-enter in CLIMB/CRUIZE }; ######## diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index c563d9aa..1c2a0d07 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -1,5 +1,6 @@ # A3XX Simbrief Parser # Copyright (c) 2020 Jonathan Redpath (legoboyvdlp) +# enhanceded 12/2020 - parse TOD & TOC psedo waypoints, set computer speeds on fix wps, fake coRoute name var LBS2KGS = 0.4535924; @@ -157,12 +158,16 @@ var SimbriefParser = { if (ident == "TOC") { _foundTOC = 1; - continue; + #setprop("/autopilot/route-manager/vnav/tc/latitude-deg",ofpFix.getNode("pos_lat").getValue()); + #setprop("/autopilot/route-manager/vnav/tc/longitude-deg",ofpFix.getNode("pos_long").getValue()); + #ident = "(T/C)"; } if (ident == "TOD") { _foundTOD = 1; - continue; + #setprop("/autopilot/route-manager/vnav/td/latitude-deg",ofpFix.getNode("pos_lat").getValue()); + #setprop("/autopilot/route-manager/vnav/td/longitude-deg",ofpFix.getNode("pos_long").getValue()); + #ident = "(T/D)"; } coords = geo.Coord.new(); @@ -189,6 +194,34 @@ var SimbriefParser = { fmgc.flightPlanController.flightplans[3].star = _star; } fmgc.flightPlanController.destroyTemporaryFlightPlan(3, 1); + + #var idx = 1; + #var plan = fmgc.flightPlanController.flightplans[2]; + #var altitude = ""; + #var speed = ""; + #var wpname = ""; + + #foreach (var ofpFix; ofpFixes) { + # ident = ofpFix.getNode("ident").getValue(); + + # if (ident == "TOC") wpname = "(T/C)"; + # else if (ident == "TOD") wpname = "(T/D)"; + # else wpname = ident; + + # wp = plan.getWP(idx); # get leg + # if (wp != nil) { + # if (wp.wp_name == wpname) { + # altitude = ofpFix.getNode("altitude_feet").getValue(); + # speed = ofpFix.getNode("ind_airspeed").getValue(); + + # if (speed>0) wp.setSpeed(speed, "computed"); + # if (altitude>0) wp.setAltitude(math.round(altitude, 10), "computed"); +# +# idx = idx + 1; +# } +# } +# } + fmgc.windController.updatePlans(); fmgc.updateRouteManagerAlt(); @@ -199,6 +232,8 @@ var SimbriefParser = { if (me.buildFlightplan() == nil) { return nil; } + fmgc.FMGCInternal.coRoute = "SB" ~ me.OFP.getNode("origin/iata_code").getValue() ~ me.OFP.getNode("destination/iata_code").getValue() ~ "00"; + fmgc.FMGCInternal.coRouteSet = 1; fmgc.FMGCInternal.flightNum = (me.OFP.getNode("general/icao_airline").getValue() or "") ~ (me.OFP.getNode("general/flight_number").getValue() or ""); fmgc.FMGCInternal.flightNumSet = 1; fmgc.FMGCInternal.costIndex = me.OFP.getNode("general/costindex").getValue(); diff --git a/Nasal/FMGC/mcdu-messages.nas b/Nasal/FMGC/mcdu-messages.nas index 8ac87b43..f741725c 100644 --- a/Nasal/FMGC/mcdu-messages.nas +++ b/Nasal/FMGC/mcdu-messages.nas @@ -69,6 +69,7 @@ var scratchpadController = { sp.scratchpadColour = "wht"; sp.showTypeIMsg = 0; sp.showTypeIIMsg = 0; + sp.clrmode = 0; # 1 = CLR mode sp.mcdu = mcdu; return sp; }, @@ -88,6 +89,11 @@ var scratchpadController = { me.clearTypeI(); } + if (me.clrmode == 1) { # prevent add chars in CLR mode + me.clear(); + } + else if (character == "CLR") me.clrmode = 1; + me.scratchpad = me.scratchpad ~ character; me.scratchpadColour = "wht"; me.update(); @@ -140,6 +146,7 @@ var scratchpadController = { }, empty: func() { me.scratchpad = ""; + me.clrmode = 0; me.update(); }, clear: func() { diff --git a/Nasal/MCDU/F-PLN.nas b/Nasal/MCDU/F-PLN.nas index f086d6fd..f3cab9a5 100644 --- a/Nasal/MCDU/F-PLN.nas +++ b/Nasal/MCDU/F-PLN.nas @@ -68,9 +68,21 @@ var fplnItem = { me.spd = me.getSpd(); me.alt = me.getAlt(); me.dist = me.getDist(); - me._colour = "wht"; - if (me.spd[1] != "wht" or me.alt[1] != "wht") { - me._colour = "mag"; + if (me.colour != "yel") { # not temporary flightplan + me._colour = "wht"; + #if (me.spd[1] != "wht" or me.alt[1] != "wht") { + if (me.spd[1] == me.alt[1]) { + me._colour = me.spd[1]; + } + else if (me.spd[1] == "mag" or me.alt[1] == "mag") { + me._colour = "mag"; + } + else if (me.spd[1] == "grn" or me.alt[1] == "grn") { + me._colour = "grn"; + } + + } else { # temporary flightplan + me._colour = "yel"; } return [me.spd[0] ~ "/" ~ me.alt[0], " " ~ me.dist ~ "NM ", me._colour]; } else { @@ -95,23 +107,25 @@ var fplnItem = { }, getSpd: func() { if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.FMGCInternal.v1set) { - return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "mag"]; - } elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr != 0) { - return [sprintf("%3.0f", me.wp.speed_cstr), "mag"]; + return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "grn"]; # why "mag"? I think "grn" + } elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr > 0) { + var tcol = (me.wp.speed_cstr_type == "computed" or me.wp.speed_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed + return [sprintf("%3.0f", me.wp.speed_cstr), tcol]; } else { return ["---", "wht"]; } }, getAlt: func() { if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.flightPlanController.flightplans[me.plan].departure != nil) { - return [" " ~ sprintf("%-5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "mag"]; + return [" " ~ sprintf("%5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "grn"]; #fixed - aligned to right } elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) { return [" " ~ fmgc.flightPlanController.fromWptAlt, "mag"]; - } elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr != 0) { + } elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr > 0) { + var tcol = (me.wp.alt_cstr_type == "computed" or me.wp.alt_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) { - return [" " ~ sprintf("%-5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), "mag"]; + return [" " ~ sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), tcol]; #fixed - aligned to right } else { - return [" " ~ sprintf("%-5.0f", me.wp.alt_cstr), "mag"]; + return [" " ~ sprintf("%5.0f", me.wp.alt_cstr), tcol]; #fixed - aligned to right } } else { return ["------", "wht"]; @@ -337,7 +351,7 @@ var fplnPage = { # this one is only created once, and then updated - remember th if (size(me.outputList) >= 1) { me.L1 = me.outputList[0].updateLeftText(); me.C1 = me.outputList[0].updateCenterText(); - me.C1[1] = "TIME "; + me.C1[1] = (fmgc.flightPlanController.fromWptTime != nil) ? "UTC " : "TIME "; # since TO change to UTC time (1 space left to center) me.R1 = me.outputList[0].updateRightText(); me.R1[1] = "SPD/ALT "; } else { diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index e734af23..00e02637 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -5,7 +5,40 @@ var initInputA = func(key, i) { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; - if (key == "L2") { + if (key == "L1") { #clear coRoute if set + if (scratchpad == "CLR") { + if (fmgc.FMGCInternal.coRouteSet == 1) { + fmgc.FMGCInternal.coRouteSet = 0; + fmgc.FMGCInternal.coRoute = ""; + fmgc.FMGCInternal.depApt = ""; + fmgc.FMGCInternal.arrApt = ""; + fmgc.FMGCInternal.toFromSet = 0; + fmgc.FMGCNodes.toFromSet.setValue(0); + fmgc.windController.resetDesWinds(); + setprop("/FMGC/internal/align-ref-lat", 0); + setprop("/FMGC/internal/align-ref-long", 0); + setprop("/FMGC/internal/align-ref-lat-edit", 0); + setprop("/FMGC/internal/align-ref-long-edit", 0); + if (fmgc.FMGCInternal.blockConfirmed) { + fmgc.FMGCInternal.fuelCalculating = 0; + fmgc.fuelCalculating.setValue(0); + fmgc.FMGCInternal.fuelCalculating = 1; + fmgc.fuelCalculating.setValue(1); + } + fmgc.flightPlanController.reset(2); + fmgc.flightPlanController.init(); + Simbrief.SimbriefParser.inhibit = 0; + } + mcdu_scratchpad.scratchpads[i].empty(); + } else { + var len = size(scratchpad); + if (fmgc.FMGCInternal.coRouteSet == 1 or len != 10) { + mcdu_message(i, "NOT ALLOWED"); + } else { + mcdu_message(i, "NOT IN DATA BASE"); # fake message - TODO flightplan loader + } + } + } else if (key == "L2") { if (scratchpad == "CLR") { fmgc.FMGCInternal.altAirport = ""; fmgc.FMGCInternal.altAirportSet = 0; @@ -183,7 +216,10 @@ var initInputA = func(key, i) { } } } else if (key == "R1") { - if (scratchpad == "CLR") { + if (fmgc.FMGCInternal.coRouteSet == 1) { + mcdu_message(i, "NOT ALLOWED"); + } + else if (scratchpad == "CLR") { fmgc.FMGCInternal.depApt = ""; fmgc.FMGCInternal.arrApt = ""; fmgc.FMGCInternal.toFromSet = 0; diff --git a/Nasal/MCDU/PERFTO.nas b/Nasal/MCDU/PERFTO.nas index fc0d92dc..d4cdcd29 100644 --- a/Nasal/MCDU/PERFTO.nas +++ b/Nasal/MCDU/PERFTO.nas @@ -3,6 +3,22 @@ # Copyright (c) 2020 Josh Davidson (Octal450) # Copyright (c) 2020 Matthew Maring (mattmaring) +# VMCA 109.5 at 0ft +# VMCG 106.5 at 0ft all conf + +var standard_VMCA = 109.5; # TODO calculate VMCA/VMCG on altitude (ft) of departure airport (read below) +var standard_VMCG = 106.5; + +# TODO - DepArp elevation or current elevation (on ground only!!) -> math.round(fmgc.flightPlanController.flightplans[2].departure.elevation * M2FT)) + +var perfTOCheckVSpeeds = func(i) { + if (fmgc.FMGCInternal.v1set == 1 and fmgc.FMGCInternal.vrset == 1 and fmgc.FMGCInternal.v2set == 1) { # only when v1/vr/v2 all sets + if (fmgc.FMGCInternal.v1>fmgc.FMGCInternal.vr or fmgc.FMGCInternal.vr > fmgc.FMGCInternal.v2) mcdu_messageTypeII(i,"V1/VR/V2 DISAGREE"); + else if (fmgc.FMGCInternal.v1= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) { - setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10); - setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10); - setprop("MCDUC/thracc-set", 1); - mcdu_scratchpad.scratchpads[i].empty(); + + if (thrred<=acc) { # validation + setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10); + setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10); + setprop("MCDUC/thracc-set", 1); + mcdu_scratchpad.scratchpads[i].empty(); + } else { + mcdu_message(i, "NOT ALLOWED"); + } } else if (thrreds == 0 and int(acc) != nil and (accs >= 3 and accs <= 5) and acc >= 400 and acc <= 39000) { setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10); mcdu_scratchpad.scratchpads[i].empty(); From 6a5ce3bf7d1e980a5fba55643fd5020d4f1592c6 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 31 Dec 2020 20:12:40 +0000 Subject: [PATCH 2/4] Improve abort button: move to a better location; always set cold + dark --- AircraftConfig/acconfig.nas | 21 ++++++++++++++++----- AircraftConfig/psload.xml | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 72b5dfaf..c4c12d7a 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -310,7 +310,6 @@ var colddark = func { } } var colddark_b = func { - if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted # Continues the Cold and Dark script, after engines fully shutdown. setprop("/controls/apu/master", 0); settimer(func { @@ -361,7 +360,10 @@ var beforestart = func { } } var beforestart_b = func { - if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted + if (getprop("/systems/acconfig/autoconfig-running") == 0) { + colddark(); + return 0; # auto-config aborted + } # Continue with engine start prep. systems.FUEL.Switches.pumpLeft1.setValue(1); systems.FUEL.Switches.pumpLeft2.setValue(1); @@ -449,7 +451,10 @@ var taxi = func { } } var taxi_b = func { - if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted + if (getprop("/systems/acconfig/autoconfig-running") == 0) { + colddark(); + return 0; # auto-config aborted + } # Continue with engine start prep, and start engines. systems.FUEL.Switches.pumpLeft1.setValue(1); systems.FUEL.Switches.pumpLeft2.setValue(1); @@ -503,7 +508,10 @@ var taxi_b = func { settimer(taxi_c, 2); } var taxi_c = func { - if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted + if (getprop("/systems/acconfig/autoconfig-running") == 0) { + colddark(); + return 0; # auto-config aborted + } setprop("/controls/engines/engine-start-switch", 2); setprop("/controls/engines/engine[0]/cutoff-switch", 0); setprop("/controls/engines/engine[1]/cutoff-switch", 0); @@ -512,7 +520,10 @@ var taxi_c = func { }, 10); } var taxi_d = func { - if (getprop("/systems/acconfig/autoconfig-running") == 0) return 0; # auto-config aborted + if (getprop("/systems/acconfig/autoconfig-running") == 0) { + colddark(); + return 0; # auto-config aborted + } # After Start items. setprop("/controls/engines/engine-start-switch", 1); setprop("/controls/apu/master", 0); diff --git a/AircraftConfig/psload.xml b/AircraftConfig/psload.xml index fd7f9e19..64cb9823 100644 --- a/AircraftConfig/psload.xml +++ b/AircraftConfig/psload.xml @@ -15,6 +15,16 @@ left + @@ -36,17 +46,7 @@ center /systems/acconfig/spin 1 - - + From 0161ebf9406b1649145cc8b5abfa7b94114b95bd Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 31 Dec 2020 20:29:04 +0000 Subject: [PATCH 3/4] As the Simbrief element is representing the AOC rather than CO RTE, its not correct to set a CO RTE. But I'll leave the code there for future CO RTE support. --- Nasal/FMGC/SimbriefParser.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/FMGC/SimbriefParser.nas b/Nasal/FMGC/SimbriefParser.nas index 1c2a0d07..1dc01602 100644 --- a/Nasal/FMGC/SimbriefParser.nas +++ b/Nasal/FMGC/SimbriefParser.nas @@ -232,8 +232,8 @@ var SimbriefParser = { if (me.buildFlightplan() == nil) { return nil; } - fmgc.FMGCInternal.coRoute = "SB" ~ me.OFP.getNode("origin/iata_code").getValue() ~ me.OFP.getNode("destination/iata_code").getValue() ~ "00"; - fmgc.FMGCInternal.coRouteSet = 1; + #fmgc.FMGCInternal.coRoute = "SB" ~ me.OFP.getNode("origin/iata_code").getValue() ~ me.OFP.getNode("destination/iata_code").getValue() ~ "00"; + #fmgc.FMGCInternal.coRouteSet = 1; fmgc.FMGCInternal.flightNum = (me.OFP.getNode("general/icao_airline").getValue() or "") ~ (me.OFP.getNode("general/flight_number").getValue() or ""); fmgc.FMGCInternal.flightNumSet = 1; fmgc.FMGCInternal.costIndex = me.OFP.getNode("general/costindex").getValue(); From 79b8a8fc749a1455a3635482d261b509428fba1b Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 31 Dec 2020 20:44:26 +0000 Subject: [PATCH 4/4] Restore missing file. Correct per pilot reference -- the Thales behaves slightly differently --- Models/Instruments/MCDU/MCDU.nas | 16 +++------------ Nasal/MCDU/MCDU.nas | 35 ++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index b90bd043..c9949948 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -155,8 +155,6 @@ var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode 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)]; -var reqFMGC = [0,0]; # flag = 1 when REQ is show - # Conversion factor pounds to kilogram var LBS2KGS = 0.4535924; @@ -503,16 +501,10 @@ var canvas_MCDU_base = { pageSwitch[i].setBoolValue(1); } - if (active[i].getValue() == 0 and reqFMGC[i] == 0) { + if (active[i].getValue() == 0) { me["Simple_L1"].setText(" FMGC"); - me["Simple_L1"].setColor(GREEN); - me["Simple_L1_Arrow"].setColor(GREEN); - reqFMGC[i] = 1; - settimer(func { - if (active[i].getValue() == 0) { - me["Simple_L1"].setText(" FMGC (REQ)"); - } - },1.4); #delay estimated + me["Simple_L1"].setColor(WHITE); + me["Simple_L1_Arrow"].setColor(WHITE); } else if (active[i].getValue() == 1) { me["Simple_L1"].setText(" FMGC (SEL)"); me["Simple_L1"].setColor(BLUE); @@ -5994,8 +5986,6 @@ setlistener("sim/signals/fdm-initialized", func { mcdu.mcdu_message(0, "SELECT DESIRED SYSTEM"); mcdu.mcdu_message(1, "SELECT DESIRED SYSTEM"); - - reqFMGC = [0,0]; # reset FMGC REQ status - on MCDU restart MCDU_update.start(); }); diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index f4bfac92..7650653f 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -75,6 +75,8 @@ var MCDU_reset = func(i) { fmgc.FMGCInternal.gndTempSet = 0; fmgc.FMGCInternal.toFromSet = 0; fmgc.FMGCNodes.toFromSet.setValue(0); + fmgc.FMGCInternal.coRoute = ""; + fmgc.FMGCInternal.coRouteSet = 0; fmgc.FMGCInternal.tropo = 36090; fmgc.FMGCInternal.tropoSet = 0; @@ -1484,7 +1486,9 @@ var pagebutton = func(btn, i) { } } -var button = func(btn, i) { +var buttonCLRDown = [0,0]; # counter for down event + +var button = func(btn, i, event = "") { page = pageNode[i].getValue(); if (page != "MCDU") { var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; @@ -1493,11 +1497,24 @@ var button = func(btn, i) { } else if (btn == "SP") { mcdu_scratchpad.scratchpads[i].addChar(" "); } else if (btn == "CLR") { - var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; - if (size(scratchpad) == 0) { - mcdu_scratchpad.scratchpads[i].addChar("CLR"); - } else { - mcdu_scratchpad.scratchpads[i].clear(); + if (event == "down") { + if (size(scratchpad) > 0) { + if (buttonCLRDown[i] > 4) { + mcdu_scratchpad.scratchpads[i].empty(); + } + buttonCLRDown[i] = buttonCLRDown[i] + 1; + } + } + else if (event == "" or buttonCLRDown[i]<=4) { + buttonCLRDown[i] = 0; + #var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; <- useless?? + if (size(scratchpad) == 0) { + mcdu_scratchpad.scratchpads[i].addChar("CLR"); + } else { + mcdu_scratchpad.scratchpads[i].clear(); + } + } else { # up with buttonCLRDown[i]>4 + buttonCLRDown[i] = 0; } } else if (btn == "DOT") { mcdu_scratchpad.scratchpads[i].addChar("."); @@ -1514,6 +1531,12 @@ var mcdu_message = func(i, string, overrideStr = "") { mcdu_scratchpad.scratchpads[i].override(overrideStr); } +# Messagge Type II - TODO 5 messages queue - remove only on resolve +var mcdu_messageTypeII = func(i, string, overrideStr = "") { + mcdu_scratchpad.scratchpads[i].showTypeII(mcdu_scratchpad.MessageController.getTypeIIMsgByText(string)); + mcdu_scratchpad.scratchpads[i].override(overrideStr); +} + var screenFlash = func(time, i) { page = pageNode[i].getValue(); pageNode[i].setValue("NONE");