Fix bug in fuel systems
This commit is contained in:
parent
8e6cebb080
commit
56095591b3
3 changed files with 14 additions and 14 deletions
|
@ -1213,9 +1213,9 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R6S"].setText("EXTRA/TIME");
|
||||
|
||||
if (blockSet.getValue() == 1 and zfwSet.getValue() == 1) {
|
||||
setprop("FMGC/internal/rte-rsv", num((fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(fob.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
# From INIT-B
|
||||
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
|
||||
var fob = props.globals.getNode("FMGC/internal/fob", 1);
|
||||
var block = props.globals.getNode("FMGC/internal/block", 1);
|
||||
var taxi_fuel = props.globals.getNode("FMGC/internal/taxi-fuel", 1);
|
||||
var trip_fuel = props.globals.getNode("FMGC/internal/trip-fuel", 1);
|
||||
var trip_time = props.globals.getNode("FMGC/internal/trip-time", 1);
|
||||
|
@ -59,9 +59,9 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/alt-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(fob.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
|
||||
} else {
|
||||
|
@ -81,9 +81,9 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/final-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
setprop("FMGC/internal/min-dest-fob", num(alt_fuel.getValue() + final_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(fob.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(fob.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-rsv", num((block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue()) * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100)));
|
||||
setprop("FMGC/internal/trip-fuel", num(block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - rte_rsv.getValue()));
|
||||
setprop("FMGC/internal/tow", num(block.getValue() + zfw.getValue() - taxi_fuel.getValue()));
|
||||
setprop("FMGC/internal/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
} else {
|
||||
notAllowed(i);
|
||||
|
@ -110,7 +110,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/zfwcg", zfwcg);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/zfw", zfw);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -78,7 +78,7 @@ var MCDU_reset = func(i) {
|
|||
setprop("FMGC/internal/zfw-set", 0);
|
||||
setprop("FMGC/internal/zfwcg", 55.1);
|
||||
setprop("FMGC/internal/zfwcg-set", 0);
|
||||
setprop("FMGC/internal/block", 0);
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
setprop("FMGC/internal/block-set", 0);
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("FMGC/internal/trip-fuel", 0);
|
||||
|
|
Loading…
Reference in a new issue