From 402159dfa59314188987637ff5b548fe98b8e96a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Mon, 29 Apr 2019 17:21:17 +0100 Subject: [PATCH] apu autoshutdown improved, warning --- A320-main.xml | 3 + Models/Instruments/OHpanel/OHpanel.xml | 5 +- Nasal/ECAM/ECAM-logic.nas | 587 ++++++++++++++----------- Nasal/ECAM/ECAM-messages.nas | 12 +- Nasal/buttons.nas | 5 + Nasal/fire.nas | 10 +- 6 files changed, 343 insertions(+), 279 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 235129e0..19f681b1 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -783,6 +783,9 @@ 0 + + false + 0 diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index fa70921e..4e3c7667 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -5336,10 +5336,7 @@ APUMasterBtn1F - - systems/unused/unused-oh - 150 - + systems/apu/emer-shutdown controls/switches/annun-test 1 diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 890a5ef9..8b4c0183 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -221,91 +221,182 @@ var messages_priority_3 = func { } # ENG FIRE - if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) { - eng1FireFl.active = 1; + if ((eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) or (eng1FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7))) { + eng1Fire.active = 1; } else { - ECAM_controller.warningReset(eng1FireFl); + ECAM_controller.warningReset(eng1Fire); } - if (eng1FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine1/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7)) { - eng1FireGn.active = 1; + if ((eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) or (eng2FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7))) { + eng2Fire.active = 1; } else { - ECAM_controller.warningReset(eng1FireGn); + ECAM_controller.warningReset(eng2Fire); } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and phaseVar >= 5 and phaseVar <= 7) { - eng2FireFl.active = 1; - } else { - ECAM_controller.warningReset(eng2FireFl); - } - - if (eng2FireGnevacBat.clearFlag == 0 and getprop("/systems/fire/engine2/warning-active") == 1 and (phaseVar < 5 or phaseVar > 7)) { - eng2FireGn.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGn); - } - - if (apuFireMaster.clearFlag == 0 and getprop("/systems/fire/apu/warning-active") == 1) { + if (apuFireMaster.clearFlag == 0 and getprop("/systems/fire/apu/warning-active")) { apuFire.active = 1; } else { ECAM_controller.warningReset(apuFire); } - if (eng1FireFl.active == 1) { - if (eng1FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { - eng1FireFllever.active = 1; + if (eng1Fire.active == 1) { + if (phaseVar >= 5 and phaseVar <= 7) { + if (eng1FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { + eng1FireFllever.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFllever); + } + + if (eng1FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + eng1FireFlmaster.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlmaster); + } + + if (eng1FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + eng1FireFlPB.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlPB); + } + + if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + eng1FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; + } + + if (eng1FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + eng1FireFlAgent1Timer.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlAgent1Timer); + } + + if (eng1FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { + eng1FireFlAgent1.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlAgent1); + } + + if (eng1FireFlATC.clearFlag == 0) { + eng1FireFlATC.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlATC); + } + + if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { + eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; + } + + if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { + eng1FireFl30Sec.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFl30Sec); + } + + if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { + eng1FireFlAgent2.active = 1; + } else { + ECAM_controller.warningReset(eng1FireFlAgent2); + } } else { ECAM_controller.warningReset(eng1FireFllever); - } - - if (eng1FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { - eng1FireFlmaster.active = 1; - } else { ECAM_controller.warningReset(eng1FireFlmaster); - } - - if (eng1FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { - eng1FireFlPB.active = 1; - } else { ECAM_controller.warningReset(eng1FireFlPB); - } - - if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { - eng1FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; - } - - if (eng1FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { - eng1FireFlAgent1Timer.active = 1; - } else { - ECAM_controller.warningReset(eng1FireFlAgent1Timer); - } - - if (eng1FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { - eng1FireFlAgent1.active = 1; - } else { ECAM_controller.warningReset(eng1FireFlAgent1); - } - - if (eng1FireFlATC.clearFlag == 0) { - eng1FireFlATC.active = 1; - } else { ECAM_controller.warningReset(eng1FireFlATC); - } - - if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { - eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; - } - - if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { - eng1FireFl30Sec.active = 1; - } else { ECAM_controller.warningReset(eng1FireFl30Sec); + ECAM_controller.warningReset(eng1FireFlAgent2); } - if (eng1FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { - eng1FireFlAgent2.active = 1; + if (phaseVar < 5 or phaseVar > 7) { + if (eng1FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { + eng1FireGnlever.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnlever); + } + + if (eng1FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { + eng1FireGnstopped.active = 1; + eng1FireGnparkbrk.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnstopped); + ECAM_controller.warningReset(eng1FireGnparkbrk); + } + + if (eng1FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + eng1FireGnmaster.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnmaster); + } + + if (eng1FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + eng1FireGnPB.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnPB); + } + + if (eng1FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { + eng1FireGnAgent1.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnAgent1); + } + + if (eng1FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { + eng1FireGnAgent2.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnAgent2); + } + + if (eng1FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { + eng1FireGnmaster2.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnmaster2); + } + + if (eng1FireGnATC.clearFlag == 0) { + eng1FireGnATC.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnATC); + } + + if (eng1FireGncrew.clearFlag == 0) { + eng1FireGncrew.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGncrew); + } + + if (eng1FireGnevacSw.clearFlag == 0) { + eng1FireGnevac.active = 1; + eng1FireGnevacSw.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnevac); + ECAM_controller.warningReset(eng1FireGnevacSw); + } + + if (eng1FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) { + eng1FireGnevacApu.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnevacApu); + } + + if (eng1FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) { + eng1FireGnevacBat.active = 1; + } else { + ECAM_controller.warningReset(eng1FireGnevacBat); + } } else { - ECAM_controller.warningReset(eng1FireFlAgent2); + ECAM_controller.warningReset(eng1FireGnlever); + ECAM_controller.warningReset(eng1FireGnstopped); + ECAM_controller.warningReset(eng1FireGnparkbrk); + ECAM_controller.warningReset(eng1FireGnmaster); + ECAM_controller.warningReset(eng1FireGnPB); + ECAM_controller.warningReset(eng1FireGnAgent1); + ECAM_controller.warningReset(eng1FireGnAgent2); + ECAM_controller.warningReset(eng1FireGnmaster2); + ECAM_controller.warningReset(eng1FireGnATC); + ECAM_controller.warningReset(eng1FireGncrew); + ECAM_controller.warningReset(eng1FireGnevac); + ECAM_controller.warningReset(eng1FireGnevacSw); + ECAM_controller.warningReset(eng1FireGnevacApu); + ECAM_controller.warningReset(eng1FireGnevacBat); } } else { ECAM_controller.warningReset(eng1FireFllever); @@ -315,85 +406,6 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng1FireFlATC); ECAM_controller.warningReset(eng1FireFl30Sec); ECAM_controller.warningReset(eng1FireFlAgent2); - } - - if (eng1FireGn.active == 1) { - if (eng1FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { - eng1FireGnlever.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnlever); - } - - if (eng1FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { - eng1FireGnstopped.active = 1; - eng1FireGnparkbrk.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnstopped); - ECAM_controller.warningReset(eng1FireGnparkbrk); - } - - if (eng1FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { - eng1FireGnmaster.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnmaster); - } - - if (eng1FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { - eng1FireGnPB.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnPB); - } - - if (eng1FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { - eng1FireGnAgent1.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnAgent1); - } - - if (eng1FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { - eng1FireGnAgent2.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnAgent2); - } - - if (eng1FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { - eng1FireGnmaster2.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnmaster2); - } - - if (eng1FireGnATC.clearFlag == 0) { - eng1FireGnATC.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnATC); - } - - if (eng1FireGncrew.clearFlag == 0) { - eng1FireGncrew.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGncrew); - } - - if (eng1FireGnevacSw.clearFlag == 0) { - eng1FireGnevac.active = 1; - eng1FireGnevacSw.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnevac); - ECAM_controller.warningReset(eng1FireGnevacSw); - } - - if (eng1FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) { - eng1FireGnevacApu.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnevacApu); - } - - if (eng1FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) { - eng1FireGnevacBat.active = 1; - } else { - ECAM_controller.warningReset(eng1FireGnevacBat); - } - } else { ECAM_controller.warningReset(eng1FireGnlever); ECAM_controller.warningReset(eng1FireGnstopped); ECAM_controller.warningReset(eng1FireGnparkbrk); @@ -410,61 +422,164 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng1FireGnevacBat); } - if (eng2FireFl.active == 1) { - if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { - eng2FireFllever.active = 1; + if (eng2Fire.active == 1) { + if (phaseVar >= 5 and phaseVar <= 7) { + if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { + eng2FireFllever.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFllever); + } + + if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + eng2FireFlmaster.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlmaster); + } + + if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + eng2FireFlPB.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlPB); + } + + if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; + } + + if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + eng2FireFlAgent1Timer.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlAgent1Timer); + } + + if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { + eng2FireFlAgent1.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlAgent1); + } + + if (eng2FireFlATC.clearFlag == 0) { + eng2FireFlATC.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlATC); + } + + if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { + eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; + } + + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { + eng2FireFl30Sec.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFl30Sec); + } + + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { + eng2FireFlAgent2.active = 1; + } else { + ECAM_controller.warningReset(eng2FireFlAgent2); + } } else { ECAM_controller.warningReset(eng2FireFllever); - } - - if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { - eng2FireFlmaster.active = 1; - } else { ECAM_controller.warningReset(eng2FireFlmaster); - } - - if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { - eng2FireFlPB.active = 1; - } else { ECAM_controller.warningReset(eng2FireFlPB); - } - - if (getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { - eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine2/agent1-timer") ~ " S...DISCH"; - } - - if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 1 and !getprop("/systems/fire/engine2/disch1") and getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { - eng2FireFlAgent1Timer.active = 1; - } else { - ECAM_controller.warningReset(eng2FireFlAgent1Timer); - } - - if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1") and (getprop("/systems/fire/engine2/agent1-timer") == 0 or getprop("/systems/fire/engine2/agent1-timer") == 99)) { - eng2FireFlAgent1.active = 1; - } else { ECAM_controller.warningReset(eng2FireFlAgent1); - } - - if (eng2FireFlATC.clearFlag == 0) { - eng2FireFlATC.active = 1; - } else { ECAM_controller.warningReset(eng2FireFlATC); - } - - if (getprop("/systems/fire/engine2/agent2-timer") != 0 and getprop("/systems/fire/engine2/agent2-timer") != 99) { - eng1FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine2/agent2-timer") ~ " S:"; - } - - if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2") and getprop("/systems/fire/engine2/agent2-timer") > 0) { - eng2FireFl30Sec.active = 1; - } else { ECAM_controller.warningReset(eng2FireFl30Sec); + ECAM_controller.warningReset(eng2FireFlAgent2); } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2")) { - eng2FireFlAgent2.active = 1; + if (phaseVar < 5 or phaseVar > 7) { + if (eng2FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { + eng2FireGnlever.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnlever); + } + + if (eng2FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { + eng2FireGnstopped.active = 1; + eng2FireGnparkbrk.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnstopped); + ECAM_controller.warningReset(eng2FireGnparkbrk); + } + + if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + eng2FireGnmaster.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnmaster); + } + + if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + eng2FireGnPB.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnPB); + } + + if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { + eng2FireGnAgent1.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnAgent1); + } + + if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { + eng2FireGnAgent2.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnAgent2); + } + + if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { + eng2FireGnmaster2.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnmaster2); + } + + if (eng2FireGnATC.clearFlag == 0) { + eng2FireGnATC.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnATC); + } + + if (eng2FireGncrew.clearFlag == 0) { + eng2FireGncrew.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGncrew); + } + + if (eng2FireGnevacSw.clearFlag == 0) { + eng2FireGnevac.active = 1; + eng2FireGnevacSw.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnevac); + ECAM_controller.warningReset(eng2FireGnevacSw); + } + + if (eng2FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) { + eng2FireGnevacApu.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnevacApu); + } + + if (eng2FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) { + eng2FireGnevacBat.active = 1; + } else { + ECAM_controller.warningReset(eng2FireGnevacBat); + } } else { - ECAM_controller.warningReset(eng2FireFlAgent2); + ECAM_controller.warningReset(eng2FireGnlever); + ECAM_controller.warningReset(eng2FireGnstopped); + ECAM_controller.warningReset(eng2FireGnparkbrk); + ECAM_controller.warningReset(eng2FireGnmaster); + ECAM_controller.warningReset(eng2FireGnPB); + ECAM_controller.warningReset(eng2FireGnAgent1); + ECAM_controller.warningReset(eng2FireGnAgent2); + ECAM_controller.warningReset(eng2FireGnmaster2); + ECAM_controller.warningReset(eng2FireGnATC); + ECAM_controller.warningReset(eng2FireGncrew); + ECAM_controller.warningReset(eng2FireGnevac); + ECAM_controller.warningReset(eng2FireGnevacSw); + ECAM_controller.warningReset(eng2FireGnevacApu); + ECAM_controller.warningReset(eng2FireGnevacBat); } } else { ECAM_controller.warningReset(eng2FireFllever); @@ -474,85 +589,6 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireFlATC); ECAM_controller.warningReset(eng2FireFl30Sec); ECAM_controller.warningReset(eng2FireFlAgent2); - } - - if (eng2FireGn.active == 1) { - if (eng2FireGnlever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { - eng2FireGnlever.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnlever); - } - - if (eng2FireGnparkbrk.clearFlag == 0 and getprop("/controls/gear/brake-parking") == 0) { - eng2FireGnstopped.active = 1; - eng2FireGnparkbrk.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnstopped); - ECAM_controller.warningReset(eng2FireGnparkbrk); - } - - if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { - eng2FireGnmaster.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnmaster); - } - - if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { - eng2FireGnPB.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnPB); - } - - if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1")) { - eng2FireGnAgent1.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnAgent1); - } - - if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine2/disch2")) { - eng2FireGnAgent2.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnAgent2); - } - - if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { - eng2FireGnmaster2.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnmaster2); - } - - if (eng2FireGnATC.clearFlag == 0) { - eng2FireGnATC.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnATC); - } - - if (eng2FireGncrew.clearFlag == 0) { - eng2FireGncrew.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGncrew); - } - - if (eng2FireGnevacSw.clearFlag == 0) { - eng2FireGnevac.active = 1; - eng2FireGnevacSw.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnevac); - ECAM_controller.warningReset(eng2FireGnevacSw); - } - - if (eng2FireGnevacApu.clearFlag == 0 and getprop("/controls/APU/master") and getprop("/systems/apu/rpm") > 99) { - eng2FireGnevacApu.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnevacApu); - } - - if (eng2FireGnevacBat.clearFlag == 0 and (getprop("/controls/electrical/switches/battery1") or getprop("/controls/electrical/switches/battery2"))) { - eng2FireGnevacBat.active = 1; - } else { - ECAM_controller.warningReset(eng2FireGnevacBat); - } - } else { ECAM_controller.warningReset(eng2FireGnlever); ECAM_controller.warningReset(eng2FireGnstopped); ECAM_controller.warningReset(eng2FireGnparkbrk); @@ -699,7 +735,22 @@ var messages_priority_3 = func { } } -var messages_priority_2 = func {} +var messages_priority_2 = func { + if (apuEmerShutdown.clearFlag == 0 and systems.apuEmerShutdown.getBoolValue() and !getprop("/systems/fire/apu/warning-active") and (getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") >= 9 or getprop("/ECAM/warning-phase") <= 2)) { + apuEmerShutdown.active = 1; + } elsif (apuEmerShutdown.clearFlag == 1) { + ECAM_controller.warningReset(apuEmerShutdown); + apuEmerShutdown.hasSubmsg = 1; + } + + if (apuEmerShutdownMast.clearFlag == 0 and getprop("/controls/APU/master") and apuEmerShutdown.active == 1) { + apuEmerShutdownMast.active = 1; + } else { + ECAM_controller.warningReset(apuEmerShutdownMast); + apuEmerShutdown.hasSubmsg = 0; + } +} + var messages_priority_1 = func {} var messages_priority_0 = func {} diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 93211488..7e089801 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -43,7 +43,7 @@ var warnings = std.Vector.new([ var dualFailbatt = warning.new(msg: " -BAT 1+2............OFF", colour: "c"), # ENG 1 FIRE (flight) - var eng1FireFl = warning.new(msg: "ENG 1 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), + var eng1Fire = warning.new(msg: "ENG 1 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), var eng1FireFllever = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"), var eng1FireFlmaster = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"), var eng1FireFlPB = warning.new(msg: " -ENG 1 FIRE P/B....PUSH", colour: "c"), @@ -54,7 +54,6 @@ var warnings = std.Vector.new([ var eng1FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"), # ENG 1 FIRE (ground) - var eng1FireGn = warning.new(msg: "ENG 1 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), var eng1FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"), var eng1FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", hasSubmsg: 1), var eng1FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"), @@ -71,7 +70,7 @@ var warnings = std.Vector.new([ var eng1FireGnevacBat = warning.new(msg: " -BAT 1+2............OFF", colour: "c"), # ENG 2 FIRE (flight) - var eng2FireFl = warning.new(msg: "ENG 2 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), + var eng2Fire = warning.new(msg: "ENG 2 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), var eng2FireFllever = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"), var eng2FireFlmaster = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"), var eng2FireFlPB = warning.new(msg: " -ENG 2 FIRE P/B....PUSH", colour: "c"), @@ -82,7 +81,6 @@ var warnings = std.Vector.new([ var eng2FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"), # ENG 2 FIRE (ground) - var eng2FireGn = warning.new(msg: "ENG 2 FIRE", colour: "r", aural: 0, light: 0, hasSubmsg: 1), var eng2FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"), var eng2FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", hasSubmsg: 1), var eng2FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"), @@ -125,7 +123,11 @@ var warnings = std.Vector.new([ var athr_lock = warning.new(msg: "ENG THRUST LOCKED", colour: "a", aural: 1, light: 1), var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"), var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", colour: "a", aural: 1, light: 1), - var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c") + var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"), + + # APU shutdown + var apuEmerShutdown = warning.new(msg: "APU EMER SHUTDOWN", colour: "a", aural: 1, light: 1, hasSubmsg: 1), + var apuEmerShutdownMast = warning.new(msg: " -MASTER SW..........OFF", colour: "c"), ]); var leftmemos = std.Vector.new([ diff --git a/Nasal/buttons.nas b/Nasal/buttons.nas index 0bdb5a8e..9cff001f 100644 --- a/Nasal/buttons.nas +++ b/Nasal/buttons.nas @@ -725,6 +725,11 @@ var checkLockThr2 = func() { } } +setlistener("/controls/APU/master", func() { + if (!getprop("/controls/APU/master") and systems.apuEmerShutdown.getBoolValue()) { + systems.apuEmerShutdown.setBoolValue(0); + } +}, 0, 0); var lockTimer = maketimer(0.1, checkLockThr); var lockTimer2 = maketimer(0.1, checkLockThr2); \ No newline at end of file diff --git a/Nasal/fire.nas b/Nasal/fire.nas index eb51bdf2..2b673a8b 100644 --- a/Nasal/fire.nas +++ b/Nasal/fire.nas @@ -36,6 +36,7 @@ var testBtn2 = props.globals.getNode("/controls/fire/test-btn-2", 1); var eng1FireWarn = props.globals.initNode("/systems/fire/engine1/warning-active", 0, "BOOL"); var eng2FireWarn = props.globals.initNode("/systems/fire/engine2/warning-active", 0, "BOOL"); var apuFireWarn = props.globals.initNode("/systems/fire/apu/warning-active", 0, "BOOL"); +var apuEmerShutdown = props.globals.getNode("/systems/apu/emer-shutdown", 1); var eng1AgentTimer = props.globals.initNode("/systems/fire/engine1/agent1-timer", 99, "INT"); var eng2AgentTimer = props.globals.initNode("/systems/fire/engine2/agent1-timer", 99, "INT"); var eng1Agent2Timer = props.globals.initNode("/systems/fire/engine1/agent2-timer", 99, "INT"); @@ -313,9 +314,14 @@ var engFireDetectorUnit = { if (apuMaster.getBoolValue()) { apuBleedNode.setValue(0); systems.apu_stop(); - extinguisherBottles.vector[4].discharge(); + apuEmerShutdown.setBoolValue(1); + settimer(func() { + extinguisherBottles.vector[4].discharge(); + }, 2); } else { - extinguisherBottles.vector[4].discharge(); + settimer(func() { + extinguisherBottles.vector[4].discharge(); + }, 2); } } }