1
0
Fork 0

Fix Refuel panel

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2020-09-24 15:48:16 +10:00
parent 6f0114457d
commit 4e13f3fa05

View file

@ -6,7 +6,7 @@
# Distribute under the terms of GPLv2.
# Conversion factor pounds to kilogram
LBS2KGS = 0.4535924;
var LBS2KGS = 0.4535924;
if (pts.Sim.aero.getValue() == "A320-200-CFM") {
max_fuel = 42.8;
@ -590,25 +590,45 @@ var refuelClass = {
_fuelAdjustDn: func() {
target = amount.getValue();
if (target > 0) {
amount.setValue(target - 0.1);
if (target - 0.1 >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", target - 0.1));
if (acconfig_weight_kgs.getValue() == 1) {
amount.setValue(target - 0.1 * LBS2KGS);
if ((target - 0.1) * LBS2KGS >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", (target - 0.1) * LBS2KGS));
} else {
me._FQI_pre.setText(sprintf("%2.2f", (target - 0.1) * LBS2KGS));
}
systems.fuelSvc.Nodes.requestLbs.setValue((((target - 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
} else {
me._FQI_pre.setText(sprintf("%2.2f", target - 0.1));
amount.setValue(target - 0.1);
if (target - 0.1 >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", target - 0.1));
} else {
me._FQI_pre.setText(sprintf("%2.2f", target - 0.1));
}
systems.fuelSvc.Nodes.requestLbs.setValue(((target - 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
}
systems.fuelSvc.Nodes.requestLbs.setValue(((target - 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
}
},
_fuelAdjustUp: func() {
target = amount.getValue();
if (target < max_fuel) {
amount.setValue(target + 0.1);
if (target + 0.1 >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", target + 0.1));
if (acconfig_weight_kgs.getValue() == 1) {
amount.setValue(target + 0.1);
if ((target + 0.1) * LBS2KGS >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", (target + 0.1) * LBS2KGS));
} else {
me._FQI_pre.setText(sprintf("%2.2f", (target + 0.1) * LBS2KGS));
}
systems.fuelSvc.Nodes.requestLbs.setValue((((target + 0.1) * LBS2KGS) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
} else {
me._FQI_pre.setText(sprintf("%2.2f", target + 0.1));
amount.setValue(target + 0.1);
if (target + 0.1 >= 10.0) {
me._FQI_pre.setText(sprintf("%2.1f", target + 0.1));
} else {
me._FQI_pre.setText(sprintf("%2.2f", target + 0.1));
}
systems.fuelSvc.Nodes.requestLbs.setValue(((target + 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
}
systems.fuelSvc.Nodes.requestLbs.setValue(((target + 0.1) - math.round(pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000, 0.1)) * 1000);
}
},
_onClose: func() {