From 34f949f937b85792f6345970e6b9a8aca654c460 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Tue, 2 Feb 2021 19:46:20 +0000 Subject: [PATCH] Add GEN 1 / 2 OFF warnings, WING TK LO LVL warnings, and fix warning for lbs / kgs, add CTR TK OFF warning --- Nasal/ECAM/ECAM-controller.nas | 4 + Nasal/ECAM/ECAM-logic.nas | 146 ++++++++++++++++++++++++- Nasal/ECAM/ECAM-messages.nas | 39 +++++-- Systems/a320-fwc.xml | 188 ++++++++++++++++++++++++++++----- 4 files changed, 341 insertions(+), 36 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index d43f5947..aedd52cf 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -99,6 +99,8 @@ var warningNodes = { eng1Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-shutdown"), eng2Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-shutdown"), acEssBusAltn: props.globals.initNode("/ECAM/warnings/logic/ac-ess-bus-altn-feed"), + gen1Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-1-off"), + gen2Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-2-off"), spdBrkOut: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-still-out"), }, Timers: { @@ -146,6 +148,8 @@ var warningNodes = { acEssFault: props.globals.initNode("/ECAM/warnings/logic/ac-ess-output"), dcEssShed: props.globals.initNode("/ECAM/warnings/logic/dc-ess-shed-output"), acEssShed: props.globals.initNode("/ECAM/warnings/logic/ac-ess-shed-output"), + centerPumpsOff: props.globals.initNode("/ECAM/warnings/fuel/center-pumps-off-output"), + lowLevelBoth: props.globals.initNode("/ECAM/warnings/fuel/lo-level-l-r-output"), }, Flipflops: { apuGenFault: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault"), diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 99c3478c..15c6177e 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -10,6 +10,7 @@ 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 acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); var state1Node = props.globals.getNode("/engines/engine[0]/state", 1); var state2Node = props.globals.getNode("/engines/engine[1]/state", 1); var wing_pb = props.globals.getNode("/controls/ice-protection/wing", 1); @@ -1938,6 +1939,14 @@ var messages_priority_2 = func { ECAM_controller.warningReset(gen1faultGen3); } + # ESS TR FAULT + if (essTRFault.clearFlag == 0 and systems.ELEC.Fail.essTrFault.getValue() and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { + essTRFault.active = 1; + } else { + ECAM_controller.warningReset(essTRFault); + } + + # GEN 2 FAULT if (gen2fault.clearFlag == 0 and warningNodes.Flipflops.gen2Fault.getValue() and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { gen2fault.active = 1; if (!warningNodes.Flipflops.gen2FaultOnOff.getValue()) { @@ -1982,6 +1991,19 @@ var messages_priority_2 = func { ECAM_controller.warningReset(apuGenfaultGen3); } + # GEN OFF + if (gen1Off.clearFlag == 0 and warningNodes.Logic.gen1Off.getValue() and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { + gen1Off.active = 1; + } else { + ECAM_controller.warningReset(gen1Off); + } + + if (gen2Off.clearFlag == 0 and warningNodes.Logic.gen2Off.getValue() and (phaseVar2 == 2 or phaseVar2 == 3 or phaseVar2 == 6 or phaseVar2 == 9)) { + gen2Off.active = 1; + } else { + ECAM_controller.warningReset(gen2Off); + } + # ELEC AC ESS BUS ALTN if (acEssBusAltn.clearFlag == 0 and warningNodes.Logic.acEssBusAltn.getValue() and (phaseVar2 >= 9 or phaseVar2 <= 2)) { acEssBusAltn.active = 1; @@ -2260,6 +2282,119 @@ var messages_priority_2 = func { ECAM_controller.warningReset(fcuFault2Baro); } + # FUEL + if (wingLoLvl.clearFlag == 0 and warningNodes.Timers.lowLevelBoth.getValue() == 1 and (phaseVar2 <= 2 or phaseVar2 == 6 or phaseVar2 >= 9)) { + wingLoLvl.active = 1; + + if (wingLoLvlManMode.clearFlag == 0 and systems.FUEL.Switches.centerTkMode.getValue() == 0 and systems.FUEL.Quantity.center.getValue() >= 550) { + wingLoLvlManMode.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlManMode); + } + + if (wingLoLvlPumpL1.clearFlag == 0 and !systems.FUEL.Switches.pumpLeft1.getValue()) { + wingLoLvlPumpL1.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpL1); + } + + if (wingLoLvlPumpL2.clearFlag == 0 and !systems.FUEL.Switches.pumpLeft2.getValue()) { + wingLoLvlPumpL2.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpL2); + } + + if (wingLoLvlPumpC1.clearFlag == 0 and !systems.FUEL.Switches.pumpCenter1.getValue()) { + wingLoLvlPumpC1.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpC1); + } + + if (wingLoLvlPumpR1.clearFlag == 0 and !systems.FUEL.Switches.pumpRight1.getValue()) { + wingLoLvlPumpR1.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpR1); + } + + if (wingLoLvlPumpR2.clearFlag == 0 and !systems.FUEL.Switches.pumpRight2.getValue()) { + wingLoLvlPumpR2.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpR2); + } + + if (wingLoLvlPumpC2.clearFlag == 0 and !systems.FUEL.Switches.pumpCenter2.getValue()) { + wingLoLvlPumpC2.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlPumpC2); + } + + if (systems.FUEL.Switches.crossfeed.getValue() == 0) { + if (wingLoLvlLeak.clearFlag == 0) { + wingLoLvlLeak.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlLeak); + } + + if (wingLoLvlXFeed.clearFlag == 0) { + wingLoLvlXFeed.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlXFeed); + } + } else { + ECAM_controller.warningReset(wingLoLvlLeak); + ECAM_controller.warningReset(wingLoLvlXFeed); + } + + if (systems.FUEL.Switches.crossfeed.getValue() == 1) { + if (wingLoLvlGrav.clearFlag == 0) { + wingLoLvlGrav.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlGrav); + } + + if (wingLoLvlXFeedOff.clearFlag == 0) { + wingLoLvlXFeedOff.active = 1; + } else { + ECAM_controller.warningReset(wingLoLvlXFeedOff); + } + } else { + ECAM_controller.warningReset(wingLoLvlGrav); + ECAM_controller.warningReset(wingLoLvlXFeedOff); + } + } else { + ECAM_controller.warningReset(wingLoLvl); + ECAM_controller.warningReset(wingLoLvlManMode); + ECAM_controller.warningReset(wingLoLvlPumpL1); + ECAM_controller.warningReset(wingLoLvlPumpL2); + ECAM_controller.warningReset(wingLoLvlPumpC1); + ECAM_controller.warningReset(wingLoLvlPumpR1); + ECAM_controller.warningReset(wingLoLvlPumpR2); + ECAM_controller.warningReset(wingLoLvlPumpC2); + ECAM_controller.warningReset(wingLoLvlLeak); + ECAM_controller.warningReset(wingLoLvlXFeed); + ECAM_controller.warningReset(wingLoLvlGrav); + ECAM_controller.warningReset(wingLoLvlXFeedOff); + } + + if (ctrPumpsOff.clearFlag == 0 and warningNodes.Timers.centerPumpsOff.getValue() == 1 and (phaseVar2 == 2 or phaseVar2 == 6)) { + ctrPumpsOff.active = 1; + + if (ctrPumpsOffPump1.clearFlag == 0 and !systems.FUEL.Switches.pumpCenter1.getValue()) { + ctrPumpsOffPump1.active = 1; + } else { + ECAM_controller.warningReset(ctrPumpsOffPump1); + } + if (ctrPumpsOffPump2.clearFlag == 0 and !systems.FUEL.Switches.pumpCenter2.getValue()) { + ctrPumpsOffPump2.active = 1; + } else { + ECAM_controller.warningReset(ctrPumpsOffPump2); + } + } else { + ECAM_controller.warningReset(ctrPumpsOff); + ECAM_controller.warningReset(ctrPumpsOffPump1); + ECAM_controller.warningReset(ctrPumpsOffPump2); + } + # APU EMER SHUT DOWN if (apuEmerShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and systems.APUController.APU.signals.emer and !getprop("/systems/fire/apu/warning-active") and (phaseVar2 == 6 or phaseVar2 >= 9 or phaseVar2 <= 2)) { apuEmerShutdown.active = 1; @@ -3234,10 +3369,17 @@ var messages_memo = func { outr_tk_fuel_xfrd.active = 0; } - if (pts.Consumables.Fuel.totalFuelLbs.getValue() < 6000 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb - fob_3T.active = 1; + if (pts.Consumables.Fuel.totalFuelLbs.getValue() < 6613 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # assuming US short ton 2000lb + if (acconfig_weight_kgs.getValue()) { + fob_3T.active = 1; + fob_66L.active = 0; + } else { + fob_3T.active = 0; + fob_66L.active = 1; + } } else { fob_3T.active = 0; + fob_66L.active = 0; } if (getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index f0fc3232..a0d2c854 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -449,21 +449,28 @@ var warnings = std.Vector.new([ # GEN 1 FAULT var gen1fault = warning.new(msg: "ELEC GEN 1 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var gen1faultGen = warning.new(msg: "-GEN 1......OFF THEN ON", colour: "c"), + var gen1faultGen = warning.new(msg: " -GEN 1......OFF THEN ON", colour: "c"), var gen1faultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), - var gen1faultGen3 = warning.new(msg: "-GEN 1..............OFF", colour: "c"), + var gen1faultGen3 = warning.new(msg: " -GEN 1..............OFF", colour: "c"), + + # ESS TR FAULT + var essTRFault = warning.new(msg: "ELEC ESS TR FAULT ", colour: "a", aural: 1, light: 1, isMainMsg: 1), # GEN 2 FAULT var gen2fault = warning.new(msg: "ELEC GEN 2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var gen2faultGen = warning.new(msg: "-GEN 2......OFF THEN ON", colour: "c"), + var gen2faultGen = warning.new(msg: " -GEN 2......OFF THEN ON", colour: "c"), var gen2faultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), - var gen2faultGen3 = warning.new(msg: "-GEN 2..............OFF", colour: "c"), + var gen2faultGen3 = warning.new(msg: " -GEN 2..............OFF", colour: "c"), # APU GEN FAULT var apuGenfault = warning.new(msg: "ELEC APU GEN FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1), - var apuGenfaultGen = warning.new(msg: "-APU GEN....OFF THEN ON", colour: "c"), + var apuGenfaultGen = warning.new(msg: " -APU GEN....OFF THEN ON", colour: "c"), var apuGenfaultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"), - var apuGenfaultGen3 = warning.new(msg: "-APU GEN............OFF", colour: "c"), + var apuGenfaultGen3 = warning.new(msg: " -APU GEN............OFF", colour: "c"), + + # GEN OFF + var gen1Off = warning.new(msg: "ELEC GEN 1 OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var gen2Off = warning.new(msg: "ELEC GEN 2 OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1), # APU GEN FAULT var acEssBusAltn = warning.new(msg: "ELEC AC ESS BUS ALTN", colour: "a", aural: 1, light: 1, isMainMsg: 1), @@ -551,6 +558,24 @@ var warnings = std.Vector.new([ var fcuFault2 = warning.new(msg: "AUTO FLT FCU 2 FAULT", colour: "a", isMainMsg: 1), var fcuFault2Baro = warning.new(msg: " -BARO REF.......X CHECK", colour: "c"), + # FUEL + var wingLoLvl = warning.new(msg: "FUEL L+R WING TK LO LVL", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var wingLoLvlManMode = warning.new(msg: " -FUEL MODE SEL......MAN", colour: "c"), + var wingLoLvlPumpL1 = warning.new(msg: " -L TK PUMP 1.........ON", colour: "c"), + var wingLoLvlPumpL2 = warning.new(msg: " -L TK PUMP 2.........ON", colour: "c"), + var wingLoLvlPumpC1 = warning.new(msg: " -CTR TK PUMP 1.......ON", colour: "c"), + var wingLoLvlPumpR1 = warning.new(msg: " -R TK PUMP 1.........ON", colour: "c"), + var wingLoLvlPumpR2 = warning.new(msg: " -R TK PUMP 2.........ON", colour: "c"), + var wingLoLvlPumpC2 = warning.new(msg: " -CTR TK PUMP 2.......ON", colour: "c"), + var wingLoLvlLeak = warning.new(msg: " •IF NO FUEL LEAK: ", colour: "w"), + var wingLoLvlXFeed = warning.new(msg: " -FUEL X FEED.........ON", colour: "c"), + var wingLoLvlGrav = warning.new(msg: " •IF GRVTY FEED: ", colour: "w"), + var wingLoLvlXFeedOff = warning.new(msg: " -FUEL X FEED........OFF", colour: "c"), + + var ctrPumpsOff = warning.new(msg: "FUEL CTR TK PUMPS OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1), + var ctrPumpsOffPump1 = warning.new(msg: " -CTR TK PUMP 1.......ON", colour: "c"), + var ctrPumpsOffPump2 = warning.new(msg: " -CTR TK PUMP 2.......ON", colour: "c"), + # APU shutdown var apuEmerShutdown = warning.new(msg: "APU EMER SHUT DOWN", colour: "a", aural: 1, light: 1, isMainMsg: 1), var apuEmerShutdownMast = warning.new(msg: " -MASTER SW..........OFF", colour: "c"), @@ -734,9 +759,11 @@ var leftmemos = std.Vector.new([ var strobe_lt_off = warning.new(msg: "STROBE LT OFF" ), var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD" ), var fob_3T = warning.new(msg: "FOB BELOW 3T" ), + var fob_66L = warning.new(msg: "FOB BELOW 6600LBS" ), var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF" ), var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY" ), # Not yet implemented var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY"), # Not yet implemented + var acars_stby = warning.new(msg: "ACARS STBY" ), # Not yet implemented ]); # Right E/WD diff --git a/Systems/a320-fwc.xml b/Systems/a320-fwc.xml index f2fb337f..c683e0e0 100644 --- a/Systems/a320-fwc.xml +++ b/Systems/a320-fwc.xml @@ -348,27 +348,6 @@ 1.0 - - Timer for the ECAM system - /ECAM/warnings/logic/gen-1-fault-set - 120 - 0.1818 - - - - Timer for the ECAM system - /ECAM/warnings/logic/gen-2-fault-set - 120 - 0.1818 - - - - Timer for the ECAM system - /ECAM/warnings/logic/apu-gen-fault-set - 120 - 0.2 - - Timer for the ECAM system /ECAM/warnings/logic/apu-gen-fault-reset @@ -1531,6 +1510,13 @@ + + Timer for the ECAM system + /ECAM/warnings/logic/gen-1-fault-set + 120 + 0.1818 + + @@ -1592,6 +1578,13 @@ + + Timer for the ECAM system + /ECAM/warnings/logic/gen-2-fault-set + 120 + 0.1818 + + @@ -1652,6 +1645,13 @@ + + Timer for the ECAM system + /ECAM/warnings/logic/apu-gen-fault-set + 120 + 0.2 + + @@ -1693,6 +1693,93 @@ + + /controls/electrical/switches/gen-1 + 0.2 + 120 + + + + /controls/electrical/switches/gen-2 + 0.2 + 120 + + + + + + /ECAM/warning-phase eq 6 + + + + + /ECAM/warnings/logic/elec/gen-off-60-sec + 0.01666666666 + 120 + + + + + + /ECAM/warning-phase ne 6 + /engines/engine[0]/state eq 3 + + + + + /ECAM/warnings/logic/elec/gen-1-off-60-sec-2 + 0.01666666666 + 120 + + + + + + /ECAM/warning-phase ne 6 + /engines/engine[1]/state eq 3 + + + + + /ECAM/warnings/logic/elec/gen-2-off-60-sec-2 + 0.01666666666 + 120 + + + + + + /ECAM/warnings/logic/elec/gen-1-pb eq 0 + /ECAM/warnings/flipflop/gen-1-fault eq 0 + /controls/electrical/switches/idg-1-disc eq 1 + + /ECAM/warnings/logic/elec/gen-off-60-sec-output eq 1 + /ECAM/warnings/logic/elec/gen-1-off-60-sec-2-output eq 1 + + /ECAM/warning-phase eq 6 + /ECAM/warnings/logic/gen-1-2-no-oper eq 1 + + + + + + + + + /ECAM/warnings/logic/elec/gen-2-pb eq 0 + /ECAM/warnings/flipflop/gen-2-fault eq 0 + /controls/electrical/switches/idg-2-disc eq 1 + + /ECAM/warnings/logic/elec/gen-off-60-sec-output eq 1 + /ECAM/warnings/logic/elec/gen-2-off-60-sec-2-output eq 1 + + /ECAM/warning-phase eq 6 + /ECAM/warnings/logic/gen-1-2-no-oper eq 1 + + + + + @@ -1710,6 +1797,22 @@ + + + + + /ECAM/warnings/flipflop/gen-1-fault eq 1 + /controls/electrical/switches/idg-1-disc eq 0 + /ECAM/warnings/logic/elec/gen-1-off eq 1 + + + /ECAM/warnings/flipflop/gen-2-fault eq 1 + /controls/electrical/switches/idg-2-disc eq 0 + /ECAM/warnings/logic/elec/gen-2-off eq 1 + + + + @@ -2109,13 +2212,6 @@ - - Timer for the ECAM system - /ECAM/phases/timer/eng1idle - 120 - 0.033 - - @@ -3717,6 +3813,42 @@ + + + + + + /controls/fuel/switches/pump-center-1 eq 0 + /controls/fuel/switches/pump-center-2 eq 0 + /controls/fuel/switches/center-mode eq 1 + /systems/fuel/quantity/center-low eq 0 + /ECAM/warning-phase eq 6 + + + + + + /ECAM/warnings/fuel/center-pumps-off + 120 + 0.1 + + + + + + /systems/fuel/quantity/left-wing-inner-low eq 1 + /systems/fuel/quantity/right-wing-inner-low eq 1 + + + + + /ECAM/warnings/fuel/lo-level-l-r + 120 + 0.03333333333 + + + +