diff --git a/A320-100-CFM.xml b/A320-100-CFM.xml index 1e4664ce..9f7fbdfc 100644 --- a/A320-100-CFM.xml +++ b/A320-100-CFM.xml @@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> + diff --git a/A320-200-CFM.xml b/A320-200-CFM.xml index c572e6cc..ffb09dda 100644 --- a/A320-200-CFM.xml +++ b/A320-200-CFM.xml @@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> + diff --git a/A320-200-IAE.xml b/A320-200-IAE.xml index 2ac81e32..ae1aead8 100644 --- a/A320-200-IAE.xml +++ b/A320-200-IAE.xml @@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> + diff --git a/A320neo-CFM.xml b/A320neo-CFM.xml index ee19d068..a9518e0f 100644 --- a/A320neo-CFM.xml +++ b/A320neo-CFM.xml @@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> + diff --git a/A320neo-PW.xml b/A320neo-PW.xml index c59e0113..fe76f239 100644 --- a/A320neo-PW.xml +++ b/A320neo-PW.xml @@ -138,6 +138,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd"> + diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 30590b6b..81a3cfa2 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -237,7 +237,7 @@ var canvas_upperECAM_base = { if (line1c == "w") { me["ECAML1"].setColor(0.8078,0.8039,0.8078); - } else if (line1c == "b") { + } else if (line1c == "c") { me["ECAML1"].setColor(0.0901,0.6039,0.7176); } else if (line1c == "g") { me["ECAML1"].setColor(0.0509,0.7529,0.2941); @@ -249,7 +249,7 @@ var canvas_upperECAM_base = { if (line2c == "w") { me["ECAML2"].setColor(0.8078,0.8039,0.8078); - } else if (line2c == "b") { + } else if (line2c == "c") { me["ECAML2"].setColor(0.0901,0.6039,0.7176); } else if (line2c == "g") { me["ECAML2"].setColor(0.0509,0.7529,0.2941); @@ -261,7 +261,7 @@ var canvas_upperECAM_base = { if (line3c == "w") { me["ECAML3"].setColor(0.8078,0.8039,0.8078); - } else if (line3c == "b") { + } else if (line3c == "c") { me["ECAML3"].setColor(0.0901,0.6039,0.7176); } else if (line3c == "g") { me["ECAML3"].setColor(0.0509,0.7529,0.2941); @@ -273,7 +273,7 @@ var canvas_upperECAM_base = { if (line4c == "w") { me["ECAML4"].setColor(0.8078,0.8039,0.8078); - } else if (line4c == "b") { + } else if (line4c == "c") { me["ECAML4"].setColor(0.0901,0.6039,0.7176); } else if (line4c == "g") { me["ECAML4"].setColor(0.0509,0.7529,0.2941); @@ -285,7 +285,7 @@ var canvas_upperECAM_base = { if (line5c == "w") { me["ECAML5"].setColor(0.8078,0.8039,0.8078); - } else if (line5c == "b") { + } else if (line5c == "c") { me["ECAML5"].setColor(0.0901,0.6039,0.7176); } else if (line5c == "g") { me["ECAML5"].setColor(0.0509,0.7529,0.2941); @@ -297,7 +297,7 @@ var canvas_upperECAM_base = { if (line6c == "w") { me["ECAML6"].setColor(0.8078,0.8039,0.8078); - } else if (line6c == "b") { + } else if (line6c == "c") { me["ECAML6"].setColor(0.0901,0.6039,0.7176); } else if (line6c == "g") { me["ECAML6"].setColor(0.0509,0.7529,0.2941); @@ -309,7 +309,7 @@ var canvas_upperECAM_base = { if (line7c == "w") { me["ECAML7"].setColor(0.8078,0.8039,0.8078); - } else if (line7c == "b") { + } else if (line7c == "c") { me["ECAML7"].setColor(0.0901,0.6039,0.7176); } else if (line7c == "g") { me["ECAML7"].setColor(0.0509,0.7529,0.2941); @@ -321,7 +321,7 @@ var canvas_upperECAM_base = { if (line8c == "w") { me["ECAML8"].setColor(0.8078,0.8039,0.8078); - } else if (line8c == "b") { + } else if (line8c == "c") { me["ECAML8"].setColor(0.0901,0.6039,0.7176); } else if (line8c == "g") { me["ECAML8"].setColor(0.0509,0.7529,0.2941); @@ -447,7 +447,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec1") == "w") { me["ECAMR1"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec1") == "b") { + } else if (getprop("/ECAM/rightmsg/linec1") == "c") { me["ECAMR1"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec1") == "g") { me["ECAMR1"].setColor(0.0509,0.7529,0.2941); @@ -461,7 +461,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec2") == "w") { me["ECAMR2"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec2") == "b") { + } else if (getprop("/ECAM/rightmsg/linec2") == "c") { me["ECAMR2"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec2") == "g") { me["ECAMR2"].setColor(0.0509,0.7529,0.2941); @@ -475,7 +475,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec3") == "w") { me["ECAMR3"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec3") == "b") { + } else if (getprop("/ECAM/rightmsg/linec3") == "c") { me["ECAMR3"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec3") == "g") { me["ECAMR3"].setColor(0.0509,0.7529,0.2941); @@ -489,7 +489,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec4") == "w") { me["ECAMR4"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec4") == "b") { + } else if (getprop("/ECAM/rightmsg/linec4") == "c") { me["ECAMR4"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec4") == "g") { me["ECAMR4"].setColor(0.0509,0.7529,0.2941); @@ -503,7 +503,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec5") == "w") { me["ECAMR5"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec5") == "b") { + } else if (getprop("/ECAM/rightmsg/linec5") == "c") { me["ECAMR5"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec5") == "g") { me["ECAMR5"].setColor(0.0509,0.7529,0.2941); @@ -517,7 +517,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec6") == "w") { me["ECAMR6"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec6") == "b") { + } else if (getprop("/ECAM/rightmsg/linec6") == "c") { me["ECAMR6"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec6") == "g") { me["ECAMR6"].setColor(0.0509,0.7529,0.2941); @@ -531,7 +531,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec7") == "w") { me["ECAMR7"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec7") == "b") { + } else if (getprop("/ECAM/rightmsg/linec7") == "c") { me["ECAMR7"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec7") == "g") { me["ECAMR7"].setColor(0.0509,0.7529,0.2941); @@ -545,7 +545,7 @@ var canvas_upperECAM_base = { if (getprop("/ECAM/rightmsg/linec8") == "w") { me["ECAMR8"].setColor(0.8078,0.8039,0.8078); - } else if (getprop("/ECAM/rightmsg/linec8") == "b") { + } else if (getprop("/ECAM/rightmsg/linec8") == "c") { me["ECAMR8"].setColor(0.0901,0.6039,0.7176); } else if (getprop("/ECAM/rightmsg/linec8") == "g") { me["ECAMR8"].setColor(0.0509,0.7529,0.2941); diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 06e05ab1..5d81ad02 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -49,11 +49,11 @@ var warning = { write: func() { if (me.active == 0) {return;} lineIndex = 0; - while (lines[lineIndex].getValue() != "" and lineIndex <= 7) { + while (lineIndex < 7 and lines[lineIndex].getValue() != "") { lineIndex = lineIndex + 1; # go to next line until empty line } - if (lineIndex > 7) { + if (lineIndex == 7) { leftOverflow.setBoolValue(1); } elsif (leftOverflow.getBoolValue()) { leftOverflow.setBoolValue(0); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 31bf652d..143f8aca 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -2,9 +2,18 @@ # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) +# props.nas: + +var dualFailNode = props.globals.getNode("/fdm/jsbsim/systems/ecam/dual-failure-enabled", 1); +var phaseNode = props.globals.getNode("/ECAM/warning-phase", 1); + +# local variables +var phaseVar = nil; + var messages_priority_3 = func { + phaseVar = phaseNode.getValue(); # FCTL - if ((flap_not_zero.clearFlag == 0) and getprop("/ECAM/warning-phase") == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) { + if ((flap_not_zero.clearFlag == 0) and phaseVar == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) { flap_not_zero.active = 1; } else { flap_not_zero.active = 0; @@ -12,8 +21,66 @@ var messages_priority_3 = func { flap_not_zero.clearFlag = 0; } + # ENG DUAL FAIL + + if (phaseVar >= 5 and phaseVar <= 7 and dualFailNode.getBoolValue()) { + dualFail.active = 1; + } elsif (dualFailbatt.clearFlag == 1 and dualFail.clearFlag == 1) { + dualFail.active = 0; + dualFail.noRepeat = 0; + dualFail.clearFlag = 0; + } + + if (dualFail.active == 1) { + if (getprop("/controls/engines/engine-start-switch") != 2 and dualFailModeSel.clearFlag == 0) { + dualFailModeSel.active = 1; + } else { + dualFailModeSel.active = 0; + } + + if (getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01 and dualFailLevers.clearFlag == 0) { + dualFailLevers.active = 1; + } else { + dualFailLevers.active = 0; + } + + if (getprop("/options/eng") == "IAE" and dualFailRelightSPD.clearFlag == 0) { + dualFailRelightSPD.active = 1; + } else { + dualFailRelightSPD.active = 0; + } + + if (getprop("/options/eng") != "IAE" and dualFailRelightSPDCFM.clearFlag == 0) { + dualFailRelightSPDCFM.active = 1; + } else { + dualFailRelightSPDCFM.active = 0; + } + + dualFailElec.active = 1; + dualFailRadio.active = 1; + dualFailFAC.active = 1; + dualFailRelight.active = 1; + dualFailMasters.active = 1; + dualFailSuccess.active = 1; + dualFailAPU.active = 1; + dualFailMastersAPU.active = 1; + dualFailSPDGD.active = 1; + dualFailAPPR.active = 1; + dualFailcabin.active = 1; + dualFailrudd.active = 1; + dualFailflap.active = 1; + dualFail5000.active = 1; + dualFailgear.active = 1; + dualFailfinalspeed.active = 1; + dualFailtouch.active = 1; + dualFailmasteroff.active = 1; + dualFailapuoff.active = 1; + dualFailevac.active = 1; + dualFailbatt.active = 1; + } + # CONFIG - if ((slats_config.clearFlag == 0) and (getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever")) == 4 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((slats_config.clearFlag == 0) and (getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever")) == 4 and phaseVar >= 3 and phaseVar <= 4) { slats_config.active = 1; slats_config_1.active = 1; } else { @@ -23,7 +90,7 @@ var messages_priority_3 = func { slats_config_1.noRepeat = 0; } - if ((flaps_config.clearFlag == 0) and (getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever") == 4) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((flaps_config.clearFlag == 0) and (getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever") == 4) and phaseVar >= 3 and phaseVar <= 4) { flaps_config.active = 1; flaps_config_1.active = 1; } else { @@ -33,7 +100,7 @@ var messages_priority_3 = func { flaps_config_1.noRepeat = 0; } - if ((spd_brk_config.clearFlag == 0) and getprop("/controls/flight/speedbrake") != 0 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((spd_brk_config.clearFlag == 0) and getprop("/controls/flight/speedbrake") != 0 and phaseVar >= 3 and phaseVar <= 4) { spd_brk_config.active = 1; spd_brk_config_1.active = 1; } else { @@ -43,7 +110,7 @@ var messages_priority_3 = func { spd_brk_config_1.noRepeat = 0; } - if ((pitch_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((pitch_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and phaseVar >= 3 and phaseVar <= 4) { pitch_trim_config.active = 1; pitch_trim_config_1.active = 1; } else { @@ -53,7 +120,7 @@ var messages_priority_3 = func { pitch_trim_config_1.noRepeat = 0; } - if ((rud_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((rud_trim_config.clearFlag == 0) and (getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and phaseVar >= 3 and phaseVar <= 4) { rud_trim_config.active = 1; rud_trim_config_1.active = 1; } else { @@ -63,7 +130,7 @@ var messages_priority_3 = func { rud_trim_config_1.noRepeat = 0; } - if ((park_brk_config.clearFlag == 0) and getprop("/controls/gear/brake-parking") == 1 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) { + if ((park_brk_config.clearFlag == 0) and getprop("/controls/gear/brake-parking") == 1 and phaseVar >= 3 and phaseVar <= 4) { park_brk_config.active = 1; } else { park_brk_config.active = 0; @@ -78,7 +145,7 @@ var messages_priority_3 = func { ap_offw.noRepeat = 0; } - if ((athr_lock.clearFlag == 0) and getprop("/ECAM/warning-phase") >= 5 and getprop("/ECAM/warning-phase") <= 7 and getprop("/systems/thrust/thr-locked") == 1) { + if ((athr_lock.clearFlag == 0) and phaseVar >= 5 and phaseVar <= 7 and getprop("/systems/thrust/thr-locked") == 1) { athr_lock.active = 1; athr_lock_1.active = 1; } else { @@ -88,7 +155,7 @@ var messages_priority_3 = func { athr_lock_1.noRepeat = 0; } - if ((athr_offw.clearFlag == 0) and getprop("/it-autoflight/output/athr-warning") == 2 and getprop("/ECAM/warning-phase") != 4 and getprop("/ECAM/warning-phase") != 8 and getprop("/ECAM/warning-phase") != 10) { + if ((athr_offw.clearFlag == 0) and getprop("/it-autoflight/output/athr-warning") == 2 and phaseVar != 4 and phaseVar != 8 and phaseVar != 10) { athr_offw.active = 1; athr_offw_1.active = 1; } else { @@ -98,7 +165,7 @@ var messages_priority_3 = func { athr_offw_1.noRepeat = 0; } - if ((athr_lim.clearFlag == 0) and getprop("/it-autoflight/output/athr") == 1 and ((getprop("/systems/thrust/eng-out") != 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN")) or (getprop("/systems/thrust/eng-out") == 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN" or (getprop("/systems/thrust/state1") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83) or (getprop("/systems/thrust/state2") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83)))) and (getprop("/ECAM/warning-phase") >= 5 and getprop("/ECAM/warning-phase") <= 7)) { + if ((athr_lim.clearFlag == 0) and getprop("/it-autoflight/output/athr") == 1 and ((getprop("/systems/thrust/eng-out") != 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN")) or (getprop("/systems/thrust/eng-out") == 1 and (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN" or (getprop("/systems/thrust/state1") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83) or (getprop("/systems/thrust/state2") == "MAN THR" and getprop("/controls/engines/engine[0]/throttle-pos") <= 0.83)))) and (phaseVar >= 5 and phaseVar <= 7)) { athr_lim.active = 1; athr_lim_1.active = 1; } else { @@ -114,6 +181,7 @@ var messages_priority_1 = func {} var messages_priority_0 = func {} var messages_memo = func { + phaseVar = phaseNode.getValue(); if (getprop("/services/fuel-truck/enable") == 1 and getprop("/ECAM/left-msg") != "TO-MEMO" and getprop("/ECAM/left-msg") != "LDG-MEMO") { refuelg.active = 1; } else { @@ -159,32 +227,33 @@ var messages_memo = func { } var messages_right_memo = func { - if (getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 5) { + phaseVar = phaseNode.getValue(); + if (phaseVar >= 3 and phaseVar <= 5) { to_inhibit.active = 1; } else { to_inhibit.active = 0; } - if (getprop("/ECAM/warning-phase") >= 7 and getprop("/ECAM/warning-phase") <= 7) { + if (phaseVar >= 7 and phaseVar <= 7) { ldg_inhibit.active = 1; } else { ldg_inhibit.active = 0; } - if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and (getprop("/engines/engine[0]/state") == 3) and getprop("/engines/engine[1]/state") == 3) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 8)) { + if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and (getprop("/engines/engine[0]/state") == 3) and getprop("/engines/engine[1]/state") == 3) and phaseVar >= 3 and phaseVar <= 8)) { land_asap_r.active = 1; } else { land_asap_r.active = 0; } - if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and (getprop("/engines/engine[0]/state") == 3) and getprop("/engines/engine[1]/state") == 3) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 8)) { + if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/systems/failures/cargo-aft-fire") == 1 or getprop("/systems/failures/cargo-fwd-fire") == 1) or (((getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/engines/engine[0]/state") == 3) and (getprop("/systems/hydraulic/yellow-psi") < 1500 and getprop("/engines/engine[1]/state") == 3)) or ((getprop("/systems/hydraulic/green-psi") < 1500 or getprop("/systems/hydraulic/yellow-psi") < 1500) and (getprop("/engines/engine[0]/state") == 3) and getprop("/engines/engine[1]/state") == 3) and phaseVar >= 3 and phaseVar <= 8)) { # todo: emer elec land_asap_r.active = 1; } else { land_asap_r.active = 0; } - if (land_asap_r.active == 0 and getprop("/gear/gear[1]/wow") == 0 and ((getprop("/fdm/jsbsim/propulsion/tank[0]/contents-lbs") < 1650 and getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") < 1650) or ((getprop("/systems/electrical/bus/dc2") < 25 and (getprop("/systems/failures/elac1") == 1 or getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/green-psi") < 1500 and (getprop("/systems/failures/elac1") == 1 and getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/yellow-psi") < 1500 and (getprop("/systems/failures/elac1") == 1 and getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/blue-psi") < 1500 and (getprop("/systems/failures/elac2") == 1 and getprop("/systems/failures/sec2") == 1))) or (getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 8 and (getprop("/engines/engine[0]/state") != 3 or getprop("/engines/engine[1]/state") != 3)))) { + if (land_asap_r.active == 0 and getprop("/gear/gear[1]/wow") == 0 and ((getprop("/fdm/jsbsim/propulsion/tank[0]/contents-lbs") < 1650 and getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") < 1650) or ((getprop("/systems/electrical/bus/dc2") < 25 and (getprop("/systems/failures/elac1") == 1 or getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/green-psi") < 1500 and (getprop("/systems/failures/elac1") == 1 and getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/yellow-psi") < 1500 and (getprop("/systems/failures/elac1") == 1 and getprop("/systems/failures/sec1") == 1)) or (getprop("/systems/hydraulic/blue-psi") < 1500 and (getprop("/systems/failures/elac2") == 1 and getprop("/systems/failures/sec2") == 1))) or (phaseVar >= 3 and phaseVar <= 8 and (getprop("/engines/engine[0]/state") != 3 or getprop("/engines/engine[1]/state") != 3)))) { land_asap_a.active = 1; } else { land_asap_a.active = 0; @@ -202,24 +271,24 @@ var messages_right_memo = func { athr_off.active = 0; } - if ((getprop("/ECAM/warning-phase") >= 2 and getprop("/ECAM/warning-phase") <= 7) and getprop("controls/flight/speedbrake") != 0) { + if ((phaseVar >= 2 and phaseVar <= 7) and getprop("controls/flight/speedbrake") != 0) { spd_brk.active = 1; } else { spd_brk.active = 0; } - if (getprop("/systems/thrust/state1") == "IDLE" and getprop("/systems/thrust/state2") == "IDLE" and getprop("/ECAM/warning-phase") >= 6 and getprop("/ECAM/warning-phase") <= 7) { + if (getprop("/systems/thrust/state1") == "IDLE" and getprop("/systems/thrust/state2") == "IDLE" and phaseVar >= 6 and phaseVar <= 7) { spd_brk.colour = "g"; - } else if ((getprop("/ECAM/warning-phase") >= 2 and getprop("/ECAM/warning-phase") <= 5) or ((getprop("/systems/thrust/state1") != "IDLE" or getprop("/systems/thrust/state2") != "IDLE") and (getprop("/ECAM/warning-phase") >= 6 and getprop("/ECAM/warning-phase") <= 7))) { + } else if ((phaseVar >= 2 and phaseVar <= 5) or ((getprop("/systems/thrust/state1") != "IDLE" or getprop("/systems/thrust/state2") != "IDLE") and (phaseVar >= 6 and phaseVar <= 7))) { spd_brk.colour = "a"; } - if (getprop("/controls/gear/brake-parking") == 1 and getprop("/ECAM/warning-phase") != 3) { + if (getprop("/controls/gear/brake-parking") == 1 and phaseVar != 3) { park_brk.active = 1; } else { park_brk.active = 0; } - if (getprop("/ECAM/warning-phase") >= 4 and getprop("/ECAM/warning-phase") <= 8) { + if (phaseVar >= 4 and phaseVar <= 8) { park_brk.colour = "a"; } else { park_brk.colour = "g"; @@ -237,7 +306,7 @@ var messages_right_memo = func { rat.active = 0; } - if (getprop("/ECAM/warning-phase") >= 1 and getprop("/ECAM/warning-phase") <= 2) { + if (phaseVar >= 1 and phaseVar <= 2) { rat.colour = "a"; } else { rat.colour = "g"; @@ -303,24 +372,24 @@ var messages_right_memo = func { wing_aice.active = 0; } - if (getprop("/instrumentation/comm[2]/frequencies/selected-mhz") != 0 and (getprop("/ECAM/warning-phase") == 1 or getprop("/ECAM/warning-phase") == 2 or getprop("/ECAM/warning-phase") == 6 or getprop("/ECAM/warning-phase") == 9 or getprop("/ECAM/warning-phase") == 10)) { + if (getprop("/instrumentation/comm[2]/frequencies/selected-mhz") != 0 and (phaseVar == 1 or phaseVar == 2 or phaseVar == 6 or phaseVar == 9 or phaseVar == 10)) { vhf3_voice.active = 1; } else { vhf3_voice.active = 0; } - if (getprop("/controls/autobrake/mode") == 1 and (getprop("/ECAM/warning-phase") == 7 or getprop("/ECAM/warning-phase") == 8)) { + if (getprop("/controls/autobrake/mode") == 1 and (phaseVar == 7 or phaseVar == 8)) { auto_brk_lo.active = 1; } else { auto_brk_lo.active = 0; } - if (getprop("/controls/autobrake/mode") == 2 and (getprop("/ECAM/warning-phase") == 7 or getprop("/ECAM/warning-phase") == 8)) { + if (getprop("/controls/autobrake/mode") == 2 and (phaseVar == 7 or phaseVar == 8)) { auto_brk_med.active = 1; } else { auto_brk_med.active = 0; } - if (getprop("/controls/autobrake/mode") == 3 and (getprop("/ECAM/warning-phase") == 7 or getprop("/ECAM/warning-phase") == 8)) { + if (getprop("/controls/autobrake/mode") == 3 and (phaseVar == 7 or phaseVar == 8)) { auto_brk_max.active = 1; } else { auto_brk_max.active = 0; @@ -332,7 +401,7 @@ var messages_right_memo = func { fuelx.active = 0; } - if (getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 5) { + if (phaseVar >= 3 and phaseVar <= 5) { fuelx.colour = "a"; } else { fuelx.colour = "g"; @@ -344,7 +413,7 @@ var messages_right_memo = func { gpws_flap3.active = 0; } - if (getprop("/ECAM/warning-phase") >= 2 and getprop("/ECAM/warning-phase") <= 9 and getprop("/systems/fuel/only-use-ctr-tank") == 1 and getprop("/systems/electrical/bus/ac1") >= 115 and getprop("/systems/electrical/bus/ac2") >= 115) { + if (phaseVar >= 2 and phaseVar <= 9 and getprop("/systems/fuel/only-use-ctr-tank") == 1 and getprop("/systems/electrical/bus/ac1") >= 115 and getprop("/systems/electrical/bus/ac2") >= 115) { ctr_tk_feedg.active = 1; } else { ctr_tk_feedg.active = 0; diff --git a/Nasal/ECAM/ECAM-messages.nas b/Nasal/ECAM/ECAM-messages.nas index 864b9d12..a77b71a7 100644 --- a/Nasal/ECAM/ECAM-messages.nas +++ b/Nasal/ECAM/ECAM-messages.nas @@ -11,7 +11,35 @@ var warnings = std.Vector.new([ var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", active: 0, colour: "r", aural: 0, light: 0, noRepeat: 0, clearFlag: 0), - + + # DUAL ENG FAIL + var dualFail = warning.new(msg: "ENG DUAL FAILURE", active: 0, colour: "r", aural: 0, light: 0, noRepeat: 0, clearFlag: 0), + var dualFailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailLevers = warning.new(msg: " -THR LEVERS........IDLE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailRelightSPD = warning.new(msg: " OPTIMUM RELIGHT SPD.280", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailRelightSPDCFM = warning.new(msg: " OPTIMUM RELIGHT SPD.300", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailElec = warning.new(msg: " -EMER ELEC PWR...MAN ON", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailRadio = warning.new(msg: " -VHF1/ATC1..........USE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailFAC = warning.new(msg: " -FAC 1......OFF THEN ON", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailRelight = warning.new(msg: "•IF NO RELIGHT AFTER 30S", active: 0, colour: "w", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailMasters = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailSuccess = warning.new(msg: " •IF UNSUCCESSFUL : ", active: 0, colour: "w", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailAPU = warning.new(msg: " -APU (IF AVAIL)...START", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailMastersAPU = warning.new(msg: " -ENG MASTERS.OFF 30S/ON", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailSPDGD = warning.new(msg: " OPTIMUM SPEED.....G DOT", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailAPPR = warning.new(msg: " •EARLY IN APPR : ", active: 0, colour: "w", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailcabin = warning.new(msg: " -CAB SECURE.......ORDER", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailrudd = warning.new(msg: " -USE RUDDER WITH CARE ", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailflap = warning.new(msg: " -FOR LDG.....USE FLAP 3", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFail5000 = warning.new(msg: " •AT 5000 FT AGL : ", active: 0, colour: "w", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailgear = warning.new(msg: " -L/G.........GRVTY EXTN", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailfinalspeed = warning.new(msg: " TARGET SPEED.....150 KT", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailtouch = warning.new(msg: " •AT TOUCH DOWN : ", active: 0, colour: "w", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailmasteroff = warning.new(msg: " -ENG MASTERS........OFF", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailapuoff = warning.new(msg: " -APU MASTER SW......OFF", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailevac = warning.new(msg: " -EVAC..........INITIATE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var dualFailbatt = warning.new(msg: " -BAT 1+2............OFF", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + # Config var slats_config = warning.new(msg: "CONFIG", active: 0, colour: "r", aural: 0, light: 0, noRepeat: 0, clearFlag: 0), var slats_config_1 = warning.new(msg: "SLATS NOT IN T.O. CONFIG", active: 0, colour: "r", aural: 0, light: 0, noRepeat: 0, clearFlag: 0), @@ -28,11 +56,11 @@ var warnings = std.Vector.new([ # Autopilot var ap_offw = warning.new(msg: "AUTO FLT AP OFF", active: 0, colour: "r", aural: 9, light: 0, noRepeat: 0, clearFlag: 0), var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", active: 0, colour: "a", aural: 1, light: 1, noRepeat: 0, clearFlag: 0), - var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), var athr_lock = warning.new(msg: "ENG THRUST LOCKED", active: 0, colour: "a", aural: 1, light: 1, noRepeat: 0, clearFlag: 0), - var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), + var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0), var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", active: 0, colour: "a", aural: 1, light: 1, noRepeat: 0, clearFlag: 0), - var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: 9, light: 9, noRepeat: 0, clearFlag: 0) + var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "c", aural: 9, light: 9, noRepeat: 0, clearFlag: 0) ]); var leftmemos = std.Vector.new([ diff --git a/Systems/a320-ecam.xml b/Systems/a320-ecam.xml new file mode 100644 index 00000000..6b6a6e84 --- /dev/null +++ b/Systems/a320-ecam.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + position/wow eq 0 + /engines/engine[0]/n2 lt 61.2 + /engines/engine[1]/n2 lt 61.2 + + + position/wow eq 0 + fcs/engine-cutoff[0] eq 1 + fcs/engine-cutoff[1] eq 1 + + + + +