Fix Refuel panel
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
6f0114457d
commit
4e13f3fa05
1 changed files with 31 additions and 11 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue