From ff70da0438b09cc66dda875a3af742b823e097e8 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Fri, 8 Nov 2019 18:22:29 +0000 Subject: [PATCH] Bugfix + improve --- A320-main.xml | 2 + Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 62 +++++++++++++------- Models/Instruments/Lower-ECAM/res/fuel.svg | 13 ++-- Nasal/fuel.nas | 11 +++- Nasal/property-tree-setup.nas | 11 ++++ Systems/a320-fuel.xml | 10 ++-- 6 files changed, 77 insertions(+), 32 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index acbcc818..bdb38a2c 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -937,6 +937,8 @@ 0 + 0 + 0 0 diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index 2b8f7d45..63b03d7a 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -111,11 +111,8 @@ var switch_pack1 = props.globals.getNode("/controls/pneumatic/switches/pack1", 1 var switch_pack2 = props.globals.getNode("/controls/pneumatic/switches/pack2", 1); var oil_qt1_actual = props.globals.getNode("/engines/engine[0]/oil-qt-actual", 1); var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1); -var fuel_used_lbs1 = props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs", 1); -var fuel_used_lbs2 = props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs", 1); -var fuel_left_quantity = props.globals.getNode("/consumables/fuel/tank[0]/level-lbs", 1); -var fuel_center_quantity = props.globals.getNode("/consumables/fuel/tank[1]/level-lbs", 1); -var fuel_right_quantity = props.globals.getNode("/consumables/fuel/tank[2]/level-lbs", 1); +var fuel_used_lbs1 = props.globals.getNode("/systems/fuel/fuel-used-1", 1); +var fuel_used_lbs2 = props.globals.getNode("/systems/fuel/fuel-used-2", 1); var doorL1_pos = props.globals.getNode("sim/model/door-positions/doorl1/position-norm", 1); var doorR1_pos = props.globals.getNode("sim/model/door-positions/doorr1/position-norm", 1); var doorL4_pos = props.globals.getNode("sim/model/door-positions/doorl4/position-norm", 1); @@ -2241,17 +2238,21 @@ var canvas_lowerECAM_fuel = { update: func() { # if (getprop("engines/engine[0]/n1-actual") < getprop("/controls/engines/idle-limit")) { - if (eng1_n1.getValue() <= 18.9) { + if (eng1_n1.getValue() <= 18.8) { me["ENG1idFFlow"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0); } else { me["ENG1idFFlow"].setColor(0.8078,0.8039,0.8078); + me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078); } # if (getprop("engines/engine[1]/n1-actual") < getprop("/controls/engines/idle-limit")) { - if (eng2_n1.getValue() <= 18.9) { + if (eng2_n1.getValue() <= 18.5) { me["ENG2idFFlow"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0); } else { me["ENG2idFFlow"].setColor(0.8078,0.8039,0.8078); + me["FUEL-ENG-2-label"].setColor(0.8078,0.8039,0.8078); } # TODO add FOB half-boxed amber if some fuel is blocked @@ -2267,27 +2268,29 @@ var canvas_lowerECAM_fuel = { # TODO use the valve prop and add amber if difference between eng master and valve # TODO add transition state - # TODO fix amber/green at the same time when closed if (systems.FUEL.Valves.lpValve1.getValue() == 1) { me["FUEL-ENG-Master-1"].setRotation(0); me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941); me["FUEL-ENG-1-pipe"].setColor(0.0509,0.7529,0.2941); } else { me["FUEL-ENG-Master-1"].setRotation(90 * D2R); me["FUEL-ENG-Master-1"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-Master-1"].setColorFill(0.7333,0.3803,0); me["FUEL-ENG-1-pipe"].setColor(0.7333,0.3803,0); } # TODO use the valve prop and add amber if difference between eng master and valve # TODO add transition state - # TODO fix amber/green at the same time when closed if (systems.FUEL.Valves.lpValve2.getValue() == 1) { me["FUEL-ENG-Master-2"].setRotation(0); me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941); me["FUEL-ENG-2-pipe"].setColor(0.0509,0.7529,0.2941); } else { me["FUEL-ENG-Master-2"].setRotation(90 * D2R); me["FUEL-ENG-Master-2"].setColor(0.7333,0.3803,0); + me["FUEL-ENG-Master-2"].setColorFill(0.7333,0.3803,0); me["FUEL-ENG-2-pipe"].setColor(0.7333,0.3803,0); } @@ -2304,75 +2307,81 @@ var canvas_lowerECAM_fuel = { } # TODO add LO indication - # TODO fix amber/green at the same time when closed if (systems.FUEL.Switches.pumpLeft1.getValue() == 1) { me["FUEL-Pump-Left-1-Open"].show(); me["FUEL-Pump-Left-1-Closed"].hide(); me["FUEL-Pump-Left-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Left-1"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Left-1-Open"].hide(); me["FUEL-Pump-Left-1-Closed"].show(); me["FUEL-Pump-Left-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Left-1"].setColorFill(0.7333,0.3803,0); } # TODO add LO indication - # TODO fix amber/green at the same time when closed if (systems.FUEL.Switches.pumpLeft2.getValue() == 1) { me["FUEL-Pump-Left-2-Open"].show(); me["FUEL-Pump-Left-2-Closed"].hide(); me["FUEL-Pump-Left-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Left-2"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Left-2-Open"].hide(); me["FUEL-Pump-Left-2-Closed"].show(); me["FUEL-Pump-Left-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Left-2"].setColorFill(0.7333,0.3803,0); } - # TODO fix amber/green at the same time when closed # TODO add functionality to match FCOM 1.28.20 "Amber: Transfer valve is open, whereas commanded closed in automatic or manual mode" if (systems.FUEL.Switches.pumpCenter1.getValue() == 1) { me["FUEL-Pump-Center-1-Open"].show(); me["FUEL-Pump-Center-1-Closed"].hide(); me["FUEL-Pump-Center-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Center-1"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Center-1-Open"].hide(); me["FUEL-Pump-Center-1-Closed"].show(); me["FUEL-Pump-Center-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Center-1"].setColorFill(0.7333,0.3803,0); } # TODO add LO indication - # TODO fix amber/green at the same time when closed if (systems.FUEL.Switches.pumpCenter2.getValue() == 1) { me["FUEL-Pump-Center-2-Open"].show(); me["FUEL-Pump-Center-2-Closed"].hide(); me["FUEL-Pump-Center-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Center-2"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Center-2-Open"].hide(); me["FUEL-Pump-Center-2-Closed"].show(); me["FUEL-Pump-Center-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Center-2"].setColorFill(0.7333,0.3803,0); } # TODO add LO indication - # TODO fix amber/green at the same time when closed if (systems.FUEL.Switches.pumpRight1.getValue() == 1) { me["FUEL-Pump-Right-1-Open"].show(); me["FUEL-Pump-Right-1-Closed"].hide(); me["FUEL-Pump-Right-1"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Right-1"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Right-1-Open"].hide(); me["FUEL-Pump-Right-1-Closed"].show(); me["FUEL-Pump-Right-1"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Right-1"].setColorFill(0.7333,0.3803,0); } # TODO add LO indication - # TODO fix amber/green at the same time when closed if (systems.FUEL.Switches.pumpRight2.getValue() == 1) { me["FUEL-Pump-Right-2-Open"].show(); me["FUEL-Pump-Right-2-Closed"].hide(); me["FUEL-Pump-Right-2"].setColor(0.0509,0.7529,0.2941); + me["FUEL-Pump-Right-2"].setColorFill(0.0509,0.7529,0.2941); } else { me["FUEL-Pump-Right-2-Open"].hide(); me["FUEL-Pump-Right-2-Closed"].show(); me["FUEL-Pump-Right-2"].setColor(0.7333,0.3803,0); + me["FUEL-Pump-Right-2"].setColorFill(0.7333,0.3803,0); } # Fuel Used @@ -2394,27 +2403,38 @@ var canvas_lowerECAM_fuel = { me["FUEL-Right-Inner-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightInner.getValue(), 10))); me["FUEL-Right-Outer-quantity"].setText(sprintf("%s", math.round(systems.FUEL.Quantity.rightOuter.getValue(), 10))); - if (!systems.FUEL.Valves.transfer1.getValue()) { + if (systems.FUEL.Valves.transfer1.getValue() == 0) { me["FUEL-Left-Transfer"].hide(); } else { - me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); + if (systems.FUEL.Valves.transfer1.getValue() == 1) { + me["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0); + } me["FUEL-Left-Transfer"].show(); } - if (!systems.FUEL.Valves.transfer2.getValue()) { + if (systems.FUEL.Valves.transfer2.getValue() == 0) { me["FUEL-Right-Transfer"].hide(); } else { - me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); + if (systems.FUEL.Valves.transfer2.getValue() == 1) { + me["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941); + } else { + me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0); + } me["FUEL-Right-Transfer"].show(); } - + if (!systems.FUEL.Switches.pumpCenter1.getValue() and !systems.FUEL.Switches.pumpCenter2.getValue()) { + me["FUEL-Center-blocked"].show(); + } else { + me["FUEL-Center-blocked"].hide(); + } # Hide not yet implemented features # TODO add them me["FUEL-Left-blocked"].hide(); me["FUEL-Right-blocked"].hide(); - me["FUEL-Center-blocked"].hide(); me["FUEL-Left-Outer-Inacc"].hide(); me["FUEL-Left-Inner-Inacc"].hide(); me["FUEL-Right-Outer-Inacc"].hide(); diff --git a/Models/Instruments/Lower-ECAM/res/fuel.svg b/Models/Instruments/Lower-ECAM/res/fuel.svg index 2b90e88b..4ebd8e8b 100644 --- a/Models/Instruments/Lower-ECAM/res/fuel.svg +++ b/Models/Instruments/Lower-ECAM/res/fuel.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="fuel.svg"> @@ -49,9 +49,9 @@ inkscape:window-height="705" id="namedview371" showgrid="false" - inkscape:zoom="2.0852713" - inkscape:cx="56" - inkscape:cy="255" + inkscape:zoom="0.68" + inkscape:cx="817.73616" + inkscape:cy="1022.6281" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -413,8 +413,9 @@ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:1.12171543" x="768.26727" y="57.18037" - id="text5073-0" - transform="scale(0.95537765,1.0467065)"> - + /systems/fuel/quantity/left-wing-inner-low eq 1 + /systems/fuel/quantity/right-wing-inner-low eq 1 @@ -194,7 +195,8 @@ /systems/fuel/valves/outer-inner-transfer-valve-2-cmd eq 1 /systems/fuel/refuel/refuelling eq 0 - + + /systems/fuel/quantity/left-wing-inner-low eq 1 /systems/fuel/quantity/right-wing-inner-low eq 1 @@ -527,8 +529,8 @@ - -/systems/fuel/internal/center-tank-left - -/systems/fuel/internal/center-tank-right + -/systems/fuel/internal/center-tank-eng-1 + -/systems/fuel/internal/center-tank-eng-2 propulsion/tank[2]/external-flow-rate-pps