diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 9375bb14..d5d82df3 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -94,6 +94,8 @@ var warningNodes = { eng1Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-fail"), eng2Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-fail"), phase5Trans: props.globals.initNode("/ECAM/warnings/logic/eng/phase-5-output"), + eng1Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-shutdown"), + eng2Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-shutdown"), }, 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 ebba38ce..916d229d 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -1292,6 +1292,111 @@ var messages_priority_2 = func { ECAM_controller.warningReset(eng1FailRelight); } + if (warningNodes.Logic.eng1Shutdown.getValue() and eng1ShutDown.clearFlag == 0) { + eng1ShutDown.active = 1; + + if (phaseVar2 != 4 and phaseVar2 != 5 and systems.fireButtons[0].getValue() == 0 and (systems.PNEU.Valves.wingLeft.getValue() or systems.PNEU.Valves.wingRight.getValue())) { + if (eng1ShutDownPack.clearFlag == 0 and systems.PNEU.Switch.pack1.getValue() and systems.PNEU.Switch.pack2.getValue()) { + eng1ShutDownPack.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownPack); + } + + if (eng1ShutDownXBleed.clearFlag == 0 and systems.PNEU.Valves.crossbleed.getValue() == 0) { + eng1ShutDownXBleed.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownXBleed); + } + } else { + ECAM_controller.warningReset(eng1ShutDownPack); + ECAM_controller.warningReset(eng1ShutDownXBleed); + } + + if (FWC.Timer.gnd.getValue() == 0 or systems.fireButtons[0].getValue() == 0) { + if (eng1ShutDownModeSel.clearFlag == 0 and pts.Controls.Engines.startSw.getValue() != 2) { + eng1ShutDownModeSel.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownModeSel); + } + + if (systems.FUEL.Switches.crossfeed.getValue() == 0) { + if (eng1ShutDownFuelLeak.clearFlag == 0) { + eng1ShutDownFuelLeak.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownFuelLeak); + } + + if (eng1ShutDownImbalance.clearFlag == 0) { + eng1ShutDownImbalance.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownImbalance); + } + } else { + ECAM_controller.warningReset(eng1ShutDownFuelLeak); + ECAM_controller.warningReset(eng1ShutDownImbalance); + } + } else { + ECAM_controller.warningReset(eng1ShutDownModeSel); + ECAM_controller.warningReset(eng1ShutDownFuelLeak); + ECAM_controller.warningReset(eng1ShutDownImbalance); + } + + if (eng1ShutDownTCAS.clearFlag == 0 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 2) { + eng1ShutDownTCAS.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownTCAS); + } + + if (0 == 1 and eng1ShutDownBuffet.clearFlag == 0) { # reverser unlocked + eng1ShutDownBuffet.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownBuffet); + } + + if (0 == 1 and eng1ShutDownSpeed.clearFlag == 0) { + eng1ShutDownSpeed.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownSpeed); + } + + if (systems.fireButtons[0].getValue() == 1) { + if (eng1ShutDownXBleedS.clearFlag == 0 and systems.PNEU.Valves.crossbleed.getValue() != 0) { + eng1ShutDownXBleedS.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownXBleedS); + } + + if (eng1ShutDownWingAI.clearFlag == 0 and (systems.PNEU.Valves.wingLeft.getValue() or systems.PNEU.Valves.wingRight.getValue())) { + eng1ShutDownWingAI.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownWingAI); + } + + if (eng1ShutDownIcing.clearFlag == 0) { + eng1ShutDownIcing.active = 1; + } else { + ECAM_controller.warningReset(eng1ShutDownIcing); + } + } else { + ECAM_controller.warningReset(eng1ShutDownXBleedS); + ECAM_controller.warningReset(eng1ShutDownWingAI); + ECAM_controller.warningReset(eng1ShutDownIcing); + } + } else { + ECAM_controller.warningReset(eng1ShutDown); + ECAM_controller.warningReset(eng1ShutDownPack); + ECAM_controller.warningReset(eng1ShutDownXBleed); + ECAM_controller.warningReset(eng1ShutDownModeSel); + ECAM_controller.warningReset(eng1ShutDownImbalance); + ECAM_controller.warningReset(eng1ShutDownTCAS); + ECAM_controller.warningReset(eng1ShutDownFuelLeak); + ECAM_controller.warningReset(eng1ShutDownBuffet); + ECAM_controller.warningReset(eng1ShutDownSpeed); + ECAM_controller.warningReset(eng1ShutDownXBleedS); + ECAM_controller.warningReset(eng1ShutDownWingAI); + ECAM_controller.warningReset(eng1ShutDownIcing); + } + if (warningNodes.Logic.eng2Fail.getValue() and eng2Fail.clearFlag == 0) { eng2Fail.active = 1; @@ -1394,6 +1499,117 @@ var messages_priority_2 = func { ECAM_controller.warningReset(eng2FailRelight); } + if (warningNodes.Logic.eng2Shutdown.getValue() and eng2ShutDown.clearFlag == 0) { + eng2ShutDown.active = 1; + + if (phaseVar2 != 4 and phaseVar2 != 5 and systems.fireButtons[1].getValue() == 0 and (systems.PNEU.Valves.wingLeft.getValue() or systems.PNEU.Valves.wingRight.getValue())) { + if (eng2ShutDownPack1.clearFlag == 0 and systems.ELEC.EmerElec.getValue() and systems.PNEU.Switch.pack1.getValue() and systems.PNEU.Switch.pack2.getValue()) { + eng2ShutDownPack1.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownPack1); + } + + if (eng2ShutDownPack.clearFlag == 0 and !systems.ELEC.EmerElec.getValue() and systems.PNEU.Switch.pack1.getValue() and systems.PNEU.Switch.pack2.getValue()) { + eng2ShutDownPack.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownPack); + } + + if (eng2ShutDownXBleed.clearFlag == 0 and systems.PNEU.Valves.crossbleed.getValue() == 0) { + eng2ShutDownXBleed.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownXBleed); + } + } else { + ECAM_controller.warningReset(eng2ShutDownPack); + ECAM_controller.warningReset(eng2ShutDownXBleed); + } + + if (FWC.Timer.gnd.getValue() == 0 or systems.fireButtons[1].getValue() == 0) { + if (eng2ShutDownModeSel.clearFlag == 0 and pts.Controls.Engines.startSw.getValue() != 2) { + eng2ShutDownModeSel.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownModeSel); + } + + if (systems.FUEL.Switches.crossfeed.getValue() == 0) { + if (eng2ShutDownFuelLeak.clearFlag == 0) { + eng2ShutDownFuelLeak.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownFuelLeak); + } + + if (eng2ShutDownImbalance.clearFlag == 0) { + eng2ShutDownImbalance.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownImbalance); + } + } else { + ECAM_controller.warningReset(eng2ShutDownFuelLeak); + ECAM_controller.warningReset(eng2ShutDownImbalance); + } + } else { + ECAM_controller.warningReset(eng2ShutDownModeSel); + ECAM_controller.warningReset(eng2ShutDownFuelLeak); + ECAM_controller.warningReset(eng2ShutDownImbalance); + } + + if (eng2ShutDownTCAS.clearFlag == 0 and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 2) { + eng2ShutDownTCAS.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownTCAS); + } + + if (0 == 1 and eng2ShutDownBuffet.clearFlag == 0) { # reverser unlocked + eng2ShutDownBuffet.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownBuffet); + } + + if (0 == 1 and eng2ShutDownSpeed.clearFlag == 0) { + eng2ShutDownSpeed.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownSpeed); + } + + if (systems.fireButtons[1].getValue() == 1) { + if (eng2ShutDownXBleedS.clearFlag == 0 and systems.PNEU.Valves.crossbleed.getValue() != 0) { + eng2ShutDownXBleedS.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownXBleedS); + } + + if (eng2ShutDownWingAI.clearFlag == 0 and (systems.PNEU.Valves.wingLeft.getValue() or systems.PNEU.Valves.wingRight.getValue())) { + eng2ShutDownWingAI.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownWingAI); + } + + if (eng2ShutDownIcing.clearFlag == 0) { + eng2ShutDownIcing.active = 1; + } else { + ECAM_controller.warningReset(eng2ShutDownIcing); + } + } else { + ECAM_controller.warningReset(eng2ShutDownXBleedS); + ECAM_controller.warningReset(eng2ShutDownWingAI); + ECAM_controller.warningReset(eng2ShutDownIcing); + } + } else { + ECAM_controller.warningReset(eng2ShutDown); + ECAM_controller.warningReset(eng2ShutDownPack); + ECAM_controller.warningReset(eng2ShutDownXBleed); + ECAM_controller.warningReset(eng2ShutDownModeSel); + ECAM_controller.warningReset(eng2ShutDownImbalance); + ECAM_controller.warningReset(eng2ShutDownTCAS); + ECAM_controller.warningReset(eng2ShutDownFuelLeak); + ECAM_controller.warningReset(eng2ShutDownBuffet); + ECAM_controller.warningReset(eng2ShutDownSpeed); + ECAM_controller.warningReset(eng2ShutDownXBleedS); + ECAM_controller.warningReset(eng2ShutDownWingAI); + ECAM_controller.warningReset(eng2ShutDownIcing); + } + # DC EMER CONFIG if (!systems.ELEC.EmerElec.getValue() and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar2 != 4 and phaseVar2 != 8 and dcEmerconfig.clearFlag == 0) { dcEmerconfig.active = 1; @@ -1875,7 +2091,7 @@ var messages_priority_2 = func { warningNodes.Timers.bleed1Fault.setValue(0); } - if (bleed1Fault.clearFlag == 0 and (phaseVar2 == 2 or phaseVar2 == 6 or phaseVar2 == 9) and warningNodes.Timers.bleed1FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/ice-protection/wing")))) { # inverse pulse + if (bleed1Fault.clearFlag == 0 and (phaseVar2 == 2 or phaseVar2 == 6 or phaseVar2 == 9) and warningNodes.Timers.bleed1FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and wing_pb.getValue()))) { # inverse pulse bleed1Fault.active = 1; } else { ECAM_controller.warningReset(bleed1Fault); @@ -1912,7 +2128,7 @@ var messages_priority_2 = func { warningNodes.Timers.bleed2Fault.setValue(0); } - if (bleed2Fault.clearFlag == 0 and (phaseVar2 == 2 or phaseVar2 == 6 or phaseVar2 == 9) and warningNodes.Timers.bleed2FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/ice-protection/wing")))) { # inverse pulse + if (bleed2Fault.clearFlag == 0 and (phaseVar2 == 2 or phaseVar2 == 6 or phaseVar2 == 9) and warningNodes.Timers.bleed2FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and wing_pb.getValue()))) { # inverse pulse bleed2Fault.active = 1; } else { ECAM_controller.warningReset(bleed2Fault); @@ -2430,7 +2646,7 @@ var messages_priority_2 = func { } else { ECAM_controller.warningReset(wingIceSysFaultXbld); } - if ((warningNodes.Logic.waiLclosed.getValue() or warningNodes.Logic.waiRclosed.getValue()) and getprop("/controls/ice-protection/wing")) { + if ((warningNodes.Logic.waiLclosed.getValue() or warningNodes.Logic.waiRclosed.getValue()) and wing_pb.getValue()) { wingIceSysFaultOff.active = 1; } else { ECAM_controller.warningReset(wingIceSysFaultOff); @@ -2451,7 +2667,7 @@ var messages_priority_2 = func { if (wingIceOpenGnd.clearFlag == 0 and warningNodes.Logic.waiGndFlight.getValue() and (phaseVar2 <= 2 or phaseVar2 >= 9)) { wingIceOpenGnd.active = 1; - if (pts.Gear.wow[1].getValue() and getprop("/controls/ice-protection/wing")) { + if (pts.Gear.wow[1].getValue() and wing_pb.getValue()) { wingIceOpenGndShut.active = 1; } else { ECAM_controller.warningReset(wingIceOpenGndShut); @@ -2998,7 +3214,7 @@ var messages_right_memo = func { eng_aice.active = 0; } - if (getprop("/controls/ice-protection/wing") == 1) { + if (wing_pb.getValue() == 1) { wing_aice.active = 1; } else { wing_aice.active = 0; diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 41df8920..8f89e2cb 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -282,6 +282,20 @@ var warnings = std.Vector.new([ var eng1FailNoDamage = warning.new(msg: " IF NO DAMAGE : ", colour: "w"), var eng1FailRelight = warning.new(msg: " -ENG 1 RELIGHT.CONSIDER", colour: "c"), + # ENG 1 SHUT DOWN + var eng1ShutDown = warning.new(msg: "ENG 1 SHUT DOWN ", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var eng1ShutDownPack = warning.new(msg: " -PACK 1.............OFF", colour: "c"), + var eng1ShutDownXBleed = warning.new(msg: " -X BLEED...........OPEN", colour: "c"), + var eng1ShutDownModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"), + var eng1ShutDownFuelLeak = warning.new(msg: " •IF NO FUEL LEAK :", colour: "w"), + var eng1ShutDownImbalance = warning.new(msg: " -IMBALANCE......MONITOR", colour: "c"), + var eng1ShutDownTCAS = warning.new(msg: " -TCAS MODE SEL.......TA", colour: "c"), + var eng1ShutDownBuffet = warning.new(msg: " •IF BUFFET : ", colour: "w"), + var eng1ShutDownSpeed = warning.new(msg: " MAX SPEED...........240", colour: "c"), + var eng1ShutDownXBleedS = warning.new(msg: " -X BLEED...........SHUT", colour: "c"), + var eng1ShutDownWingAI = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"), + var eng1ShutDownIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"), + # ENG 2 FAIL var eng2Fail = warning.new(msg: "ENG 2 FAIL ", colour: "a", aural: 1, light: 1, isMainMsg: 1), var thrustMalfunction2 = warning.new(msg: " THRUST MALFUNCTION ", colour: "a"), @@ -297,6 +311,21 @@ var warnings = std.Vector.new([ var eng2FailNoDamage = warning.new(msg: " IF NO DAMAGE : ", colour: "w"), var eng2FailRelight = warning.new(msg: " -ENG 2 RELIGHT.CONSIDER", colour: "c"), + # ENG 2 SHUT DOWN + var eng2ShutDown = warning.new(msg: "ENG 2 SHUT DOWN ", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var eng2ShutDownPack1 = warning.new(msg: " -PACK 1.............OFF", colour: "c"), + var eng2ShutDownPack = warning.new(msg: " -PACK 2.............OFF", colour: "c"), + var eng2ShutDownXBleed = warning.new(msg: " -X BLEED...........OPEN", colour: "c"), + var eng2ShutDownModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"), + var eng2ShutDownFuelLeak = warning.new(msg: " •IF NO FUEL LEAK :", colour: "w"), + var eng2ShutDownImbalance = warning.new(msg: " -IMBALANCE......MONITOR", colour: "c"), + var eng2ShutDownTCAS = warning.new(msg: " -TCAS MODE SEL.......TA", colour: "c"), + var eng2ShutDownBuffet = warning.new(msg: " •IF BUFFET : ", colour: "w"), + var eng2ShutDownSpeed = warning.new(msg: " MAX SPEED...........240", colour: "c"), + var eng2ShutDownXBleedS = warning.new(msg: " -X BLEED...........SHUT", colour: "c"), + var eng2ShutDownWingAI = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"), + var eng2ShutDownIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"), + # DC EMER CONFIG var dcEmerconfig = warning.new(msg: "ELEC DC EMER CONFIG", colour: "a", aural: 1, light: 1, isMainMsg: 1), var dcEmerconfigManOn = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"), diff --git a/Nasal/Panels/atc.nas b/Nasal/Panels/atc.nas index 5cf13a00..e6b192dc 100644 --- a/Nasal/Panels/atc.nas +++ b/Nasal/Panels/atc.nas @@ -20,13 +20,13 @@ var Transponder = { activeADIRS: 1, condition: 0, failed: 0, - codeDigitsNodes: [props.globals.getNode("instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[3]", 1)], - serviceableNode: props.globals.getNode("instrumentation/transponder/serviceable", 1), - knobNode: props.globals.getNode("instrumentation/transponder/inputs/knob-mode", 1), - identNode: props.globals.getNode("instrumentation/transponder/inputs/ident-btn", 1), + codeDigitsNodes: [props.globals.getNode("/instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[3]", 1)], + serviceableNode: props.globals.getNode("/instrumentation/transponder/serviceable", 1), + knobNode: props.globals.getNode("/instrumentation/transponder/inputs/knob-mode", 1), + identNode: props.globals.getNode("/instrumentation/transponder/inputs/ident-btn", 1), ac1Node: props.globals.getNode("/systems/electrical/bus/ac-1", 1), - tcasNode: props.globals.getNode("instrumentation/tcas/inputs/mode"), - aglNode: props.globals.getNode("position/gear-agl-ft", 1), + tcasNode: props.globals.getNode("/instrumentation/tcas/inputs/mode"), + aglNode: props.globals.getNode("/position/gear-agl-ft", 1), electricNode: props.globals.getNode("/systems/electrical/outputs/transponder", 1), # communicate to generic systems new: func(elecSrc, ADIRS) { var t = {parents:[Transponder]}; diff --git a/Nasal/Systems/pneumatics.nas b/Nasal/Systems/pneumatics.nas index d52864d0..eeb18b2e 100644 --- a/Nasal/Systems/pneumatics.nas +++ b/Nasal/Systems/pneumatics.nas @@ -99,6 +99,8 @@ var PNEU = { hotAir: props.globals.getNode("/systems/air-conditioning/valves/hot-air"), starter1: props.globals.getNode("/systems/pneumatics/valves/starter-valve-1"), starter2: props.globals.getNode("/systems/pneumatics/valves/starter-valve-2"), + wingLeft: props.globals.getNode("/systems/pneumatics/valves/wing-ice-1"), + wingRight: props.globals.getNode("/systems/pneumatics/valves/wing-ice-2"), }, pressMode: props.globals.getNode("/systems/pressurization/mode", 1), init: func() { diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index 0f633b54..c905cded 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -2422,6 +2422,56 @@ + + + + /ECAM/warning-phase eq 1 + /ECAM/warning-phase eq 2 + /ECAM/warning-phase eq 9 + /ECAM/warning-phase eq 10 + + + + + + + /ECAM/dual-failure-enabled eq 0 + + + + /ECAM/warnings/logic/eng/eng-shutdown-phase eq 1 + /ECAM/timer/ground-calc eq 0 + + /controls/engines/engine[0]/fire-btn eq 1 + + + /ECAM/warnings/logic/eng/eng-shutdown-phase eq 0 + /controls/engines/engine[0]/cutoff-switch eq 1 + + + + + + + + + /ECAM/dual-failure-enabled eq 0 + + + + /ECAM/warnings/logic/eng/eng-shutdown-phase eq 1 + /ECAM/timer/ground-calc eq 0 + + /controls/engines/engine[1]/fire-btn eq 1 + + + /ECAM/warnings/logic/eng/eng-shutdown-phase eq 0 + /controls/engines/engine[1]/cutoff-switch eq 1 + + + + +