1
0
Fork 0

Fuel flow sensors on ECAM fuel page powered with FADEC self-test. Also, the fuel used is now reset when engine start occurs

This commit is contained in:
legoboyvdlp R 2020-09-12 17:43:00 +01:00
parent 73ccd4e5ab
commit 2f6d04b2fd
5 changed files with 55 additions and 41 deletions

View file

@ -1254,6 +1254,8 @@
<valves>
<apu-lp-valve-cmd type="bool">0</apu-lp-valve-cmd>
</valves>
<offset-left type="double">0</offset-left>
<offset-right type="double">0</offset-right>
<fuel-used-1 type="double">0</fuel-used-1>
<fuel-used-2 type="double">0</fuel-used-2>
<mode-fault type="bool">0</mode-fault>

View file

@ -211,6 +211,7 @@ var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1);
var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
var fadecPowerUp = props.globals.getNode("/systems/fadec/powerup", 1);
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1);
@ -2440,7 +2441,7 @@ var canvas_lowerECAM_fuel = {
me["FFlow-weight-unit"].setText("LBS/MIN");
}
if (fadec1.getValue() == 1 and fadec2.getValue() == 1) {
if (fadec1.getValue() and fadec2.getValue() or fadecPowerUp.getValue()) {
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
if (_weight_kgs == 1) {
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10)));

View file

@ -256,7 +256,6 @@ var systemsLoop = maketimer(0.1, func {
systems.ELEC.loop();
systems.PNEU.loop();
systems.HYD.loop();
systems.FUEL.loop();
systems.ADIRS.loop();
ecam.ECAM.loop();
libraries.BUTTONS.update();

View file

@ -7,8 +7,8 @@ var FUEL = {
offset1: 0,
offset2: 0,
timeEngStart: 0,
cmdCtrOn: props.globals.getNode("systems/fuel/ctr-pump-cmd-on-eng-start"),
refuelling: props.globals.getNode("systems/fuel/refuel/refuelling"),
cmdCtrOn: props.globals.getNode("/systems/fuel/ctr-pump-cmd-on-eng-start"),
refuelling: props.globals.getNode("/systems/fuel/refuel/refuelling"),
Fail: {
pumpLeft1: props.globals.getNode("/systems/failures/fuel/left-tank-pump-1"),
@ -19,43 +19,43 @@ var FUEL = {
pumpRight2: props.globals.getNode("/systems/failures/fuel/right-tank-pump-2"),
},
Switches: {
centerTkMode: props.globals.getNode("controls/fuel/switches/center-mode"),
crossfeed: props.globals.getNode("controls/fuel/switches/crossfeed"),
pumpLeft1: props.globals.getNode("controls/fuel/switches/pump-left-1"),
pumpLeft2: props.globals.getNode("controls/fuel/switches/pump-left-2"),
pumpCenter1: props.globals.getNode("controls/fuel/switches/pump-center-1"),
pumpCenter2: props.globals.getNode("controls/fuel/switches/pump-center-2"),
pumpRight1: props.globals.getNode("controls/fuel/switches/pump-right-1"),
pumpRight2: props.globals.getNode("controls/fuel/switches/pump-right-2"),
centerTkMode: props.globals.getNode("/controls/fuel/switches/center-mode"),
crossfeed: props.globals.getNode("/controls/fuel/switches/crossfeed"),
pumpLeft1: props.globals.getNode("/controls/fuel/switches/pump-left-1"),
pumpLeft2: props.globals.getNode("/controls/fuel/switches/pump-left-2"),
pumpCenter1: props.globals.getNode("/controls/fuel/switches/pump-center-1"),
pumpCenter2: props.globals.getNode("/controls/fuel/switches/pump-center-2"),
pumpRight1: props.globals.getNode("/controls/fuel/switches/pump-right-1"),
pumpRight2: props.globals.getNode("/controls/fuel/switches/pump-right-2"),
},
Pumps: {
apu: props.globals.getNode("systems/fuel/pumps/apu-operate"),
allOff: props.globals.getNode("systems/fuel/pumps/all-eng-pump-off"),
apu: props.globals.getNode("/systems/fuel/pumps/apu-operate"),
allOff: props.globals.getNode("/systems/fuel/pumps/all-eng-pump-off"),
},
Valves: {
apu: props.globals.getNode("systems/fuel/valves/apu-lp-valve"),
crossfeed: props.globals.getNode("systems/fuel/valves/crossfeed-valve"),
lpValve1: props.globals.getNode("systems/fuel/valves/engine-1-lp-valve"),
lpValve2: props.globals.getNode("systems/fuel/valves/engine-2-lp-valve"),
transfer1: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-1"),
transfer2: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-2"),
refuelLeft: props.globals.getNode("systems/fuel/refuel/left-valve"),
refuelCenter: props.globals.getNode("systems/fuel/refuel/center-valve"),
refuelRight: props.globals.getNode("systems/fuel/refuel/right-valve"),
apu: props.globals.getNode("/systems/fuel/valves/apu-lp-valve"),
crossfeed: props.globals.getNode("/systems/fuel/valves/crossfeed-valve"),
lpValve1: props.globals.getNode("/systems/fuel/valves/engine-1-lp-valve"),
lpValve2: props.globals.getNode("/systems/fuel/valves/engine-2-lp-valve"),
transfer1: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-1"),
transfer2: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-2"),
refuelLeft: props.globals.getNode("/systems/fuel/refuel/left-valve"),
refuelCenter: props.globals.getNode("/systems/fuel/refuel/center-valve"),
refuelRight: props.globals.getNode("/systems/fuel/refuel/right-valve"),
},
Quantity: {
leftOuter: props.globals.getNode("consumables/fuel/tank[0]/level-lbs"),
leftOuterPct: props.globals.getNode("consumables/fuel/tank[0]/level-norm"),
leftInner: props.globals.getNode("consumables/fuel/tank[1]/level-lbs"),
leftInnerPct: props.globals.getNode("consumables/fuel/tank[1]/level-norm"),
center: props.globals.getNode("consumables/fuel/tank[2]/level-lbs"),
centerPct: props.globals.getNode("consumables/fuel/tank[2]/level-norm"),
rightInner: props.globals.getNode("consumables/fuel/tank[3]/level-lbs"),
rightInnerPct: props.globals.getNode("consumables/fuel/tank[3]/level-norm"),
rightOuter: props.globals.getNode("consumables/fuel/tank[4]/level-lbs"),
rightOuterPct: props.globals.getNode("consumables/fuel/tank[4]/level-norm"),
usedLeft: props.globals.getNode("systems/fuel/fuel-used-1"),
usedRight: props.globals.getNode("systems/fuel/fuel-used-2"),
leftOuter: props.globals.getNode("/consumables/fuel/tank[0]/level-lbs"),
leftOuterPct: props.globals.getNode("/consumables/fuel/tank[0]/level-norm"),
leftInner: props.globals.getNode("/consumables/fuel/tank[1]/level-lbs"),
leftInnerPct: props.globals.getNode("/consumables/fuel/tank[1]/level-norm"),
center: props.globals.getNode("/consumables/fuel/tank[2]/level-lbs"),
centerPct: props.globals.getNode("/consumables/fuel/tank[2]/level-norm"),
rightInner: props.globals.getNode("/consumables/fuel/tank[3]/level-lbs"),
rightInnerPct: props.globals.getNode("/consumables/fuel/tank[3]/level-norm"),
rightOuter: props.globals.getNode("/consumables/fuel/tank[4]/level-lbs"),
rightOuterPct: props.globals.getNode("/consumables/fuel/tank[4]/level-norm"),
offsetLeft: props.globals.getNode("/systems/fuel/offset-left"),
offsetRight: props.globals.getNode("/systems/fuel/offset-right"),
},
resetFail: func() {
me.Fail.pumpLeft1.setValue(0);
@ -68,13 +68,11 @@ var FUEL = {
init: func() {
me.resetFail();
},
loop: func() {
systems.FUEL.Quantity.usedLeft.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue() + me.offset1);
systems.FUEL.Quantity.usedRight.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue() + me.offset2);
setOffsetLeft: func() {
me.Quantity.offsetLeft.setValue(me.Quantity.offsetLeft.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
},
setOffset: func() {
me.offset1 = me.offset1 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
me.offset2 = me.offset2 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
setOffsetRight: func() {
me.Quantity.offsetRight.setValue(me.Quantity.offsetRight.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
}
};
@ -83,6 +81,8 @@ setlistener("/engines/engine[0]/state", func() {
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
FUEL.cmdCtrOn.setValue(1);
ctrTkTimer.start();
} elsif (pts.Engines.Engine.state[0].getValue() == 2) {
FUEL.setOffsetLeft();
}
}, 0, 0);
@ -91,6 +91,8 @@ setlistener("/engines/engine[1]/state", func() {
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
FUEL.cmdCtrOn.setValue(1);
ctrTkTimer.start();
} elsif (pts.Engines.Engine.state[1].getValue() == 2) {
FUEL.setOffsetRight();
}
}, 0, 0);

View file

@ -410,6 +410,16 @@
<channel name="Flow Rates" execrate="2">
<summer name="/systems/fuel/fuel-used-1">
<input>/systems/fuel/offset-left</input>
<input>propulsion/engine[0]/fuel-used-lbs</input>
</summer>
<summer name="/systems/fuel/fuel-used-2">
<input>/systems/fuel/offset-right</input>
<input>propulsion/engine[1]/fuel-used-lbs</input>
</summer>
<switch name="/systems/fuel/feed-left-inner">
<default value="0"/>
<test logic="OR" value="1">