From 7527908d8e53d3114a47e822ec9066895573b570 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 01:05:41 +0100 Subject: [PATCH 01/10] Fix bug in LOC -- now can only be armed above 400 feet and if not in SRS mode --- Nasal/FMGC/FCU.nas | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 36b07a56..ba0df761 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -329,11 +329,13 @@ var FCUController = { fmgc.ITAF.disarmGS(); } } else { - latModeInput.setValue(2); - if (vertTemp == 2 or vertTemp == 6) { - me.VSPull(); - } else { - fmgc.ITAF.disarmGS(); + if (pts.Position.gearAglFt.getValue() >= 400 and vertTemp != 7) { + latModeInput.setValue(2); + if (vertTemp == 2 or vertTemp == 6) { + me.VSPull(); + } else { + fmgc.ITAF.disarmGS(); + } } } } From a6d278773cc40af84edd1bbd3f1f99d396994cb1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 12:32:26 +0100 Subject: [PATCH 02/10] Same fix for APPR --- Nasal/FMGC/FCU.nas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index ba0df761..7c9d1b60 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -467,7 +467,9 @@ var FCUController = { fmgc.ITAF.disarmGS(); } } else { - vertModeInput.setValue(2); + if (pts.Position.gearAglFt.getValue() >= 400 and vertTemp != 7) { + vertModeInput.setValue(2); + } } } }, From 5cd3331f704df102868e463f27168902f1642821 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 17:00:10 +0100 Subject: [PATCH 03/10] Rudder Travel Limiter --- A320-main.xml | 8 +- AircraftConfig/acconfig.nas | 4 +- AircraftConfig/fail.xml | 20 +++++ Nasal/ECAM/ECAM-controller.nas | 3 + Nasal/ECAM/ECAM-logic.nas | 24 +++++- Nasal/ECAM/ECAM-messages.nas | 7 ++ Systems/a320-fbw.xml | 120 +++++++++++++++++++++----- Systems/a320-fcs.xml | 15 ++-- Systems/a320-fmgc.xml | 152 ++++++++++++++++++++++++--------- Systems/a320-fwc.xml | 48 +++++++++++ 10 files changed, 328 insertions(+), 73 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index c263dea4..2b7b9e8c 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -536,6 +536,11 @@ + + + 25 + + 0 @@ -1115,6 +1120,8 @@ 0 0 0 + 0 + 0 0 @@ -1159,7 +1166,6 @@ 0 0 - 0 0 0 diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index b2adcb55..1699b07e 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -33,11 +33,12 @@ var failResetOld = func { setprop("/systems/failures/fctl/sec3", 0); setprop("/systems/failures/fctl/fac1", 0); setprop("/systems/failures/fctl/fac2", 0); + setprop("/systems/failures/fctl/rtlu-1", 0); + setprop("/systems/failures/fctl/rtlu-2", 0); setprop("/systems/failures/aileron-left", 0); setprop("/systems/failures/aileron-right", 0); setprop("/systems/failures/elevator-left", 0); setprop("/systems/failures/elevator-right", 0); - setprop("/systems/failures/rudder", 0); setprop("/systems/failures/spoilers/spoiler-l1", 0); setprop("/systems/failures/spoilers/spoiler-l2", 0); setprop("/systems/failures/spoilers/spoiler-l3", 0); @@ -51,7 +52,6 @@ var failResetOld = func { setprop("/systems/failures/hyd-blue", 0); setprop("/systems/failures/hyd-green", 0); setprop("/systems/failures/hyd-yellow", 0); - setprop("/systems/failures/ptu", 0); setprop("/systems/failures/pump-blue", 0); setprop("/systems/failures/pump-green", 0); setprop("/systems/failures/pump-yellow-eng", 0); diff --git a/AircraftConfig/fail.xml b/AircraftConfig/fail.xml index e62ed8f4..10c0d55c 100644 --- a/AircraftConfig/fail.xml +++ b/AircraftConfig/fail.xml @@ -124,6 +124,26 @@ true + + + left + /systems/failures/fctl/rtlu-1 + + dialog-apply + + true + + + + + left + /systems/failures/fctl/rtlu-2 + + dialog-apply + + true + + hbox diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index f137a0d4..a0e16d81 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -52,6 +52,9 @@ var warningNodes = { pack1ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-1-switch-cmd"), pack2ResetPb: props.globals.initNode("/ECAM/warnings/logic/reset-pack-2-switch-cmd"), cabinFans: props.globals.initNode("/ECAM/warnings/logic/cabin-fans-fault"), + rtlu1Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-1-fault"), + rtlu2Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-2-fault"), + rtlu12Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-fault"), }, Timers: { apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index f183a636..24682d51 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1173,12 +1173,34 @@ var messages_priority_2 = func { } - if (getprop("instrumentation/tcas/serviceable") == 0 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 7 and systems.ELEC.Bus.ac1.getValue() and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) { + if (getprop("instrumentation/tcas/serviceable") == 0 and phaseVar2 != 3 and phaseVar2 != 4 and phaseVar2 != 7 and systems.ELEC.Bus.ac1.getValue() >= 110 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) { tcasFault.active = 1; } else { ECAM_controller.warningReset(tcasFault); } + if (rudTravLimSysFault.clearFlag == 0 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and warningNodes.Logic.rtlu12Fault.getBoolValue()) { + rudTravLimSysFault.active = 1; + rudTravLimSysFaultRud.active = 1; + rudTravLimSysFaultFac.active = 1; + } else { + ECAM_controller.warningReset(rudTravLimSysFault); + ECAM_controller.warningReset(rudTravLimSysFaultRud); + ECAM_controller.warningReset(rudTravLimSysFaultFac); + } + + if (rudTravLimSys1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Logic.rtlu1Fault.getBoolValue()) { + rudTravLimSys1Fault.active = 1; + } else { + ECAM_controller.warningReset(rudTravLimSys1Fault); + } + + if (rudTravLimSys2Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Logic.rtlu2Fault.getBoolValue()) { + rudTravLimSys2Fault.active = 1; + } else { + ECAM_controller.warningReset(rudTravLimSys2Fault); + } + if (fcu.FCUController.FCU1.failed and fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and fcuFault.clearFlag == 0) { fcuFault.active = 1; fcuFaultBaro.active = 1; diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index b6b13171..f020e0df 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -226,6 +226,13 @@ var warnings = std.Vector.new([ # TCAS FAULT var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + # Rudder Travel Limiter + var rudTravLimSysFault = warning.new(msg: "AUTO FLT RUD TRV LIM SYS", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var rudTravLimSysFaultRud = warning.new(msg: "RUD WITH CARE ABV 160 KT", colour: "c", aural: 1, light: 1), + var rudTravLimSysFaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c", aural: 1, light: 1), + var rudTravLimSys1Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 1", colour: "a", isMainMsg: 1), + var rudTravLimSys2Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 2", colour: "a", isMainMsg: 1), + # FCU fault var fcuFault = warning.new(msg: "AUTO FLT FCU 1+2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), var fcuFaultBaro = warning.new(msg: " -PFD BARO REF: STD ONLY", colour: "c"), diff --git a/Systems/a320-fbw.xml b/Systems/a320-fbw.xml index a61b34d3..6035e7da 100644 --- a/Systems/a320-fbw.xml +++ b/Systems/a320-fbw.xml @@ -380,14 +380,6 @@ - - - - /systems/fctl/fac1 eq 0 - /systems/fctl/fac2 eq 0 - - - @@ -1315,10 +1307,10 @@ - + - velocities/vc-kts + /systems/fmgc/active-airspeed-1 160 25.0 410 3.5 @@ -1327,21 +1319,107 @@ - - - + + +
+ /systems/fmgc/active-airspeed-2 + + 160 25.0 + 410 3.5 + +
+
+
+ + + + + /systems/failures/fctl/rtlu-1 eq 0 + /systems/electrical/bus/dc-ess ge 25 /systems/fctl/fac1 eq 1 - /systems/fctl/fac2 eq 1 - /gear/gear[1]/wow eq 0 - /gear/gear[2]/wow eq 0 - - - /controls/flight/flaps eq 0 - /gear/gear[1]/wow eq 0 - /gear/gear[2]/wow eq 0 + + + /systems/fmgc/cas-compare/cas-reject-1 eq 0 + /systems/navigation/adr/operating-1 eq 1 + + + /systems/fmgc/cas-compare/cas-reject-3 eq 0 + /systems/navigation/adr/operating-3 eq 1 + + + + + + /systems/failures/fctl/rtlu-2 eq 0 + /systems/electrical/bus/dc-2 ge 25 + /systems/fctl/fac2 eq 1 + + + /systems/fmgc/cas-compare/cas-reject-2 eq 0 + /systems/navigation/adr/operating-2 eq 1 + + + /systems/fmgc/cas-compare/cas-reject-3 eq 0 + /systems/navigation/adr/operating-3 eq 1 + + + + + + + + + /systems/fctl/fac1-rtlu-avail eq 0 + /systems/fctl/fac2-rtlu-avail eq 0 + fcs/slat-pos-deg ne 0 + + + + + + + /systems/fctl/fac1-rtlu-avail eq 0 + /systems/fctl/fac2-rtlu-avail eq 0 + fcs/slat-pos-deg eq 0 + + + fbw/yaw/rtlu-emergency eq 1 + + + /systems/fctl/fac1-rtlu-avail eq 1 + + + /systems/fctl/fac2-rtlu-avail eq 1 + + + + + + + + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/dc-2 ge 25 + + fbw/yaw/rtlu-emergency ne 1 + + + /systems/electrical/bus/ac-ess-26v ge 24.8 + /systems/fctl/fac1-rtlu-avail eq 0 + /systems/fctl/fac2-rtlu-avail eq 0 + fcs/slat-pos-deg ne 0 + fbw/yaw/max-deg-switch ne fbw/yaw/max-deg-switch-cmd + + + + + fbw/yaw/max-deg-switch-cmd + fbw/yaw/rtlu-power + fbw/yaw/max-deg-switch + + fbw/yaw/max-deg-switch diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml index 85fa3186..c1abb138 100644 --- a/Systems/a320-fcs.xml +++ b/Systems/a320-fcs.xml @@ -356,11 +356,7 @@ - - - hydraulics/rudder/pressure-switch-or eq 1 - /systems/failures/rudder eq 0 - + fbw/yaw/max-deg-scale-neg fbw/yaw/max-deg-scale @@ -372,9 +368,16 @@ 25 + + + + hydraulics/rudder/pressure-switch-or eq 0 + + + hydraulics/rudder/cmd-deg - 80 + hydraulics/rudder/rate 25.5 hydraulics/rudder/final-deg diff --git a/Systems/a320-fmgc.xml b/Systems/a320-fmgc.xml index 93919e38..cb4bc86a 100644 --- a/Systems/a320-fmgc.xml +++ b/Systems/a320-fmgc.xml @@ -65,20 +65,34 @@ - - - /systems/fmgc/cas-compare/cas-1-to-3 - 5 - - - /systems/fmgc/cas-compare/cas-2-to-1 - 5 - - - /systems/fmgc/cas-compare/cas-2-to-3 - 5 - - + + + /systems/navigation/adr/operating-1 + 0 + + + + /systems/fmgc/cas-compare/cas-1-to-3 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-1 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-3 + 5 + + + /systems/navigation/adr/operating-2 + 1 + + + /systems/navigation/adr/operating-3 + 1 + + + 1 0 @@ -88,20 +102,34 @@ - - - /systems/fmgc/cas-compare/cas-2-to-3 - 5 - - - /systems/fmgc/cas-compare/cas-2-to-1 - 5 - - - /systems/fmgc/cas-compare/cas-1-to-3 - 5 - - + + + /systems/navigation/adr/operating-2 + 0 + + + + /systems/fmgc/cas-compare/cas-1-to-3 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-1 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-3 + 5 + + + /systems/navigation/adr/operating-1 + 1 + + + /systems/navigation/adr/operating-3 + 1 + + + 1 0 @@ -111,20 +139,34 @@ - - - /systems/fmgc/cas-compare/cas-1-to-3 - 5 - - - /systems/fmgc/cas-compare/cas-2-to-3 - 5 - - - /systems/fmgc/cas-compare/cas-2-to-1 - 5 - - + + + /systems/navigation/adr/operating-3 + 0 + + + + /systems/fmgc/cas-compare/cas-1-to-3 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-1 + 5 + + + /systems/fmgc/cas-compare/cas-2-to-3 + 5 + + + /systems/navigation/adr/operating-1 + 1 + + + /systems/navigation/adr/operating-2 + 1 + + + 1 0 @@ -144,6 +186,19 @@ + + + + + /systems/fmgc/active-airspeed-src-1 + 1 + + /systems/navigation/adr/output/cas-1 + /systems/navigation/adr/output/cas-3 + + + + @@ -156,6 +211,19 @@ + + + + + + /systems/fmgc/active-airspeed-src-2 + 2 + + /systems/navigation/adr/output/cas-2 + /systems/navigation/adr/output/cas-3 + + +
diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 07efd1f1..e3533870 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -1230,6 +1230,54 @@ /systems/electrical/bus/ac-2 ge 110 + + + + + /systems/navigation/adr/operating-1 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/ac-1 ge 110 + /systems/fctl/fac1-rtlu-avail eq 0 + /systems/fctl/fac1 eq 1 + + + + + + + /systems/navigation/adr/operating-2 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-2 ge 25 + /systems/electrical/bus/ac-2 ge 110 + /systems/fctl/fac2-rtlu-avail eq 0 + /systems/fctl/fac2 eq 1 + + + + + + + /ECAM/warnings/logic/rud-trav-lim-sys-1-fault-cmd eq 1 + /ECAM/warnings/logic/rud-trav-lim-sys-2-fault-cmd eq 1 + + + + + + + /ECAM/warnings/logic/rud-trav-lim-sys-1-fault-cmd eq 1 + /ECAM/warnings/logic/rud-trav-lim-sys-fault eq 0 + + + + + + + /ECAM/warnings/logic/rud-trav-lim-sys-2-fault-cmd eq 1 + /ECAM/warnings/logic/rud-trav-lim-sys-fault eq 0 + +
From 7794dca7150e33bd9c06f5aa2e9217af05f58392 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 19:33:18 +0100 Subject: [PATCH 04/10] Bugfix --- Nasal/ECAM/ECAM-logic.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 24682d51..08612fa1 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1189,13 +1189,13 @@ var messages_priority_2 = func { ECAM_controller.warningReset(rudTravLimSysFaultFac); } - if (rudTravLimSys1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Logic.rtlu1Fault.getBoolValue()) { + if (rudTravLimSys1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 >= 9 or phaseVar2 == 6) and warningNodes.Logic.rtlu1Fault.getBoolValue()) { rudTravLimSys1Fault.active = 1; } else { ECAM_controller.warningReset(rudTravLimSys1Fault); } - if (rudTravLimSys2Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar >= 9 or phaseVar == 6) and warningNodes.Logic.rtlu2Fault.getBoolValue()) { + if (rudTravLimSys2Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 >= 9 or phaseVar2 == 6) and warningNodes.Logic.rtlu2Fault.getBoolValue()) { rudTravLimSys2Fault.active = 1; } else { ECAM_controller.warningReset(rudTravLimSys2Fault); From 3e93cc772690465d240c5b29a3eed176f0e103e1 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 19:37:17 +0100 Subject: [PATCH 05/10] Fix logo lights --- Systems/a320-lights.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/a320-lights.xml b/Systems/a320-lights.xml index b988bc80..880ff302 100644 --- a/Systems/a320-lights.xml +++ b/Systems/a320-lights.xml @@ -139,7 +139,7 @@ /systems/electrical/bus/ac-2 ge 110 - /controls/flight/slats ge 0 + /controls/flight/slats-cmd ge 0 /gear/gear[2]/wow eq 1 From a28879577ced0a026a712433b459df9e5ed88cbf Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 16 Jul 2020 19:50:01 +0100 Subject: [PATCH 06/10] Revision of FBW degradation logic, rudder trim implemented to spec. Todo -- rudder trim should affect RTLU. Separate yaw law -- normal, alternate, and mechanical. --- A320-main.xml | 4 +- AircraftConfig/fbw.xml | 8 ++ Models/FlightDeck/a320.flightdeck.xml | 52 ++++++---- Nasal/FBW/it-fbw.nas | 88 ++++++++++++++--- Nasal/FMGC/FCU.nas | 2 + Nasal/Libraries/property-tree-setup.nas | 1 + Nasal/Panels/clock.nas | 126 +++++++++++++----------- Systems/a320-fbw.xml | 7 +- Systems/a320-fcs.xml | 35 ++++++- 9 files changed, 224 insertions(+), 99 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 2b7b9e8c..b306a60f 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -614,6 +614,8 @@ 0 0 0 + 0 + 0 33 0 0 @@ -910,7 +912,7 @@ 0.5 0.0 - 0 + 0 100000 0.0 0 diff --git a/AircraftConfig/fbw.xml b/AircraftConfig/fbw.xml index 7779f8fc..f7d3dac9 100644 --- a/AircraftConfig/fbw.xml +++ b/AircraftConfig/fbw.xml @@ -53,6 +53,8 @@ @@ -69,6 +71,8 @@ @@ -85,6 +89,8 @@ @@ -101,6 +107,8 @@ diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 74a8dcb2..59d09c5a 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -1157,16 +1157,22 @@ true - - - systems/electrical/bus/dc-ess - 25 - - - systems/electrical/bus/dc-2 - 25 - - + + + /it-autoflight/output/ap1 + /it-autoflight/output/ap2 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/electrical/bus/dc-2 + 25 + + + nasal @@ -69,10 +69,10 @@ nasal @@ -87,10 +87,10 @@ nasal @@ -105,10 +105,10 @@ nasal diff --git a/Systems/a320-fbw.xml b/Systems/a320-fbw.xml index 26b547d8..e51570ee 100644 --- a/Systems/a320-fbw.xml +++ b/Systems/a320-fbw.xml @@ -56,11 +56,14 @@ - + position/wow eq 1 - /it-fbw/yaw-law eq 2 + + /it-fbw/yaw-law eq 2 + /it-fbw/law ne 0 + @@ -1538,11 +1541,14 @@ fbw/yaw/fmgc-cmd - + - - /it-fbw/yaw-law eq 0 - /it-fbw/yaw-law eq 1 + + /it-fbw/law ne 3 + + /it-fbw/yaw-law eq 0 + /it-fbw/yaw-law eq 1 + From aebdca0ad5ffa37cbfe1f665117962911b27c15d Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 17 Jul 2020 16:57:10 +0100 Subject: [PATCH 08/10] Add ECAM warnings for FAC / rudder system. FAC failure latching now works. Yaw damper failures added. You can now go from mechanical yaw back to alternate yaw, should your FAC recover. --- A320-main.xml | 3 + AircraftConfig/fail.xml | 20 ++++ Nasal/ECAM/ECAM-controller.nas | 6 ++ Nasal/ECAM/ECAM-logic.nas | 94 +++++++++++++------ Nasal/ECAM/ECAM-messages.nas | 32 ++++++- Nasal/ECAM/ECAM-phases.nas | 1 + Nasal/FBW/it-fbw.nas | 33 ++++--- Systems/a320-fbw.xml | 114 +++++++++++++++++++++-- Systems/a320-fcs.xml | 41 ++++++++- Systems/a320-fwc.xml | 163 ++++++++++++++++++++++++++++++++- 10 files changed, 446 insertions(+), 61 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index b306a60f..8d4aeb36 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1124,6 +1124,8 @@ 0 0 0 + 0 + 0 0 @@ -1194,6 +1196,7 @@ 0 0 0 + 0 diff --git a/AircraftConfig/fail.xml b/AircraftConfig/fail.xml index 10c0d55c..7ce0a7f3 100644 --- a/AircraftConfig/fail.xml +++ b/AircraftConfig/fail.xml @@ -144,6 +144,26 @@ true + + + left + /systems/failures/fctl/yaw-damper-1 + + dialog-apply + + true + + + + + left + /systems/failures/fctl/yaw-damper-2 + + dialog-apply + + true + + hbox diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index a0e16d81..c9668762 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -55,6 +55,10 @@ var warningNodes = { rtlu1Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-1-fault"), rtlu2Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-2-fault"), rtlu12Fault: props.globals.initNode("/ECAM/warnings/logic/rud-trav-lim-sys-fault"), + fac12Fault: props.globals.initNode("/ECAM/warnings/logic/fac-12-fault"), + fac1Fault: props.globals.initNode("/ECAM/warnings/logic/fac-1-fault"), + fac2Fault: props.globals.initNode("/ECAM/warnings/logic/fac-2-fault"), + yawDamper12Fault: props.globals.initNode("/ECAM/warnings/logic/yaw-damper-12-fault"), }, Timers: { apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), @@ -81,6 +85,8 @@ var warningNodes = { pack1Off: props.globals.initNode("/ECAM/warnings/timer/pack-1-off"), pack2Off: props.globals.initNode("/ECAM/warnings/timer/pack-2-off"), trimAirFault: props.globals.initNode("/ECAM/warnings/timer/trim-air-fault"), + yawDamper1Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-1-fault"), + yawDamper2Fault: props.globals.initNode("/ECAM/warnings/timer/yaw-damper-2-fault"), }, Flipflops: { bleed1LowTemp: props.globals.initNode("/ECAM/warnings/logic/bleed-1-low-temp-flipflop-output"), diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 08612fa1..67206bef 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -10,7 +10,6 @@ var apWarn = props.globals.getNode("/it-autoflight/output/ap-warning", 1); var athrWarn = props.globals.getNode("/it-autoflight/output/athr-warning", 1); var emerGen = props.globals.getNode("/controls/electrical/switches/emer-gen", 1); -var fac1Node = props.globals.getNode("/controls/fctl/switches/fac1", 1); var state1Node = props.globals.getNode("/engines/engine[0]/state", 1); var state2Node = props.globals.getNode("/engines/engine[1]/state", 1); var wowNode = props.globals.getNode("/fdm/jsbsim/position/wow", 1); @@ -33,8 +32,6 @@ var phaseVar1 = nil; var phaseVarMemo = nil; var phaseVarMemo2 = nil; var phaseVarMemo3 = nil; -var dualFailFACActive = 1; -var emerConfigFACActive = 1; var gear_agl_cur = nil; var numberMinutes = nil; var timeNow = nil; @@ -103,8 +100,6 @@ var messages_priority_3 = func { dualFail.active = 1; } else { ECAM_controller.warningReset(dualFail); - - dualFailFACActive = 1; # reset FAC local variable } if (dualFail.active == 1) { @@ -144,7 +139,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(dualFailRadio); } - if (dualFailFACActive == 1 and dualFailFAC.clearFlag == 0) { + if (getprop("/systems/fctl/fac1-healthy-signal") == 0 and dualFailFAC.clearFlag == 0) { dualFailFAC.active = 1; } else { ECAM_controller.warningReset(dualFailFAC); @@ -959,7 +954,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(emerconfigFuelG2); } - if (emerConfigFACActive == 1 and emerconfigFAC.clearFlag == 0) { + if (getprop("/systems/fctl/fac1-healthy-signal") == 0 and emerconfigFAC.clearFlag == 0) { emerconfigFAC.active = 1; } else { ECAM_controller.warningReset(emerconfigFAC); @@ -1179,6 +1174,28 @@ var messages_priority_2 = func { ECAM_controller.warningReset(tcasFault); } + if (fac12Fault.clearFlag == 0 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and warningNodes.Logic.fac12Fault.getBoolValue()) { + fac12Fault.active = 1; + fac12FaultRud.active = 1; + fac12FaultFac.active = 1; + fac12FaultSuccess.active = 1; + fac12FaultFacOff.active = 1; + } else { + ECAM_controller.warningReset(fac12Fault); + ECAM_controller.warningReset(fac12FaultRud); + ECAM_controller.warningReset(fac12FaultFac); + ECAM_controller.warningReset(fac12FaultSuccess); + ECAM_controller.warningReset(fac12FaultFacOff); + } + + if (yawDamperSysFault.clearFlag == 0 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and phaseVar2 != 10 and warningNodes.Logic.yawDamper12Fault.getBoolValue()) { + yawDamperSysFault.active = 1; + yawDamperSysFaultFac.active = 1; + } else { + ECAM_controller.warningReset(yawDamperSysFault); + ECAM_controller.warningReset(yawDamperSysFaultFac); + } + if (rudTravLimSysFault.clearFlag == 0 and phaseVar2 != 4 and phaseVar2 != 5 and phaseVar2 != 7 and phaseVar2 != 8 and warningNodes.Logic.rtlu12Fault.getBoolValue()) { rudTravLimSysFault.active = 1; rudTravLimSysFaultRud.active = 1; @@ -1189,6 +1206,42 @@ var messages_priority_2 = func { ECAM_controller.warningReset(rudTravLimSysFaultFac); } + if (fac1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 >= 9 or phaseVar2 == 6) and warningNodes.Logic.fac1Fault.getBoolValue()) { + fac1Fault.active = 1; + fac1FaultFac.active = 1; + fac1FaultSuccess.active = 1; + fac1FaultFacOff.active = 1; + } else { + ECAM_controller.warningReset(fac1Fault); + ECAM_controller.warningReset(fac1FaultFac); + ECAM_controller.warningReset(fac1FaultSuccess); + ECAM_controller.warningReset(fac1FaultFacOff); + } + + if (fac2Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 >= 9 or phaseVar2 == 6) and warningNodes.Logic.fac2Fault.getBoolValue()) { + fac2Fault.active = 1; + fac2FaultFac.active = 1; + fac2FaultSuccess.active = 1; + fac2FaultFacOff.active = 1; + } else { + ECAM_controller.warningReset(fac2Fault); + ECAM_controller.warningReset(fac2FaultFac); + ECAM_controller.warningReset(fac2FaultSuccess); + ECAM_controller.warningReset(fac2FaultFacOff); + } + + if (yawDamper1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 == 9 or phaseVar2 == 6) and warningNodes.Timers.yawDamper1Fault.getValue() == 1 and !warningNodes.Logic.yawDamper12Fault.getBoolValue()) { + yawDamper1Fault.active = 1; + } else { + ECAM_controller.warningReset(yawDamper1Fault); + } + + if (yawDamper2Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 == 9 or phaseVar2 == 6) and warningNodes.Timers.yawDamper2Fault.getValue() == 1 and !warningNodes.Logic.yawDamper12Fault.getBoolValue()) { + yawDamper2Fault.active = 1; + } else { + ECAM_controller.warningReset(yawDamper2Fault); + } + if (rudTravLimSys1Fault.clearFlag == 0 and (phaseVar2 <= 2 or phaseVar2 >= 9 or phaseVar2 == 6) and warningNodes.Logic.rtlu1Fault.getBoolValue()) { rudTravLimSys1Fault.active = 1; } else { @@ -1230,14 +1283,12 @@ var messages_priority_2 = func { apuEmerShutdown.active = 1; } elsif (apuEmerShutdown.clearFlag == 1) { ECAM_controller.warningReset(apuEmerShutdown); - apuEmerShutdown.isMainMsg = 1; } if (apuEmerShutdownMast.clearFlag == 0 and getprop("controls/apu/master") and apuEmerShutdown.active == 1) { apuEmerShutdownMast.active = 1; } else { ECAM_controller.warningReset(apuEmerShutdownMast); - apuEmerShutdown.isMainMsg = 0; } # APU AUTO SHUT DOWN @@ -1245,14 +1296,12 @@ var messages_priority_2 = func { apuAutoShutdown.active = 1; } elsif (apuAutoShutdown.clearFlag == 1) { ECAM_controller.warningReset(apuAutoShutdown); - apuAutoShutdown.isMainMsg = 1; } if (apuAutoShutdownMast.clearFlag == 0 and pts.APU.masterSw.getValue() and apuAutoShutdown.active == 1) { apuAutoShutdownMast.active = 1; } else { ECAM_controller.warningReset(apuAutoShutdownMast); - apuAutoShutdown.isMainMsg = 0; } # Bleed @@ -2137,6 +2186,12 @@ var messages_memo = func { refuelg.active = 0; } + if (systems.ADIRS.ADIRunits[0].inAlign == 1 or systems.ADIRS.ADIRunits[1].inAlign == 1 or systems.ADIRS.ADIRunits[2].inAlign == 1) { + FWC.Logic.IRSinAlign.setValue(1); + } else { + FWC.Logic.IRSinAlign.setValue(0); + } + if ((phaseVarMemo2 == 1 or phaseVarMemo2 == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRS.ADIRunits[0].inAlign == 1 or systems.ADIRS.ADIRunits[1].inAlign == 1 or systems.ADIRS.ADIRunits[2].inAlign == 1)) { irs_in_align.active = 1; if (getprop("ECAM/phases/timer/eng1or2-output")) { @@ -2408,23 +2463,6 @@ var messages_right_memo = func { } } -# Listeners -setlistener("/controls/fctl/switches/fac1", func() { - if (dualFail.active == 0 and emerconfig.active == 0) { return; } - - if (fac1Node.getBoolValue() and dualFail.active == 1) { - dualFailFACActive = 0; - } else { - dualFailFACActive = 1; - } - - if (fac1Node.getBoolValue() and emerconfig.active == 1) { - emerConfigFACActive = 0; - } else { - emerConfigFACActive = 1; - } -}, 0, 0); - setlistener("/engines/engine[0]/state", func() { if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and wowNode.getValue() == 0) { dualFailNode.setBoolValue(1); diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index f020e0df..a8f945b7 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -226,12 +226,34 @@ var warnings = std.Vector.new([ # TCAS FAULT var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - # Rudder Travel Limiter + # FAC and Rudder System + var fac12Fault = warning.new(msg: "AUTO FLT FAC 1+2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var fac12FaultRud = warning.new(msg: "RUD WITH CARE ABV 160 KT", colour: "c"), + var fac12FaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c"), + var fac12FaultSuccess = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), + var fac12FaultFacOff = warning.new(msg: " -FAC 1+2............OFF", colour: "c"), + var yawDamperSysFault = warning.new(msg: "AUTO FLT YAW DAMPER SYS", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var yawDamperSysFaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c"), + # var rudderTrimSysFault = warning.new(msg: "AUTO FLT RUD TRIM SYS", colour: "a", aural: 1, light: 1, isMainMsg: 1), not implemented + # var rudderTrimSysFaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c"), var rudTravLimSysFault = warning.new(msg: "AUTO FLT RUD TRV LIM SYS", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var rudTravLimSysFaultRud = warning.new(msg: "RUD WITH CARE ABV 160 KT", colour: "c", aural: 1, light: 1), - var rudTravLimSysFaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c", aural: 1, light: 1), - var rudTravLimSys1Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 1", colour: "a", isMainMsg: 1), - var rudTravLimSys2Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 2", colour: "a", isMainMsg: 1), + var rudTravLimSysFaultRud = warning.new(msg: "RUD WITH CARE ABV 160 KT", colour: "c"), + var rudTravLimSysFaultFac = warning.new(msg: " -FAC 1+2....OFF THEN ON", colour: "c"), + var fac1Fault = warning.new(msg: "AUTO FLT FAC 1 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var fac1FaultFac = warning.new(msg: " -FAC 1......OFF THEN ON", colour: "c"), + var fac1FaultSuccess = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), + var fac1FaultFacOff = warning.new(msg: " -FAC 1..............OFF", colour: "c"), + var fac2Fault = warning.new(msg: "AUTO FLT FAC 2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var fac2FaultFac = warning.new(msg: " -FAC 2......OFF THEN ON", colour: "c"), + var fac2FaultSuccess = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), + var fac2FaultFacOff = warning.new(msg: " -FAC 2..............OFF", colour: "c"), + + var yawDamper1Fault = warning.new(msg: "AUTO FLT YAW DAMPER 1", colour: "a", isMainMsg: 1), + var yawDamper2Fault = warning.new(msg: "AUTO FLT YAW DAMPER 2", colour: "a", isMainMsg: 1), + # var rudTrim1Fault = warning.new(msg: "AUTO FLT RUD TRIM1 FAULT", colour: "a", isMainMsg: 1), not implemented + # var rudTrim2Fault = warning.new(msg: "AUTO FLT RUD TRIM2 FAULT", colour: "a", isMainMsg: 1), not implemented + var rudTravLimSys1Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 1", colour: "a", isMainMsg: 1), + var rudTravLimSys2Fault = warning.new(msg: "AUTO FLT RUD TRV LIM 2", colour: "a", isMainMsg: 1), # FCU fault var fcuFault = warning.new(msg: "AUTO FLT FCU 1+2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), diff --git a/Nasal/ECAM/ECAM-phases.nas b/Nasal/ECAM/ECAM-phases.nas index 17159fef..6ac15d44 100644 --- a/Nasal/ECAM/ECAM-phases.nas +++ b/Nasal/ECAM/ECAM-phases.nas @@ -52,6 +52,7 @@ var FWC = { }, Logic: { gnd: props.globals.getNode("/ECAM/ground-calc-immediate"), + IRSinAlign: props.globals.initNode("/ECAM/irs-in-align", 0, "BOOL"), }, Timer: { eng1idle: props.globals.initNode("/ECAM/phases/timer/eng1idle", 0, "INT"), diff --git a/Nasal/FBW/it-fbw.nas b/Nasal/FBW/it-fbw.nas index d158c870..f9379357 100644 --- a/Nasal/FBW/it-fbw.nas +++ b/Nasal/FBW/it-fbw.nas @@ -32,14 +32,15 @@ var FBW = { override: props.globals.getNode("/it-fbw/override"), rollBack: props.globals.getNode("/it-fbw/roll-back"), rollLim: props.globals.getNode("/it-fbw/roll-lim"), + yawdamper: props.globals.getNode("/systems/fctl/yawdamper-active"), Computers: { elac1: props.globals.getNode("/systems/fctl/elac1"), elac2: props.globals.getNode("/systems/fctl/elac2"), sec1: props.globals.getNode("/systems/fctl/sec1"), sec2: props.globals.getNode("/systems/fctl/sec2"), sec3: props.globals.getNode("/systems/fctl/sec3"), - fac1: props.globals.getNode("/systems/fctl/fac1"), - fac2: props.globals.getNode("/systems/fctl/fac2"), + fac1: props.globals.getNode("/systems/fctl/fac1-healthy-signal"), + fac2: props.globals.getNode("/systems/fctl/fac2-healthy-signal"), }, Failures: { elac1: props.globals.getNode("/systems/failures/fctl/elac1"), @@ -59,6 +60,8 @@ var FBW = { spoilerr3: props.globals.getNode("/systems/failures/spoilers/spoiler-r3"), spoilerr4: props.globals.getNode("/systems/failures/spoilers/spoiler-r4"), spoilerr5: props.globals.getNode("/systems/failures/spoilers/spoiler-r5"), + yawDamper1: props.globals.getNode("/systems/failures/fctl/yaw-damper-1"), + yawDamper2: props.globals.getNode("/systems/failures/fctl/yaw-damper-2"), }, Lights: { elac1: props.globals.getNode("/systems/fctl/lights/elac1-fault"), @@ -126,6 +129,18 @@ var FBW = { me.Failures.sec3.setBoolValue(0); me.Failures.fac1.setBoolValue(0); me.Failures.fac2.setBoolValue(0); + me.Failures.spoilerl1.setBoolValue(0); + me.Failures.spoilerl2.setBoolValue(0); + me.Failures.spoilerl3.setBoolValue(0); + me.Failures.spoilerl4.setBoolValue(0); + me.Failures.spoilerl5.setBoolValue(0); + me.Failures.spoilerr1.setBoolValue(0); + me.Failures.spoilerr2.setBoolValue(0); + me.Failures.spoilerr3.setBoolValue(0); + me.Failures.spoilerr4.setBoolValue(0); + me.Failures.spoilerr5.setBoolValue(0); + me.Failures.yawDamper1.setBoolValue(0); + me.Failures.yawDamper2.setBoolValue(0); }, }; @@ -173,22 +188,14 @@ var update_loop = func { } if (systems.ELEC.EmerElec.getBoolValue()) { if (lawyaw == 0 or lawyaw == 1) { - FBW.degradeYawLaw.setValue(2); + } elsif (fac1 and lawyaw == 2) { + FBW.degradeYawLaw.setValue(1); } if (law == 0) { FBW.degradeLaw.setValue(1); FBW.apOff = 1; } } - if (blue >= 1500 and green < 1500 and yellow < 1500) { - if (lawyaw == 0 or lawyaw == 1) { - FBW.degradeYawLaw.setValue(2); - } - if (law == 0) { - FBW.degradeLaw.setValue(1); - FBW.apOff = 1; - } - } if (blue < 1500 and green < 1500 and yellow >= 1500) { if (lawyaw == 0) { FBW.degradeYawLaw.setValue(1); @@ -198,7 +205,7 @@ var update_loop = func { FBW.apOff = 1; } } - if (!fac1 and !fac2 ) { + if ((!fac1 and !fac2) or !FBW.yawdamper.getValue() or (blue >= 1500 and green < 1500 and yellow < 1500)) { if (lawyaw == 0 or lawyaw == 1) { FBW.degradeYawLaw.setValue(2); } diff --git a/Systems/a320-fbw.xml b/Systems/a320-fbw.xml index e51570ee..e8ce9803 100644 --- a/Systems/a320-fbw.xml +++ b/Systems/a320-fbw.xml @@ -346,11 +346,60 @@ + + + + /controls/fctl/switches/fac1 eq 1 + /systems/failures/fctl/fac1 eq 0 + + /systems/electrical/bus/ac-ess ge 110 + /systems/electrical/bus/dc-ess-shed ge 25 + + + + + + + + /gear/gear[0]/wow eq 0 + /controls/fctl/switches/fac1 eq 1 + /systems/fctl/fac1-healthy eq 0 + + + + + + + /controls/fctl/switches/fac1 eq 0 + + + + + + + /systems/fctl/fac1-healthy-latch-set eq 1 + + + /systems/fctl/fac1-healthy-latch-reset eq 1 + + + + + + + /systems/fctl/fac1-healthy eq 1 + + /systems/fctl/fac1-healthy-latch eq 0 + /gear/gear[0]/wow eq 1 + + + + /controls/fctl/switches/fac1 eq 1 - /systems/fctl/fac1 eq 0 + /systems/fctl/fac1-healthy-signal eq 0 @@ -358,9 +407,56 @@ /controls/fctl/switches/fac1 eq 1 - /systems/failures/fctl/fac1 eq 0 - /systems/electrical/bus/ac-ess ge 110 - /systems/electrical/bus/dc-ess-shed ge 25 + /systems/fctl/fac1-healthy eq 1 + + + + + + + /controls/fctl/switches/fac2 eq 1 + /systems/failures/fctl/fac2 eq 0 + + /systems/electrical/bus/ac-2 ge 110 + /systems/electrical/bus/dc-2 ge 25 + + + + + + + + /controls/fctl/switches/fac2 eq 1 + /systems/fctl/fac2-healthy eq 0 + + + + + + + /controls/fctl/switches/fac2 eq 0 + + + + + + + /gear/gear[0]/wow eq 0 + /systems/fctl/fac2-healthy-latch-set eq 1 + + + /systems/fctl/fac2-healthy-latch-reset eq 1 + + + + + + + /systems/fctl/fac2-healthy eq 1 + + /systems/fctl/fac2-healthy-latch eq 0 + /gear/gear[0]/wow eq 1 + @@ -368,7 +464,7 @@ /controls/fctl/switches/fac2 eq 1 - /systems/fctl/fac2 eq 0 + /systems/fctl/fac2-healthy-signal eq 0 @@ -376,9 +472,7 @@ /controls/fctl/switches/fac2 eq 1 - /systems/failures/fctl/fac2 eq 0 - /systems/electrical/bus/ac-2 ge 110 - /systems/electrical/bus/dc-2 ge 25 + /systems/fctl/fac2-healthy eq 1 @@ -1338,7 +1432,7 @@ /systems/failures/fctl/rtlu-1 eq 0 /systems/electrical/bus/dc-ess ge 25 - /systems/fctl/fac1 eq 1 + /systems/fctl/fac1-healthy-signal eq 1 /systems/fmgc/cas-compare/cas-reject-1 eq 0 @@ -1357,7 +1451,7 @@ /systems/failures/fctl/rtlu-2 eq 0 /systems/electrical/bus/dc-2 ge 25 - /systems/fctl/fac2 eq 1 + /systems/fctl/fac2-healthy-signal eq 1 /systems/fmgc/cas-compare/cas-reject-2 eq 0 diff --git a/Systems/a320-fcs.xml b/Systems/a320-fcs.xml index d0848bb8..74dbd282 100644 --- a/Systems/a320-fcs.xml +++ b/Systems/a320-fcs.xml @@ -296,7 +296,8 @@ - + + /systems/hydraulic/yellow-psi ge 1500 /systems/hydraulic/green-psi ge 1500 @@ -333,6 +334,40 @@ + + + + /systems/fctl/fac1-healthy-signal eq 1 + /systems/hydraulic/green-psi ge 1500 + + /systems/navigation/adr/operating-1 eq 1 + /systems/navigation/adr/operating-3 eq 1 + + /systems/failures/fctl/yaw-damper-1 eq 0 + + + + + + + /systems/fctl/fac2-healthy-signal eq 1 + /systems/hydraulic/yellow-psi ge 1500 + + /systems/navigation/adr/operating-2 eq 1 + /systems/navigation/adr/operating-3 eq 1 + + /systems/failures/fctl/yaw-damper-2 eq 0 + + + + + + + /systems/fctl/yawdamper-1-active eq 1 + /systems/fctl/yawdamper-2-active eq 1 + + + @@ -351,11 +386,11 @@ /systems/electrical/bus/dc-ess ge 25 - /systems/fctl/fac1 eq 1 + /systems/fctl/fac1-healthy-signal eq 1 /systems/electrical/bus/dc-2 ge 25 - /systems/fctl/fac2 eq 1 + /systems/fctl/fac2-healthy-signal eq 1 diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index e3533870..6246a2a4 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -321,6 +321,19 @@ 0.2 + + Timer for the ECAM system + /ECAM/warnings/logic/yaw-damper-1-fault + 100 + 0.2 + + + + Timer for the ECAM system + /ECAM/warnings/logic/yaw-damper-2-fault + 100 + 0.2 + @@ -1239,7 +1252,7 @@ /systems/electrical/bus/dc-ess-shed ge 25 /systems/electrical/bus/ac-1 ge 110 /systems/fctl/fac1-rtlu-avail eq 0 - /systems/fctl/fac1 eq 1 + /systems/fctl/fac1-healthy-signal eq 1 @@ -1251,7 +1264,7 @@ /systems/electrical/bus/dc-2 ge 25 /systems/electrical/bus/ac-2 ge 110 /systems/fctl/fac2-rtlu-avail eq 0 - /systems/fctl/fac2 eq 1 + /systems/fctl/fac2-healthy-signal eq 1 @@ -1278,6 +1291,152 @@ /ECAM/warnings/logic/rud-trav-lim-sys-fault eq 0 + + + + + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/dc-2 ge 25 + /systems/fctl/fac1-healthy-signal eq 0 + /systems/fctl/fac2-healthy-signal eq 0 + + + + + + + /systems/navigation/adr/operating-1 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/ac-1 ge 110 + /systems/fctl/fac1-healthy-signal eq 0 + /systems/fctl/fac2-healthy-signal eq 1 + + + + + + + /systems/navigation/adr/operating-2 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-2 ge 25 + /systems/electrical/bus/ac-2 ge 110 + /systems/fctl/fac1-healthy-signal eq 1 + /systems/fctl/fac2-healthy-signal eq 0 + + + + + + + /controls/engines/engine[1]/cutoff-switch eq 0 + /systems/hydraulic/green-psi lt 1500 + /ECAM/timer/ground-calc eq 1 + + + + + + + /systems/hydraulic/green-psi lt 1500 + /ECAM/warning-phase eq 1 + + + + + + + /systems/navigation/adr/operating-1 eq 0 + /systems/navigation/adr/operating-3 eq 0 + + /ECAM/warning-phase eq 1 + /ECAM/warning-phase eq 10 + + + + + + + + /systems/navigation/adr/operating-1 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/ac-1 ge 110 + /ECAM/warnings/logic/yaw-damper-1-fault-eng-start eq 0 + /ECAM/warnings/logic/yaw-damper-1-fault-green eq 0 + /ECAM/warnings/logic/yaw-damper-1-fault-adr eq 0 + /ECAM/irs-in-align eq 0 + /systems/fctl/yawdamper-1-active eq 0 + /systems/fctl/fac1-healthy-signal eq 1 + + + + + + + /controls/engines/engine[0]/cutoff-switch eq 0 + /systems/hydraulic/yellow-psi lt 1500 + /ECAM/timer/ground-calc eq 1 + + + + + + + /systems/hydraulic/yellow-psi lt 1500 + /ECAM/warning-phase eq 1 + + + + + + + /systems/navigation/adr/operating-2 eq 0 + /systems/navigation/adr/operating-3 eq 0 + + /ECAM/warning-phase eq 1 + /ECAM/warning-phase eq 10 + + + + + + + + /systems/navigation/adr/operating-2 eq 1 + /systems/navigation/adr/operating-3 eq 1 + /systems/electrical/bus/dc-2 ge 25 + /systems/electrical/bus/ac-2 ge 110 + /ECAM/warnings/logic/yaw-damper-2-fault-eng-start eq 0 + /ECAM/warnings/logic/yaw-damper-2-fault-yellow eq 0 + /ECAM/warnings/logic/yaw-damper-2-fault-adr eq 0 + /ECAM/irs-in-align eq 0 + /systems/fctl/yawdamper-2-active eq 0 + /systems/fctl/fac2-healthy-signal eq 1 + + + + + + + /ECAM/irs-in-align eq 0 + + /systems/navigation/adr/operating-1 eq 1 + /systems/navigation/adr/operating-2 eq 1 + /systems/navigation/adr/operating-3 eq 1 + + + /systems/electrical/bus/dc-ess-shed ge 25 + /systems/electrical/bus/ac-1 ge 110 + /systems/electrical/bus/dc-2 ge 25 + /systems/electrical/bus/ac-2 ge 110 + + /ECAM/warnings/logic/yaw-damper-1-fault-green eq 0 + /ECAM/warnings/logic/yaw-damper-2-fault-yellow eq 0 + /ECAM/warnings/logic/yaw-damper-1-fault eq 1 + /ECAM/warnings/logic/yaw-damper-2-fault eq 1 + + From 998db7162f3f3912ceea9c95aeddcd5a648f5763 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 17 Jul 2020 19:50:44 +0100 Subject: [PATCH 09/10] Bugfix autopilot disconnect with FBW failure --- AircraftConfig/fbw.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AircraftConfig/fbw.xml b/AircraftConfig/fbw.xml index cd3d5ffc..baf83a35 100644 --- a/AircraftConfig/fbw.xml +++ b/AircraftConfig/fbw.xml @@ -55,6 +55,7 @@ setprop("/it-fbw/law", 0); setprop("/it-fbw/degrade-yaw-law", 0); setprop("/it-fbw/yaw-law", 0); + fbw.FBW.apOff = 0; gui.popupTip("Fly By Wire switched to NORMAL law!"); @@ -73,6 +74,7 @@ setprop("/it-fbw/law", 1); setprop("/it-fbw/degrade-yaw-law", 1); setprop("/it-fbw/yaw-law", 1); + fbw.FBW.apOff = 1; gui.popupTip("Fly By Wire switched to ALTERNATE law!"); @@ -91,6 +93,7 @@ setprop("/it-fbw/law", 2); setprop("/it-fbw/degrade-yaw-law", 2); setprop("/it-fbw/yaw-law", 2); + fbw.FBW.apOff = 1; gui.popupTip("Fly By Wire switched to DIRECT law!"); @@ -109,6 +112,7 @@ setprop("/it-fbw/law", 3); setprop("/it-fbw/degrade-yaw-law", 2); setprop("/it-fbw/yaw-law", 2); + fbw.FBW.apOff = 1; gui.popupTip("Fly By Wire switched to MECHANICAL BACKUP law!"); From c50d42c1380b29821f04c712cc0ff8e20566a690 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 17 Jul 2020 20:58:39 +0100 Subject: [PATCH 10/10] Fix Nasal errors, fix payload dialog --- Nasal/MCDU/CLOSESTAIRPORT.nas | 12 ++++++------ Nasal/MCDU/LATREV.nas | 2 +- Nasal/Systems/payload.nas | 1 + gui/dialogs/refuel.nas | 7 ++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Nasal/MCDU/CLOSESTAIRPORT.nas b/Nasal/MCDU/CLOSESTAIRPORT.nas index ddec61e9..fa72faba 100644 --- a/Nasal/MCDU/CLOSESTAIRPORT.nas +++ b/Nasal/MCDU/CLOSESTAIRPORT.nas @@ -112,13 +112,13 @@ var closestAirportPage = { } if (size(id) > 4) { mcdu_message(me.computer, "NOT ALLOWED"); + } elsif (airportinfo(id) == nil) { + mcdu_message(me.computer, "NOT IN DATA BASE"); + } else { + me.manAirport = airportinfo(id); + me.L5 = [id, nil, "grn"]; + me.R5 = ["----", nil, "grn"]; } - if (airportinfo(id) == nil) { - notInDataBase(me.computer); - } - me.manAirport = airportinfo(id); - me.L5 = [id, nil, "grn"]; - me.R5 = ["----", nil, "grn"]; canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); } }; diff --git a/Nasal/MCDU/LATREV.nas b/Nasal/MCDU/LATREV.nas index 0896a37a..ce81594a 100644 --- a/Nasal/MCDU/LATREV.nas +++ b/Nasal/MCDU/LATREV.nas @@ -132,7 +132,7 @@ var latRev = { var returny = fmgc.flightPlanController.scratchpad(mcdu_scratchpad.scratchpads[me.computer].scratchpad, me.index + 1, me.computer); if (returny == 0) { - notInDataBase(me.computer); + mcdu_message(me.computer, "NOT IN DATA BASE"); } elsif (returny == 1) { mcdu_message(me.computer, "NOT ALLOWED"); } else { diff --git a/Nasal/Systems/payload.nas b/Nasal/Systems/payload.nas index cd508129..7d0ec8ad 100644 --- a/Nasal/Systems/payload.nas +++ b/Nasal/Systems/payload.nas @@ -9,6 +9,7 @@ var fuelSvc = { Nodes: { requestLbs: props.globals.getNode("services/fuel-truck/request-lbs"), requestTotalLbs: props.globals.getNode("services/fuel-truck/request-total-lbs"), + requestFuelLbs: props.globals.initNode("services/fuel-truck/fuel-on-board-at-request", pts.Consumables.Fuel.totalFuelLbs.getValue(), "DOUBLE"), }, newRequest: func() { diff --git a/gui/dialogs/refuel.nas b/gui/dialogs/refuel.nas index 346be34f..0085ebc6 100644 --- a/gui/dialogs/refuel.nas +++ b/gui/dialogs/refuel.nas @@ -63,8 +63,6 @@ var refuelClass = { me._svg = me._root.createChild("group"); canvas.parsesvg(me._svg, "Aircraft/A320-family/gui/dialogs/refuel.svg"); - - amount.setValue(math.round((pts.Consumables.Fuel.totalFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1)); me._HI_LVL_L = me._svg.getElementById("HI-LVL-L"); me._HI_LVL_C = me._svg.getElementById("HI-LVL-C"); @@ -405,8 +403,8 @@ var refuelClass = { me._Mode_refuel.show(); me._Mode_off.hide(); me._Mode_defuel.hide(); + systems.fuelSvc.Nodes.requestFuelLbs.setValue(pts.Consumables.Fuel.totalFuelLbs.getValue()); systems.fuelSvc.refuel(); - } }); @@ -484,6 +482,9 @@ var refuelClass = { me._timerUp.stop(); }); + + amount.setValue(math.round((systems.fuelSvc.Nodes.requestFuelLbs.getValue() + systems.fuelSvc.Nodes.requestLbs.getValue()) / 1000, 0.1)); + me._timerf(); me._timer.start(); },