1
0
Fork 0

Add temporary wind temp (simplified for testing)

This commit is contained in:
Matthew Maring 2020-05-03 13:29:46 -04:00
parent 859c419074
commit 1cd3e66d24
5 changed files with 14 additions and 10 deletions

View file

@ -139,6 +139,7 @@ var min_dest_fob = props.globals.getNode("/FMGC/internal/min-dest-fob", 1);
var tow = props.globals.getNode("/FMGC/internal/tow", 1); var tow = props.globals.getNode("/FMGC/internal/tow", 1);
var lw = props.globals.getNode("/FMGC/internal/lw", 1); var lw = props.globals.getNode("/FMGC/internal/lw", 1);
var trip_wind = props.globals.getNode("/FMGC/internal/trip-wind", 1); var trip_wind = props.globals.getNode("/FMGC/internal/trip-wind", 1);
var trip_wind_value = props.globals.getNode("/FMGC/internal/trip-wind-value", 1);
var extra_fuel = props.globals.getNode("/FMGC/internal/extra-fuel", 1); var extra_fuel = props.globals.getNode("/FMGC/internal/extra-fuel", 1);
var extra_time = props.globals.getNode("/FMGC/internal/extra-time", 1); var extra_time = props.globals.getNode("/FMGC/internal/extra-time", 1);
var taxi_fuel_set = props.globals.getNode("/FMGC/internal/taxi-fuel-set", 1); var taxi_fuel_set = props.globals.getNode("/FMGC/internal/taxi-fuel-set", 1);

View file

@ -224,16 +224,12 @@ var updateFuel = func {
dist = 0; dist = 0;
} }
# wind = getprop("/FMGC/internal/trip-wind"); wind = getprop("/FMGC/internal/trip-wind");
# if (find("TL", wind) != -1 or find("HD", wind) != -1) { wind_value = getprop("/FMGC/internal/trip-wind-value");
# effwind = substr(wind, 2); if (find("HD", wind) != -1 or find("-", wind) != -1 or find("H", wind) != -1) {
# wind_value = wind_value * -1;
# } else if (find("-", wind) != -1 or find("+", wind) != -1 or find("T", wind) != -1 or find("H", wind) != -1) { }
# effwind = substr(wind, 1); dist = dist - (dist * wind_value * 0.002);
#
# } else {
# #positive tail wind
# }
trip_fuel = 4.003e+02 + (dist * -5.399e+01) + (dist * dist * -7.322e-02) + (dist * dist * dist * 1.091e-05) + (dist * dist * dist * dist * 2.962e-10) + (dist * dist * dist * dist * dist * -1.178e-13) + (dist * dist * dist * dist * dist * dist * 6.322e-18) + (crz * 5.387e+01) + (dist * crz * 1.583e+00) + (dist * dist * crz * 7.695e-04) + (dist * dist * dist * crz * -1.057e-07) + (dist * dist * dist * dist * crz * 1.138e-12) + (dist * dist * dist * dist * dist * crz * 1.736e-16) + (crz * crz * -1.171e+00) + (dist * crz * crz * -1.219e-02) + (dist * dist * crz * crz * -2.879e-06) + (dist * dist * dist * crz * crz * 3.115e-10) + (dist * dist * dist * dist * crz * crz * -4.093e-15) + (crz * crz * crz * 9.160e-03) + (dist * crz * crz * crz * 4.311e-05) + (dist * dist * crz * crz * crz * 4.532e-09) + (dist * dist * dist * crz * crz * crz * -2.879e-13) + (crz * crz * crz * crz * -3.338e-05) + (dist * crz * crz * crz * crz * -7.340e-08) + (dist * dist * crz * crz * crz * crz * -2.494e-12) + (crz * crz * crz * crz * crz * 5.849e-08) + (dist * crz * crz * crz * crz * crz * 4.898e-11) + (crz * crz * crz * crz * crz * crz * -3.999e-11); trip_fuel = 4.003e+02 + (dist * -5.399e+01) + (dist * dist * -7.322e-02) + (dist * dist * dist * 1.091e-05) + (dist * dist * dist * dist * 2.962e-10) + (dist * dist * dist * dist * dist * -1.178e-13) + (dist * dist * dist * dist * dist * dist * 6.322e-18) + (crz * 5.387e+01) + (dist * crz * 1.583e+00) + (dist * dist * crz * 7.695e-04) + (dist * dist * dist * crz * -1.057e-07) + (dist * dist * dist * dist * crz * 1.138e-12) + (dist * dist * dist * dist * dist * crz * 1.736e-16) + (crz * crz * -1.171e+00) + (dist * crz * crz * -1.219e-02) + (dist * dist * crz * crz * -2.879e-06) + (dist * dist * dist * crz * crz * 3.115e-10) + (dist * dist * dist * dist * crz * crz * -4.093e-15) + (crz * crz * crz * 9.160e-03) + (dist * crz * crz * crz * 4.311e-05) + (dist * dist * crz * crz * crz * 4.532e-09) + (dist * dist * dist * crz * crz * crz * -2.879e-13) + (crz * crz * crz * crz * -3.338e-05) + (dist * crz * crz * crz * crz * -7.340e-08) + (dist * dist * crz * crz * crz * crz * -2.494e-12) + (crz * crz * crz * crz * crz * 5.849e-08) + (dist * crz * crz * crz * crz * crz * 4.898e-11) + (crz * crz * crz * crz * crz * crz * -3.999e-11);
if (trip_fuel < 400) { if (trip_fuel < 400) {

View file

@ -22,6 +22,7 @@ var min_dest_fob = props.globals.getNode("FMGC/internal/min-dest-fob", 1);
var tow = props.globals.getNode("FMGC/internal/tow", 1); var tow = props.globals.getNode("FMGC/internal/tow", 1);
var lw = props.globals.getNode("FMGC/internal/lw", 1); var lw = props.globals.getNode("FMGC/internal/lw", 1);
var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1); var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
var trip_wind_value = props.globals.getNode("FMGC/internal/trip-wind", 1);
var fob = props.globals.getNode("FMGC/internal/fob", 1); var fob = props.globals.getNode("FMGC/internal/fob", 1);
var fffq_sensor = props.globals.getNode("FMGC/internal/fffq-sensor", 1); var fffq_sensor = props.globals.getNode("FMGC/internal/fffq-sensor", 1);
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1); var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);

View file

@ -214,6 +214,7 @@ var initInputB = func(key, i) {
setprop("/FMGC/internal/tow", 0); setprop("/FMGC/internal/tow", 0);
setprop("/FMGC/internal/lw", 0); setprop("/FMGC/internal/lw", 0);
setprop("/FMGC/internal/trip-wind", "HD000"); setprop("/FMGC/internal/trip-wind", "HD000");
setprop("/FMGC/internal/trip-wind-value", 0);
setprop("/FMGC/internal/fffq-sensor", "FF+FQ"); setprop("/FMGC/internal/fffq-sensor", "FF+FQ");
setprop("/FMGC/internal/extra-fuel", 0); setprop("/FMGC/internal/extra-fuel", 0);
setprop("/FMGC/internal/extra-time", "0000"); setprop("/FMGC/internal/extra-time", "0000");
@ -256,6 +257,7 @@ var initInputB = func(key, i) {
} else if (key == "R5" and !getprop("/FMGC/internal/fuel-calculating")) { } else if (key == "R5" and !getprop("/FMGC/internal/fuel-calculating")) {
if (scratchpad == "CLR") { if (scratchpad == "CLR") {
setprop("/FMGC/internal/trip-wind", "HD000"); setprop("/FMGC/internal/trip-wind", "HD000");
setprop("/FMGC/internal/trip-wind-value", 0);
if (getprop("/FMGC/internal/block-confirmed")) { if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/fuel-calculating", 1);
} }
@ -266,6 +268,7 @@ var initInputB = func(key, i) {
var effwind = substr(scratchpad, 2); var effwind = substr(scratchpad, 2);
if (int(effwind) != nil and effwind >= 0 and effwind <= 500) { if (int(effwind) != nil and effwind >= 0 and effwind <= 500) {
setprop("/FMGC/internal/trip-wind", scratchpad); setprop("/FMGC/internal/trip-wind", scratchpad);
setprop("/FMGC/internal/trip-wind-value", effwind);
if (getprop("/FMGC/internal/block-confirmed")) { if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/fuel-calculating", 1);
} }
@ -277,6 +280,7 @@ var initInputB = func(key, i) {
var effwind = substr(scratchpad, 1); var effwind = substr(scratchpad, 1);
if (int(effwind) != nil and effwind >= 0 and effwind <= 500) { if (int(effwind) != nil and effwind >= 0 and effwind <= 500) {
setprop("/FMGC/internal/trip-wind", scratchpad); setprop("/FMGC/internal/trip-wind", scratchpad);
setprop("/FMGC/internal/trip-wind-value", effwind);
if (getprop("/FMGC/internal/block-confirmed")) { if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/fuel-calculating", 1);
} }
@ -287,6 +291,7 @@ var initInputB = func(key, i) {
} else { } else {
if (num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 500) { if (num(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 500) {
setprop("/FMGC/internal/trip-wind", scratchpad); setprop("/FMGC/internal/trip-wind", scratchpad);
setprop("/FMGC/internal/trip-wind-value", scratchpad);
if (getprop("/FMGC/internal/block-confirmed")) { if (getprop("/FMGC/internal/block-confirmed")) {
setprop("/FMGC/internal/fuel-calculating", 1); setprop("/FMGC/internal/fuel-calculating", 1);
} }

View file

@ -114,6 +114,7 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/tow", 0); setprop("/FMGC/internal/tow", 0);
setprop("/FMGC/internal/lw", 0); setprop("/FMGC/internal/lw", 0);
setprop("/FMGC/internal/trip-wind", "HD000"); setprop("/FMGC/internal/trip-wind", "HD000");
setprop("/FMGC/internal/trip-wind-value", 0);
setprop("/FMGC/internal/fffq-sensor", "FF+FQ"); setprop("/FMGC/internal/fffq-sensor", "FF+FQ");
setprop("/FMGC/internal/extra-fuel", 0); setprop("/FMGC/internal/extra-fuel", 0);
setprop("/FMGC/internal/extra-time", "0000"); setprop("/FMGC/internal/extra-time", "0000");