diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 8767911a..e8c19427 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -73,7 +73,6 @@ var final_deg = props.globals.getNode("/fdm/jsbsim/hydraulics/rudder/final-deg", var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1); var gw = props.globals.getNode("/fdm/jsbsim/inertia/weight-lbs", 1); var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1); -var apu_master = props.globals.getNode("/controls/apu/master", 1); var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1); var switch_bleedapu = props.globals.getNode("/controls/pneumatics/switches/apu", 1); var apuBleedNotOn = props.globals.getNode("/systems/pneumatics/warnings/apu-bleed-not-on", 1); @@ -610,7 +609,7 @@ var canvas_lowerECAM_apu = { me["APUGenHz"].setColor(0.7333,0.3803,0); } - if (apu_master.getValue() == 1 or apu_rpm.getValue() >= 94.9) { + if (systems.APUNodes.Controls.master.getValue() == 1 or apu_rpm.getValue() >= 94.9) { me["APUGenbox"].show(); me["APUGenHz"].show(); me["APUGenVolt"].show(); @@ -634,9 +633,9 @@ var canvas_lowerECAM_apu = { me["APUGenOnline"].hide(); } - if ((apu_master.getValue() == 0) or ((apu_master.getValue() == 1) and (gen_apu.getValue() == 1) and (apu_rpm.getValue() > 94.9))) { + if ((systems.APUNodes.Controls.master.getValue() == 0) or ((systems.APUNodes.Controls.master.getValue() == 1) and (gen_apu.getValue() == 1) and (apu_rpm.getValue() > 94.9))) { me["APUGentext"].setColor(0.8078,0.8039,0.8078); - } else if ((apu_master.getValue() == 1) and (gen_apu.getValue() == 0) and (apu_rpm.getValue() < 94.9)) { + } else if ((systems.APUNodes.Controls.master.getValue() == 1) and (gen_apu.getValue() == 0) and (apu_rpm.getValue() < 94.9)) { me["APUGentext"].setColor(0.7333,0.3803,0); } @@ -670,7 +669,7 @@ var canvas_lowerECAM_apu = { # APU N and EGT - if (apu_master.getValue() == 1) { + if (systems.APUNodes.Controls.master.getValue() == 1) { me["APUN"].setColor(0.0509,0.7529,0.2941); me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue() or 0))); me["APUEGT"].setColor(0.0509,0.7529,0.2941); @@ -795,7 +794,7 @@ var canvas_lowerECAM_bleed = { # APU BLEED valve var apu_valve_state2 = apu_valve_state.getValue(); - if (apu_master.getValue()) { + if (systems.APUNodes.Controls.master.getValue()) { me["BLEED-APU-LINES"].show(); if (apu_valve_state2 == 1) { me["BLEED-APU-CIRCLE"].setRotation(0); @@ -1647,7 +1646,7 @@ var canvas_lowerECAM_elec = { } # APU - if (apu_master.getValue() == 0) { + if (systems.APUNodes.Controls.master.getValue() == 0) { me["APU-content"].hide(); me["APUGEN-off"].hide(); me["APU-border"].hide(); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 482d0c78..f16b9cca 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -12,10 +12,8 @@ var emerGen = props.globals.getNode("/controls/electrical/switches/emer-gen var state1Node = props.globals.getNode("/engines/engine[0]/state", 1); var state2Node = props.globals.getNode("/engines/engine[1]/state", 1); -var wowNode = props.globals.getNode("/fdm/jsbsim/position/wow", 1); var apu_rpm = props.globals.getNode("/engines/engine[2]/n1", 1); var wing_pb = props.globals.getNode("/controls/ice-protection/wing", 1); -var apumaster = props.globals.getNode("/controls/apu/master", 1); var apu_bleedSw = props.globals.getNode("/controls/pneumatics/switches/apu", 1); var gear = props.globals.getNode("/gear/gear-pos-norm", 1); var cutoff1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1); @@ -226,7 +224,7 @@ var messages_priority_3 = func { ECAM_controller.warningReset(dualFailmasteroff); } - if (dualFailapuoff.clearFlag == 0 and apumaster.getBoolValue()) { + if (dualFailapuoff.clearFlag == 0 and systems.APUNodes.Controls.master.getBoolValue()) { dualFailapuoff.active = 1; } else { ECAM_controller.warningReset(dualFailapuoff); @@ -1310,7 +1308,7 @@ var messages_priority_2 = func { ECAM_controller.warningReset(apuAutoShutdown); } - if (apuAutoShutdownMast.clearFlag == 0 and pts.APU.masterSw.getValue() and apuAutoShutdown.active == 1) { + if (apuAutoShutdownMast.clearFlag == 0 and systems.APUNodes.Controls.master.getValue() and apuAutoShutdown.active == 1) { apuAutoShutdownMast.active = 1; } else { ECAM_controller.warningReset(apuAutoShutdownMast); @@ -2483,7 +2481,7 @@ var messages_right_memo = func { } setlistener("/engines/engine[0]/state", func() { - if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and wowNode.getValue() == 0) { + if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and !pts.Fdm.JSBsim.Position.wow.getBoolValue()) { dualFailNode.setBoolValue(1); } else { dualFailNode.setBoolValue(0); @@ -2491,7 +2489,7 @@ setlistener("/engines/engine[0]/state", func() { }, 0, 0); setlistener("/engines/engine[1]/state", func() { - if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and wowNode.getValue() == 0) { + if ((state1Node.getValue() != 3 and state2Node.getValue() != 3) and !pts.Fdm.JSBsim.Position.wow.getBoolValue()) { dualFailNode.setBoolValue(1); } else { dualFailNode.setBoolValue(0); diff --git a/Nasal/ECAM/ECAM-main.nas b/Nasal/ECAM/ECAM-main.nas index 189a2b8b..db1b2dc8 100644 --- a/Nasal/ECAM/ECAM-main.nas +++ b/Nasal/ECAM/ECAM-main.nas @@ -223,7 +223,7 @@ var SystemDisplay = { }, update: func() { phase = pts.ECAM.fwcWarningPhase.getValue(); - APUMaster = pts.APU.masterSw.getValue(); + APUMaster = systems.APUNodes.Controls.master.getValue(); APURPM = pts.APU.rpm.getValue(); engModeSel = pts.Controls.Engines.startSw.getValue(); elapsedSec = pts.Sim.Time.elapsedSec.getValue(); diff --git a/Nasal/Libraries/property-tree-setup.nas b/Nasal/Libraries/property-tree-setup.nas index 4f6b2a8a..fe9151fb 100644 --- a/Nasal/Libraries/property-tree-setup.nas +++ b/Nasal/Libraries/property-tree-setup.nas @@ -9,7 +9,6 @@ var Acconfig = { }; var APU = { - masterSw: props.globals.getNode("/controls/apu/master"), rpm: props.globals.getNode("/engines/engine[2]/n1"), }; @@ -74,6 +73,9 @@ var Fdm = { aileron: props.globals.getNode("/fdm/jsbsim/fbw/aileron-sidestick"), elevator: props.globals.getNode("/fdm/jsbsim/fbw/elevator-sidestick"), }, + Position: { + wow: props.globals.getNode("/fdm/jsbsim/position/wow"), + }, Propulsion: { Engine: { fuelUsed: [props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs"), props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs")], diff --git a/Nasal/Panels/atc.nas b/Nasal/Panels/atc.nas index 216cf0a8..d1f3d267 100644 --- a/Nasal/Panels/atc.nas +++ b/Nasal/Panels/atc.nas @@ -24,7 +24,6 @@ var Transponder = { 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), - wowNode: props.globals.getNode("fdm/jsbsim/position/wow"), 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), @@ -84,7 +83,7 @@ var Transponder = { me.setMode(4); # on } } else if (me.mode >= 3) { - if (me.wowNode.getBoolValue()) { + if (pts.Fdm.JSBsim.Position.wow.getBoolValue()) { if (me.knobNode.getValue() != 3) { me.setMode(3); # gnd } diff --git a/Nasal/Systems/fire.nas b/Nasal/Systems/fire.nas index cb25e0c6..89044210 100644 --- a/Nasal/Systems/fire.nas +++ b/Nasal/Systems/fire.nas @@ -32,8 +32,6 @@ var eng2AgentTimerTime = props.globals.initNode("/systems/fire/engine2/agent1-ti var eng1Agent2TimerTime = props.globals.initNode("/systems/fire/engine1/agent2-timer-time", 0, "INT"); var eng2Agent2TimerTime = props.globals.initNode("/systems/fire/engine2/agent2-timer-time", 0, "INT"); var apuAgentTimerTime = props.globals.initNode("/systems/fire/apu/agent-timer-time", 0, "INT"); -var wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1); -var apuMaster = props.globals.getNode("/controls/apu/master", 1); var fire_init = func { setprop("/controls/OH/protectors/fwddisch", 0); @@ -56,7 +54,6 @@ var engFireDetectorUnit = { loopTwo: 0, condition: 100, fireProp: "", - wow: "", new: func(sys, fireProp, testProp) { var eF = {parents:[engFireDetectorUnit]}; eF.sys = sys; @@ -65,7 +62,6 @@ var engFireDetectorUnit = { eF.loopTwo = 0; eF.fireProp = props.globals.getNode(fireProp, 1); eF.testProp = props.globals.getNode(testProp, 1); - eF.wow = props.globals.getNode("/fdm/jsbsim/position/wow", 1); eF.condition = 100; return eF; }, @@ -175,7 +171,7 @@ var engFireDetectorUnit = { eng2FireWarn.setBoolValue(1); } elsif (system == 2) { apuFireWarn.setBoolValue(1); - if (me.wow.getValue() == 1) { + if (pts.Fdm.JSBsim.Position.wow.getValue() == 1) { systems.APUController.APU.emergencyStop(); settimer(func() { # 3 sec delay - source TTM ATA 26 FIRE PROTECTION p102 extinguisherBottles.vector[4].discharge();