diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 1c3d63e2..a51de4ee 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -3083,6 +3083,10 @@ 0 1 + + nasal + + @@ -3447,6 +3451,10 @@ property-toggle modes/pfd/ILS1 + + nasal + + @@ -3482,6 +3490,10 @@ property-toggle modes/pfd/ILS2 + + nasal + + @@ -3554,9 +3566,12 @@ } else { fcu.cpt_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3596,9 +3611,12 @@ } else { fcu.fo_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3638,9 +3656,12 @@ } else { fcu.cpt_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3680,9 +3701,12 @@ } else { fcu.fo_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3722,9 +3746,12 @@ } else { fcu.cpt_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3764,9 +3791,12 @@ } else { fcu.fo_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3806,9 +3836,12 @@ } else { fcu.cpt_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3848,9 +3881,12 @@ } else { fcu.fo_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3890,9 +3926,12 @@ } else { fcu.cpt_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -3932,9 +3971,12 @@ } else { fcu.fo_efis_btns("off"); } - setprop("sim/sounde/btn1", 1); + + nasal + + @@ -4121,6 +4163,10 @@ 1 -1 + + nasal + + @@ -4132,6 +4178,10 @@ 1 0 + + nasal + + @@ -4161,6 +4211,10 @@ 1 -1 + + nasal + + @@ -4172,6 +4226,10 @@ 1 0 + + nasal + + @@ -4201,6 +4259,10 @@ 1 -1 + + nasal + + @@ -4212,6 +4274,10 @@ 1 0 + + nasal + + @@ -4241,6 +4307,10 @@ 1 -1 + + nasal + + @@ -4252,6 +4322,10 @@ 1 0 + + nasal + + @@ -6675,6 +6749,10 @@ } + + nasal + + @@ -6709,6 +6787,10 @@ } + + nasal + + @@ -9279,10 +9361,14 @@ 1 2 + + nasal + + - + pick chrono_fo @@ -9296,6 +9382,10 @@ 1 2 + + nasal + + diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index 50bde335..bbd12960 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -222,6 +222,7 @@ var canvas_ND_1 = { # here we make the ND: me.NDCpt = ND.new("/instrumentation/efis", myCockpit_switches, "Airbus"); me.NDCpt.attitude_heading_setting = -1; + me.NDCpt.number = 0; me.NDCpt.adirs_property = props.globals.getNode("/instrumentation/efis[0]/nd/ir-1",1); me.NDCpt.newMFD(canvas_group); me.NDCpt.change_phase = 0; @@ -247,6 +248,7 @@ var canvas_ND_2 = { myCockpit_switches["ADIRS"]= {path: "/nd/ir-2", value: 0, type: "BOOL"}; me.NDFo = ND.new("/instrumentation/efis[1]", myCockpit_switches, "Airbus"); me.NDFo.attitude_heading_setting = 1; + me.NDFo.number = 1; me.NDFo.adirs_property = props.globals.getNode("/instrumentation/efis[1]/nd/ir-2",1); me.NDFo.newMFD(canvas_group); me.NDFo.change_phase = 0; diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index dfcae892..d945a620 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -707,18 +707,33 @@ canvas.NDStyles["Airbus"] = { id: "nd_warn_memo", impl: { init: func(nd, symbol), - predicate: ALWAYS, - is_true: func(nd) nd.symbols.nd_warn_memo.hide(), - is_false: func(nd), + predicate: func(nd) { + (!systems.ADIRS.Operating.aligned[0].getBoolValue() and !systems.ADIRS.Operating.aligned[1].getBoolValue() and !systems.ADIRS.Operating.aligned[2].getBoolValue()) + or (mcdu_scratchpad.scratchpads[nd.number].showTypeIIMsg and mcdu_scratchpad.scratchpads[nd.number].scratchpad == "GPS PRIMARY") + }, + is_true: func(nd) { + nd.symbols.nd_warn_memo.show(); + if (mcdu_scratchpad.scratchpads[nd.number].showTypeIIMsg and mcdu_scratchpad.scratchpads[nd.number].scratchpad == "GPS PRIMARY") { + nd.symbols.nd_warn_memo.setText("GPS PRIMARY"); + nd.symbols.nd_warn_memo.setColor(0.8078,0.8039,0.8078); + } else { + nd.symbols.nd_warn_memo.setText("GPS PRIMARY LOST"); + nd.symbols.nd_warn_memo.setColor(0.7333,0.3803,0); + } + }, + is_false: func(nd) nd.symbols.nd_warn_memo.hide(), }, }, { id: "nd_warn_msgbox", impl: { init: func(nd, symbol), - predicate: ALWAYS, - is_true: func(nd) nd.symbols.nd_warn_msgbox.hide(), - is_false: func(nd), + predicate: func(nd) { + (!systems.ADIRS.Operating.aligned[0].getBoolValue() and !systems.ADIRS.Operating.aligned[1].getBoolValue() and !systems.ADIRS.Operating.aligned[2].getBoolValue()) + or (mcdu_scratchpad.scratchpads[nd.number].showTypeIIMsg and mcdu_scratchpad.scratchpads[nd.number].scratchpad == "GPS PRIMARY") + }, + is_true: func(nd) nd.symbols.nd_warn_msgbox.show(), + is_false: func(nd) nd.symbols.nd_warn_msgbox.hide(), }, }, { diff --git a/Nasal/FMGC/mcdu-messages.nas b/Nasal/FMGC/mcdu-messages.nas index cd5058a7..9ffecb1b 100644 --- a/Nasal/FMGC/mcdu-messages.nas +++ b/Nasal/FMGC/mcdu-messages.nas @@ -47,6 +47,13 @@ var MessageQueueController = { me.messages.pop(index); } }, + deleteWithText: func(text) { + foreach (var message; me.messages.vector) { + if (message.msgText == text) { + me.messages.remove(message); + } + } + }, clearQueue: func() { me.messages.clear(); }, @@ -190,6 +197,7 @@ var MessageController = { TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0), TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0), TypeIIMessage.new("CHECK DEST DATA", "amb", 0), #p.533 + TypeIIMessage.new("GPS PRIMARY"),TypeIIMessage.new("GPS PRIMARY LOST", "amb", 0), ]), # to speed to low - new on a320, margin against vmcg / vs1g @@ -202,7 +210,7 @@ var MessageController = { }, getMsgByText: func(text, theVector) { foreach (var message; theVector) { - if (message.msgText = text) { + if (message.msgText == text) { return message; } } diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index 1a16be9b..3acb599a 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -217,14 +217,14 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/active", 1); settimer(func(){ pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); setprop("/MCDU[" ~ i ~ "]/active", 2); setprop("/MCDU[" ~ i ~ "]/active-system","fmgc"); }, 2); } else { pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page")); setprop("/MCDU[" ~ i ~ "]/active-system","fmgc"); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); } } } else if (page == "IRSINIT") { @@ -377,14 +377,14 @@ var lskbutton = func(btn, i) { setprop("/MCDU[" ~ i ~ "]/atsu-active", 1); settimer(func(){ pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); setprop("/MCDU[" ~ i ~ "]/atsu-active", 2); setprop("/MCDU[" ~ i ~ "]/active-system","atsu"); }, 2); } else { pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page")); setprop("/MCDU[" ~ i ~ "]/active-system","atsu"); - mcdu_scratchpad.scratchpads[i].empty(); + mcdu_scratchpad.scratchpads[i].clear(); } } } else if (page == "INITA") { diff --git a/Nasal/Systems/ADIRS/ADR.nas b/Nasal/Systems/ADIRS/ADR.nas index 43de30a9..2a84dffd 100644 --- a/Nasal/Systems/ADIRS/ADR.nas +++ b/Nasal/Systems/ADIRS/ADR.nas @@ -110,7 +110,6 @@ var ADIRU = { } }, stopAlignNoAlign: func() { - print("Stopping alignment or setting unaligned state"); me.inAlign = 0; me.aligned = 0; ADIRSnodesND[me.num].setValue(0); @@ -154,7 +153,6 @@ var ADIRU = { if (me._gs > 5 or abs(me._pitch) > 5 or abs(me._roll) > 10) { me.stopAlignNoAlign(); me._excessMotion = 1; - print("Excessive motion, restarting"); me.update(); # update operative me.align(calcAlignTime(pts.Position.latitude.getValue())); } elsif (me.operative == 0) { @@ -324,6 +322,8 @@ var ADIRS = { } ), ], + _hasGPSPrimLost: 0, + _hasGPSPrim: 0, loop: func(notification) { if (me._init) { for (i = 0; i < _NUMADIRU; i = i + 1) { @@ -345,8 +345,33 @@ var ADIRS = { me.Operating.adr[i].setValue(0); } } + + if (!me.Operating.aligned[0].getBoolValue() and !me.Operating.aligned[1].getBoolValue() and !me.Operating.aligned[2].getBoolValue()) { + if (!me._hasGPSPrimLost) { + mcdu_scratchpad.messageQueues[0].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY LOST")); + mcdu_scratchpad.messageQueues[1].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY LOST")); + me._hasGPSPrimLost = 1; + } + } else { + if (me._hasGPSPrimLost) { + mcdu_scratchpad.messageQueues[0].deleteWithText("GPS PRIMARY LOST"); + mcdu_scratchpad.messageQueues[1].deleteWithText("GPS PRIMARY LOST"); + me._hasGPSPrimLost = 0; + } + } + + if (me.Operating.aligned[0].getBoolValue() or me.Operating.aligned[1].getBoolValue() or me.Operating.aligned[2].getBoolValue()) { + if (!me._hasGPSPrim) { + mcdu_scratchpad.messageQueues[0].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY")); + mcdu_scratchpad.messageQueues[1].addNewMsg(mcdu_scratchpad.MessageController.getTypeIIMsgByText("GPS PRIMARY")); + me._hasGPSPrim = 1; + } + } else { + me._hasGPSPrim = 0; + } } + # Update VFE foreach (var update_item; me.update_items) { update_item.update(notification);