From 7f5c407ce081cfebca0ad816211dc2a779987cc0 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 10 May 2020 16:05:57 +0100 Subject: [PATCH] Crossbleed on LOWER ECAM --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 38 ++++++++++------- Models/Instruments/Lower-ECAM/res/bleed.svg | 44 +++++++++++--------- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index fe3acbde..fedb3bbd 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -83,8 +83,9 @@ var switch_bleedapu = props.globals.getNode("/controls/pneumatic/switches/apu", var apuBleedNotOn = props.globals.getNode("/systems/pneumatics/warnings/apu-bleed-not-on", 1); var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1); var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1); -var pneumatic_xbleed_state = props.globals.getNode("/systems/pneumatics/xbleed-state", 1); +var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1); var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1); +var xbleedstate = nil; var hp_valve1_state = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve", 1); var hp_valve2_state = props.globals.getNode("/systems/pneumatics/valves/engine-2-hp-valve", 1); var hp_valve1 = props.globals.getNode("/systems/pneumatics/valves/engine-1-hp-valve-cmd", 1); @@ -739,7 +740,7 @@ var canvas_lowerECAM_bleed = { }, getKeys: func() { return ["TAT","SAT","GW","UTCh","UTCm","GW-weight-unit", "BLEED-XFEED", "BLEED-Ram-Air", "BLEED-APU", "BLEED-HP-Valve-1","BLEED-APU-LINES", - "BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp", + "BLEED-ENG-1", "BLEED-HP-Valve-2", "BLEED-ENG-2", "BLEED-Precooler-1-Inlet-Press", "BLEED-Precooler-1-Outlet-Temp","BLEED-XFEEDLines", "BLEED-Precooler-2-Inlet-Press", "BLEED-Precooler-2-Outlet-Temp", "BLEED-ENG-1-label", "BLEED-ENG-2-label", "BLEED-GND", "BLEED-Pack-1-Flow-Valve", "BLEED-Pack-2-Flow-Valve", "BLEED-Pack-1-Out-Temp", "BLEED-Pack-1-Comp-Out-Temp", "BLEED-Pack-1-Packflow-needel", "BLEED-Pack-1-Bypass-needel", "BLEED-Pack-2-Out-Temp", @@ -748,26 +749,27 @@ var canvas_lowerECAM_bleed = { }, update: func() { # X BLEED - if (pneumatic_xbleed_state.getValue() == "transit") { + xbleedstate = xbleed.getValue(); + if (xbleedcmd.getBoolValue() != xbleedstate) { me["BLEED-XFEED"].setColor(0.7333,0.3803,0); - me["BLEED-XFEED"].setRotation(45 * D2R); } else { - if (pneumatic_xbleed_state.getValue() == "open") { - var xbleed_state = 1; - } else { - var xbleed_state = 0; - } - - if (xbleed_state == 1) { + me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); + } + + if (xbleedcmd.getBoolValue() == xbleedstate) { + if (xbleedcmd.getBoolValue()) { me["BLEED-XFEED"].setRotation(0); } else { me["BLEED-XFEED"].setRotation(90 * D2R); } - if (xbleed_state == xbleed.getValue()) { - me["BLEED-XFEED"].setColor(0.0509,0.7529,0.2941); - } else { - me["BLEED-XFEED"].setColor(0.7333,0.3803,0); - } + } else { + me["BLEED-XFEED"].setRotation(45 * D2R); + } + + if (xbleedstate != 0) { + me["BLEED-XFEEDLines"].show(); + } else { + me["BLEED-XFEEDLines"].hide(); } # HP valve 1 @@ -778,6 +780,7 @@ var canvas_lowerECAM_bleed = { } else { me["BLEED-HP-Valve-1"].setRotation(0); } + if (hp_valve_state == hp_valve1.getValue()) { me["BLEED-HP-Valve-1"].setColor(0.0509,0.7529,0.2941); } else { @@ -792,6 +795,7 @@ var canvas_lowerECAM_bleed = { } else { me["BLEED-HP-Valve-2"].setRotation(0); } + if (hp_valve_state == hp_valve2.getValue()) { me["BLEED-HP-Valve-2"].setColor(0.0509,0.7529,0.2941); } else { @@ -806,6 +810,7 @@ var canvas_lowerECAM_bleed = { } else { me["BLEED-ENG-1"].setRotation(0); } + if (eng_valve_state == eng_valve1.getValue()) { me["BLEED-ENG-1"].setColor(0.0509,0.7529,0.2941); } else { @@ -839,6 +844,7 @@ var canvas_lowerECAM_bleed = { } else { me["BLEED-ENG-2"].setRotation(0); } + if (eng_valve_state == eng_valve2.getValue()) { me["BLEED-ENG-2"].setColor(0.0509,0.7529,0.2941); } else { diff --git a/Models/Instruments/Lower-ECAM/res/bleed.svg b/Models/Instruments/Lower-ECAM/res/bleed.svg index 1c8262a3..59eb3ef6 100644 --- a/Models/Instruments/Lower-ECAM/res/bleed.svg +++ b/Models/Instruments/Lower-ECAM/res/bleed.svg @@ -12,7 +12,7 @@ viewBox="0 0 1024 1024" version="1.1" id="svg2" - inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="bleed.svg"> @@ -41,9 +41,9 @@ inkscape:window-height="705" id="namedview371" showgrid="false" - inkscape:zoom="1.4773733" - inkscape:cx="843.6625" - inkscape:cy="621.84897" + inkscape:zoom="0.73868665" + inkscape:cx="546.41121" + inkscape:cy="680.16775" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -70,14 +70,6 @@ id="rect5105-2" style="fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - - + + + +