1
0
Fork 0

A320: fix refuelling

t :wq
This commit is contained in:
legoboyvdlp R 2019-11-11 18:59:37 +00:00
parent b7dc1c91e0
commit a89f2e00d9
3 changed files with 29 additions and 7 deletions

View file

@ -6,6 +6,15 @@
<PropertyList>
<nasal>
<close>
<![CDATA[
systems.FUEL.Nodes.requestLbs.setValue(0);
]]>
</close>
</nasal>
<name>fuel-dlg</name>
<layout>vbox</layout>
@ -132,11 +141,22 @@
<binding>
<command>nasal</command>
<script>
if ((getprop("/services/fuel-truck/enable") == 1) and (getprop("/services/fuel-truck/connect") == 1)) {
systems.fuelSvc.refuel();
screen.log.write("Refueling process started.", 0, 0.584, 1);
} else
screen.log.write("Please Enable and Connect the Fuel Truck First!", 1, 0, 0);
<![CDATA[
if (systems.fuelSvc.Nodes.requestLbs.getValue() > 0) {
if ((getprop("/services/fuel-truck/enable") == 1) and getprop("/services/fuel-truck/connect") == 1) {
if (systems.fuelSvc.Nodes.requestTotalLbs.getValue() - pts.Consumables.Fuel.totalFuelLbs.getValue() > 0) {
systems.fuelSvc.refuel();
screen.log.write("Refueling process started.", 0, 0.584, 1);
} else {
screen.log.write("Refuelling complete.", 0, 0.584, 1);
}
} else {
screen.log.write("Please Enable and Connect the Fuel Truck First!", 1, 0, 0);
}
} else {
screen.log.write("Refuelling quantity incorrect.", 0, 0.584, 1);
}
]]>
</script>
</binding>
</button>

View file

@ -44,6 +44,7 @@ var fuelSvc = {
stop: func() {
systems.FUEL.refuelling.setBoolValue(0);
me.Nodes.requestLbs.setValue(0);
systems.FUEL.Valves.refuelLeft.setBoolValue(0);
systems.FUEL.Valves.refuelCenter.setBoolValue(0);
systems.FUEL.Valves.refuelRight.setBoolValue(0);
@ -80,7 +81,8 @@ var fuelTimer = maketimer(0.25, func() {
systems.FUEL.Valves.refuelRight.setBoolValue(0);
}
if (abs(pts.Consumables.Fuel.totalFuelLbs.getValue() - fuelSvc.Nodes.requestTotalLbs.getValue()) < 5) {
if (fuelSvc.Nodes.requestTotalLbs.getValue() - pts.Consumables.Fuel.totalFuelLbs.getValue() <= 0) {
screen.log.write("Refuelling complete.", 0, 0.584, 1);
fuelSvc.stop();
fuelTimer.stop();
}

View file

@ -1 +1 @@
10
11