Added KGS to refuel panel
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
3c09505e5c
commit
a7dd98555f
1 changed files with 31 additions and 7 deletions
|
@ -5,6 +5,9 @@
|
||||||
|
|
||||||
# Distribute under the terms of GPLv2.
|
# Distribute under the terms of GPLv2.
|
||||||
|
|
||||||
|
# Conversion factor pounds to kilogram
|
||||||
|
LBS2KGS = 0.4535924;
|
||||||
|
|
||||||
if (pts.Sim.aero.getValue() == "A320-200-CFM") {
|
if (pts.Sim.aero.getValue() == "A320-200-CFM") {
|
||||||
max_fuel = 42.8;
|
max_fuel = 42.8;
|
||||||
} elsif (pts.Sim.aero.getValue() == "A320-200-IAE" or pts.Sim.aero.getValue() == "A320-100-CFM") {
|
} elsif (pts.Sim.aero.getValue() == "A320-200-IAE" or pts.Sim.aero.getValue() == "A320-100-CFM") {
|
||||||
|
@ -14,6 +17,7 @@ if (pts.Sim.aero.getValue() == "A320-200-CFM") {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get nodes
|
# Get nodes
|
||||||
|
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
|
||||||
var valve_l_guard = props.globals.getNode("/controls/fuel/refuel/valve-l-guard", 1);
|
var valve_l_guard = props.globals.getNode("/controls/fuel/refuel/valve-l-guard", 1);
|
||||||
var valve_c_guard = props.globals.getNode("/controls/fuel/refuel/valve-c-guard", 1);
|
var valve_c_guard = props.globals.getNode("/controls/fuel/refuel/valve-c-guard", 1);
|
||||||
var valve_r_guard = props.globals.getNode("/controls/fuel/refuel/valve-r-guard", 1);
|
var valve_r_guard = props.globals.getNode("/controls/fuel/refuel/valve-r-guard", 1);
|
||||||
|
@ -135,6 +139,9 @@ var refuelClass = {
|
||||||
|
|
||||||
me._END_ind = me._svg.getElementById("END-ind");
|
me._END_ind = me._svg.getElementById("END-ind");
|
||||||
|
|
||||||
|
me._Fuel_unit_1 = me._svg.getElementById("Fuel-unit-1");
|
||||||
|
me._Fuel_unit_2 = me._svg.getElementById("Fuel-unit-2");
|
||||||
|
|
||||||
# Load current panel state
|
# Load current panel state
|
||||||
# Guards
|
# Guards
|
||||||
if (valve_l_guard.getValue() == 1) {
|
if (valve_l_guard.getValue() == 1) {
|
||||||
|
@ -481,6 +488,13 @@ var refuelClass = {
|
||||||
me._timer.start();
|
me._timer.start();
|
||||||
},
|
},
|
||||||
_timerf: func() {
|
_timerf: func() {
|
||||||
|
if (acconfig_weight_kgs.getValue() == 1) {
|
||||||
|
me._Fuel_unit_1.setText("KG");
|
||||||
|
me._Fuel_unit_2.setText("KG");
|
||||||
|
} else {
|
||||||
|
me._Fuel_unit_1.setText("LBS");
|
||||||
|
me._Fuel_unit_2.setText("LBS");
|
||||||
|
}
|
||||||
# Check power
|
# Check power
|
||||||
# TODO cut off power when turned on with BATT POWER switch:
|
# TODO cut off power when turned on with BATT POWER switch:
|
||||||
# The electrical supply is automatically cut off:
|
# The electrical supply is automatically cut off:
|
||||||
|
@ -493,11 +507,21 @@ var refuelClass = {
|
||||||
me._FQI_C.show();
|
me._FQI_C.show();
|
||||||
me._FQI_R.show();
|
me._FQI_R.show();
|
||||||
|
|
||||||
|
if (acconfig_weight_kgs.getValue() == 1) {
|
||||||
|
me._fuelPreselectAmount = amount.getValue() * LBS2KGS;
|
||||||
|
me._fuelLeftAmount = ((systems.FUEL.Quantity.leftOuter.getValue() + systems.FUEL.Quantity.leftInner.getValue()) / 1000) * LBS2KGS;
|
||||||
|
me._fuelCenterAmount = (systems.FUEL.Quantity.center.getValue() / 1000) * LBS2KGS;
|
||||||
|
me._fuelRightAmount = ((systems.FUEL.Quantity.rightOuter.getValue() + systems.FUEL.Quantity.rightInner.getValue()) / 1000) * LBS2KGS;
|
||||||
|
me._fuelTotalAmount = (pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000) * LBS2KGS;
|
||||||
|
var actual_fuel = pts.Consumables.Fuel.totalFuelLbs.getValue() * LBS2KGS;
|
||||||
|
} else {
|
||||||
me._fuelPreselectAmount = amount.getValue();
|
me._fuelPreselectAmount = amount.getValue();
|
||||||
me._fuelLeftAmount = (systems.FUEL.Quantity.leftOuter.getValue() + systems.FUEL.Quantity.leftInner.getValue()) / 1000;
|
me._fuelLeftAmount = (systems.FUEL.Quantity.leftOuter.getValue() + systems.FUEL.Quantity.leftInner.getValue()) / 1000;
|
||||||
me._fuelCenterAmount = systems.FUEL.Quantity.center.getValue() / 1000;
|
me._fuelCenterAmount = systems.FUEL.Quantity.center.getValue() / 1000;
|
||||||
me._fuelRightAmount = (systems.FUEL.Quantity.rightOuter.getValue() + systems.FUEL.Quantity.rightInner.getValue()) / 1000;
|
me._fuelRightAmount = (systems.FUEL.Quantity.rightOuter.getValue() + systems.FUEL.Quantity.rightInner.getValue()) / 1000;
|
||||||
me._fuelTotalAmount = pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000;
|
me._fuelTotalAmount = pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000;
|
||||||
|
var actual_fuel = pts.Consumables.Fuel.totalFuelLbs.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
if (me._fuelPreselectAmount >= 10.0) {
|
if (me._fuelPreselectAmount >= 10.0) {
|
||||||
me._FQI_pre.setText(sprintf("%2.1f", me._fuelPreselectAmount));
|
me._FQI_pre.setText(sprintf("%2.1f", me._fuelPreselectAmount));
|
||||||
|
@ -524,9 +548,9 @@ var refuelClass = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me._fuelTotalAmount >= 10.0) {
|
if (me._fuelTotalAmount >= 10.0) {
|
||||||
me._FQI_actual.setText(sprintf("%2.1f", pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000));
|
me._FQI_actual.setText(sprintf("%2.1f", actual_fuel / 1000));
|
||||||
} else {
|
} else {
|
||||||
me._FQI_actual.setText(sprintf("%2.2f", pts.Consumables.Fuel.totalFuelLbs.getValue() / 1000));
|
me._FQI_actual.setText(sprintf("%2.2f", actual_fuel / 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
# HI LVL indicator color: #0184f6
|
# HI LVL indicator color: #0184f6
|
||||||
|
|
Loading…
Reference in a new issue