From fd5d4676ffaf0e816bbce17ad0d8bb9950ce3348 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 6 Jan 2022 18:41:15 +0000 Subject: [PATCH] Excess cabin press --- Nasal/ECAM/ECAM-logic.nas | 137 ++++++++++++++++++++++++++++++++++- Nasal/ECAM/ECAM-messages.nas | 1 + Nasal/ECAM/ECAM-nodes.nas | 5 ++ Systems/a320-fwc.xml | 92 +++++++++++++++++++++-- Systems/ecam-proprules.xml | 44 +++++++++++ 5 files changed, 269 insertions(+), 10 deletions(-) diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 056a0064..ee4f4747 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -626,6 +626,139 @@ var messages_priority_3 = func { ECAM_controller.warningReset(park_brk_config); } + if (excessCabAlt.clearFlag == 0 and warningNodes.Logic.excessCabAlt.getValue() == 1 and phaseVar3 == 6) { + excessCabAlt.active = 1; + + if (excessCabAltMask.clearFlag == 0 and warningNodes.Flipflops.cabPressExcessFlipflopTop.getValue()) { + excessCabAltMask.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltMask); + } + + if (warningNodes.Flipflops.cabPressExcessFlipflop.getValue()) { + if (excessCabAltSigns.clearFlag == 0 and (!pts.Controls.Lighting.noSmokingSign.getValue() or !pts.Controls.Lighting.seatbeltSign.getValue())) { + excessCabAltSigns.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltSigns); + } + + if (excessCabAltEmerD.clearFlag == 0) { + excessCabAltEmerD.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltEmerD); + } + } else { + ECAM_controller.warningReset(excessCabAltSigns); + ECAM_controller.warningReset(excessCabAltEmerD); + } + + if (excessCabAltDES.clearFlag == 0 and warningNodes.Flipflops.cabPressExcessFlipflopTop.getValue()) { + excessCabAltDES.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltDES); + } + + if (warningNodes.Flipflops.cabPressExcessFlipflop.getValue()) { + if (excessCabAltTHRLVR.clearFlag == 0 and !fmgc.Output.athr.getBoolValue() and warningNodes.Logic.JE1TLAI.getValue() != 0 and warningNodes.Logic.JE2TLAI.getValue() != 0) { + excessCabAltTHRLVR.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltTHRLVR); + } + + if (excessCabAltSPDBRK.clearFlag == 0 and pts.Controls.Flight.speedbrake.getValue() != 1) { + excessCabAltSPDBRK.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltSPDBRK); + } + + if (excessCabAltSPD.clearFlag == 0) { + excessCabAltSPD.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltSPD); + } + + if (excessCabAltENG.clearFlag == 0 and pts.Controls.Engines.startSw.getValue() != 1) { + excessCabAltENG.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltENG); + } + + if (excessCabAltATC.clearFlag == 0) { + excessCabAltATC.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltATC); + } + } else { + ECAM_controller.warningReset(excessCabAltTHRLVR); + ECAM_controller.warningReset(excessCabAltSPDBRK); + ECAM_controller.warningReset(excessCabAltSPD); + ECAM_controller.warningReset(excessCabAltENG); + ECAM_controller.warningReset(excessCabAltATC); + } + + if (warningNodes.Flipflops.cabPressExcessFlipflopTop.getValue() and !warningNodes.Flipflops.cabPressExcessFlipflop.getValue()) { + if (excessCabAltCAB.clearFlag == 0) { + excessCabAltCAB.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltCAB); + } + } else { + ECAM_controller.warningReset(excessCabAltCAB); + } + + if (warningNodes.Flipflops.cabPressExcessFlipflop.getValue()) { + if (excessCabAltPA.clearFlag == 0) { + excessCabAltPA.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltPA); + } + + if (excessCabAltXPDR.clearFlag == 0) { + excessCabAltXPDR.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltXPDR); + } + } else { + ECAM_controller.warningReset(excessCabAltPA); + ECAM_controller.warningReset(excessCabAltXPDR); + } + + if (excessCabAltMEA.clearFlag == 0) { + excessCabAltMEA.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltMEA); + } + + if (excessCabAltCabAlt.clearFlag == 0) { + excessCabAltCabAlt.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltCabAlt); + } + + if (excessCabAltMasks.clearFlag == 0) { + excessCabAltMasks.active = 1; + } else { + ECAM_controller.warningReset(excessCabAltMasks); + } + } else { + ECAM_controller.warningReset(excessCabAlt); + ECAM_controller.warningReset(excessCabAltMask); + ECAM_controller.warningReset(excessCabAltSigns); + ECAM_controller.warningReset(excessCabAltEmerD); + ECAM_controller.warningReset(excessCabAltDES); + ECAM_controller.warningReset(excessCabAltTHRLVR); + ECAM_controller.warningReset(excessCabAltSPDBRK); + ECAM_controller.warningReset(excessCabAltSPD); + ECAM_controller.warningReset(excessCabAltENG); + ECAM_controller.warningReset(excessCabAltCAB); + ECAM_controller.warningReset(excessCabAltATC); + ECAM_controller.warningReset(excessCabAltPA); + ECAM_controller.warningReset(excessCabAltXPDR); + ECAM_controller.warningReset(excessCabAltMEA); + ECAM_controller.warningReset(excessCabAltCabAlt); + ECAM_controller.warningReset(excessCabAltMasks); + } + if (lrElevFault.clearFlag == 0 and warningNodes.Timers.LRElevFault.getValue() == 1) { lrElevFault.active = 1; if (lrElevFaultSpeed.clearFlag == 0) { @@ -3340,7 +3473,7 @@ var messages_config_memo = func { toMemoLine1.colour = "c"; } - if (pts.Controls.Switches.seatbeltSwitch.getValue() and pts.Controls.Switches.noSmokingSwitch.getValue()) { + if (pts.Controls.Lighting.seatbeltSign.getValue() and pts.Controls.Lighting.noSmokingSign.getValue()) { toMemoLine2.msg = " SIGNS ON"; toMemoLine2.colour = "g"; } else { @@ -3406,7 +3539,7 @@ var messages_config_memo = func { ldgMemoLine1.colour = "c"; } - if (pts.Controls.Switches.seatbeltSwitch.getValue() and pts.Controls.Switches.noSmokingSwitch.getValue()) { + if (pts.Controls.Lighting.seatbeltSign.getValue() and pts.Controls.Lighting.noSmokingSign.getValue()) { ldgMemoLine2.msg = " SIGNS ON"; ldgMemoLine2.colour = "g"; } else { diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 16f2b6dc..fb10fbeb 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -136,6 +136,7 @@ var warnings = std.Vector.new([ var excessCabAltSPDBRK = warning.new(msg: " -SPD BRK...........FULL", colour: "c"), var excessCabAltSPD = warning.new(msg: " SPD.....MAX/APPROPRIATE", colour: "c"), var excessCabAltENG = warning.new(msg: " -ENG MODE...........IGN", colour: "c"), + var excessCabAltATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"), var excessCabAltCAB = warning.new(msg: " -CABIN CREW......ADVISE", colour: "c"), var excessCabAltPA = warning.new(msg: " -EMER DES (PA).ANNOUNCE", colour: "c"), var excessCabAltXPDR = warning.new(msg: " -XPDR 7700.....CONSIDER", colour: "c"), diff --git a/Nasal/ECAM/ECAM-nodes.nas b/Nasal/ECAM/ECAM-nodes.nas index b13bb41a..1fcddb63 100644 --- a/Nasal/ECAM/ECAM-nodes.nas +++ b/Nasal/ECAM/ECAM-nodes.nas @@ -74,6 +74,8 @@ var FWC = { var warningNodes = { Logic: { + JE1TLAI: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-tla-idle"), + JE2TLAI: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-tla-idle"), altitudeAlert: props.globals.initNode("/ECAM/warnings/altitude-alert/c-chord"), altitudeAlertSteady: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-steady"), altitudeAlertFlash: props.globals.initNode("/ECAM/warnings/altitude-alert/altitude-alert-flash"), @@ -152,6 +154,7 @@ var warningNodes = { gen2Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-2-off"), spdBrkOut: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-still-out"), excessPress: props.globals.initNode("/ECAM/warnings/press/exess-residual-pressure"), + excessCabAlt: props.globals.initNode("/ECAM/warnings/logic/press/excess-cabin-alt"), }, Timers: { apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"), @@ -215,5 +218,7 @@ var warningNodes = { parkBrk: props.globals.initNode("/ECAM/warnings/config/park-brk/park-brk-output"), eng1ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-thr-lvr-abv-idle"), eng2ThrLvrAbvIdle: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-thr-lvr-abv-idle"), + cabPressExcessFlipflopTop: props.globals.initNode("/ECAM/warnings/logic/press/excess-cabin-alt-flipflop-top"), + cabPressExcessFlipflop: props.globals.initNode("/ECAM/warnings/logic/press/excess-cabin-alt-flipflop"), }, }; \ No newline at end of file diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 5e52b0f8..aa8db4c7 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2673,9 +2673,9 @@ /ECAM/warnings/logic/eng/eng-1-tla-abv-6-output eq 1 - /engines/engine[0]/state eq 3 + /ECAM/warnings/logic/eng/JE1NORUN eq 1 - /engines/engine[1]/state eq 3 + /ECAM/warnings/logic/eng/JE2NORUN eq 1 /ECAM/warnings/logic/eng/eng-2-reverse eq 1 @@ -2692,9 +2692,9 @@ /ECAM/warnings/logic/eng/eng-1-tla-abv-6-2-output eq 1 - /engines/engine[0]/state eq 3 + /ECAM/warnings/logic/eng/JE1NORUN eq 1 - /engines/engine[1]/state eq 3 + /ECAM/warnings/logic/eng/JE2NORUN eq 1 /ECAM/warnings/logic/eng/eng-2-tla-idle-output eq 1 @@ -2711,9 +2711,9 @@ /ECAM/warnings/logic/eng/eng-2-tla-abv-6-output eq 1 - /engines/engine[1]/state eq 3 + /ECAM/warnings/logic/eng/JE2NORUN eq 1 - /engines/engine[0]/state eq 3 + /ECAM/warnings/logic/eng/JE1NORUN eq 1 /ECAM/warnings/logic/eng/eng-1-reverse eq 1 @@ -2730,9 +2730,9 @@ /ECAM/warnings/logic/eng/eng-2-tla-abv-6-2-output eq 1 - /engines/engine[1]/state eq 3 + /ECAM/warnings/logic/eng/JE2NORUN eq 1 - /engines/engine[0]/state eq 3 + /ECAM/warnings/logic/eng/JE1NORUN eq 1 /ECAM/warnings/logic/eng/eng-1-tla-idle-output eq 1 @@ -3176,6 +3176,82 @@ 100 + + + + /systems/pressurization/cabinalt-norm ge 9550 + + + + + /ECAM/warnings/timer/press/excess-cabin-alt-input + 1 + 100 + + + + + + /ECAM/warnings/timer/press/excess-cabin-alt eq 1 + + + + + + + /ECAM/warning-phase eq 3 + /ECAM/warning-phase eq 10 + + + + + + + + + /systems/navigation/adr/computation/baro-alt-corrected-1-capt ge 10000 + /systems/navigation/adr/computation/baro-alt-corrected-2-capt ge 10000 + /systems/navigation/adr/computation/baro-alt-corrected-3-capt ge 10000 + + + /systems/navigation/adr/operating-1 eq 0 + /systems/navigation/adr/operating-2 eq 0 + /systems/navigation/adr/operating-3 eq 0 + + + /ECAM/warnings/logic/press/excess-cabin-alt eq 1 + /ECAM/warnings/logic/press/excess-cabin-alt-pulse eq 1 + + + + + + + + + /systems/navigation/adr/computation/baro-alt-corrected-1-capt ge 16000 + /systems/navigation/adr/computation/baro-alt-corrected-2-capt ge 16000 + /systems/navigation/adr/computation/baro-alt-corrected-3-capt ge 16000 + + + /systems/navigation/adr/operating-1 eq 0 + /systems/navigation/adr/operating-2 eq 0 + /systems/navigation/adr/operating-3 eq 0 + + + /ECAM/warnings/logic/press/excess-cabin-alt eq 1 + /ECAM/warnings/logic/press/excess-cabin-alt-pulse eq 1 + + + + + + + /ECAM/warnings/logic/phase-3-10-pulse-input eq 1 + /ECAM/warnings/logic/phase-3-10-pulse eq 1 + + + diff --git a/Systems/ecam-proprules.xml b/Systems/ecam-proprules.xml index 2d30dc21..fe3297cf 100644 --- a/Systems/ecam-proprules.xml +++ b/Systems/ecam-proprules.xml @@ -630,6 +630,17 @@ /ECAM/warnings/logic/phase-9-pulse + + monostable + + + /ECAM/warnings/logic/phase-3-10-pulse-input + + /ECAM/warnings/logic/phase-3-10-pulse + + monostable + + monostable + + + /ECAM/warnings/logic/press/excess-cabin-alt + + /ECAM/warnings/logic/press/excess-cabin-alt-pulse + + monostable + + + SR + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop-set + + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop-reset + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop + + + + SR + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop-top-set + + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop-reset + + /ECAM/warnings/logic/press/excess-cabin-alt-flipflop-top +