1
0
Fork 0

Move speed calcs away from setprop/getprop

This commit is contained in:
Matthew Maring 2020-08-01 12:49:54 -04:00
parent c75df53506
commit 7edaf22381
5 changed files with 192 additions and 171 deletions

View file

@ -3759,7 +3759,7 @@ var canvas_MCDU_base = {
me["Simple_C2"].setText(sprintf("%3.0f", getprop("/FMGC/internal/computed-speeds/slat_appr")));
me["Simple_C3"].setText(sprintf("%3.0f", getprop("/FMGC/internal/computed-speeds/clean_appr")));
me["Simple_C5"].setText(sprintf("%3.0f", getprop("/FMGC/internal/computed-speeds/vls_appr")));
me["Simple_L5"].setText(sprintf("%3.0f", getprop("/FMGC/internal/computed-speeds/vapp_appr")));
me["Simple_L5"].setText(sprintf("%3.0f", fmgc.FMGCInternal.vapp_appr));
me.fontLeft(0, 0, 0, 0, default, 0);
if (vapp_speed_set.getValue()) {
me.fontSizeLeft(0, 0, 0, 0, normal, 0);
@ -3772,7 +3772,7 @@ var canvas_MCDU_base = {
me["Simple_C3"].setText(" ---");
me["Simple_C5"].setText(" ---");
if (vapp_speed_set.getValue()) {
me["Simple_L5"].setText(sprintf("%3.0f", getprop("/FMGC/internal/computed-speeds/vapp_appr")));
me["Simple_L5"].setText(sprintf("%3.0f", fmgc.FMGCInternal.vapp_appr));
me.fontLeft(0, 0, 0, 0, default, 0);
me.fontSizeLeft(0, 0, 0, 0, normal, 0);
} else {

View file

@ -1207,7 +1207,7 @@ var canvas_PFD_1 = {
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (!fmgc.FMGCInternal.takeoffState and fmgc.FMGCInternal.phase >= 1 and !wow1.getValue() and !wow2.getValue()) {
me.FMGC_vls = getprop("/FMGC/internal/computed-speeds/vls_min");
me.FMGC_vls = fmgc.FMGCInternal.vls_min;
if (me.FMGC_vls <= 30) {
me.VLSmin = 0 - me.ASI;
} else if (me.FMGC_vls >= 420) {
@ -1231,7 +1231,7 @@ var canvas_PFD_1 = {
} else {
me.ALPHAmax = me.FMGC_max - 30 - me.ASI;
}
me.FMGC_vsw = getprop("/FMGC/internal/computed-speeds/vsw");
me.FMGC_vsw = fmgc.FMGCInternal.vsw;
if (me.FMGC_vsw <= 30) {
me.ALPHAvsw = 0 - me.ASI;
} else if (me.FMGC_vsw >= 420) {
@ -1262,14 +1262,14 @@ var canvas_PFD_1 = {
if (managed_spd.getValue() == 1) {
if (getprop("/FMGC/internal/decel") == 1) {
if (getprop("/FMGC/internal/vapp-speed-set")) {
vapp = getprop("/FMGC/internal/computed-speeds/vapp_appr");
vapp = fmgc.FMGCInternal.vapp_appr;
} else {
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
vapp = fmgc.FMGCInternal.vapp;
}
tgt_ias = vapp;
tgt_kts = vapp;
} else if (fmgc.FMGCInternal.phase == 6) {
clean = getprop("/FMGC/internal/computed-speeds/clean");
clean = fmgc.FMGCInternal.clean;
tgt_ias = clean;
tgt_kts = clean;
}
@ -1409,7 +1409,7 @@ var canvas_PFD_1 = {
me["F_target"].hide();
me["clean_speed"].hide();
tgt_S = getprop("/FMGC/internal/computed-speeds/slat");
tgt_S = fmgc.FMGCInternal.slat;
if (tgt_S <= 30) {
me.Strgt = 0 - me.ASI;
@ -1443,7 +1443,7 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["clean_speed"].hide();
tgt_F = getprop("/FMGC/internal/computed-speeds/flap2");
tgt_F = fmgc.FMGCInternal.flap2;
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -1477,7 +1477,7 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["clean_speed"].hide();
tgt_F = getprop("/FMGC/internal/computed-speeds/flap3");
tgt_F = fmgc.FMGCInternal.flap3;
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -1516,7 +1516,7 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["F_target"].hide();
tgt_clean = getprop("/FMGC/internal/computed-speeds/clean");
tgt_clean = fmgc.FMGCInternal.clean;
me.cleantrgt = tgt_clean - 30 - me.ASI;
me.SPDcleantrgtdiff = tgt_clean - ind_spd;
@ -1945,7 +1945,7 @@ var canvas_PFD_2 = {
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (!fmgc.FMGCInternal.takeoffState and fmgc.FMGCInternal.phase >= 1 and !wow1.getValue() and !wow2.getValue()) {
me.FMGC_vls = getprop("/FMGC/internal/computed-speeds/vls_min");
me.FMGC_vls = fmgc.FMGCInternal.vls_min;
if (me.FMGC_vls <= 30) {
me.VLSmin = 0 - me.ASI;
} else if (me.FMGC_vls >= 420) {
@ -1969,7 +1969,7 @@ var canvas_PFD_2 = {
} else {
me.ALPHAmax = me.FMGC_max - 30 - me.ASI;
}
me.FMGC_vsw = getprop("/FMGC/internal/computed-speeds/vsw");
me.FMGC_vsw = fmgc.FMGCInternal.vsw;
if (me.FMGC_vsw <= 30) {
me.ALPHAvsw = 0 - me.ASI;
} else if (me.FMGC_vsw >= 420) {
@ -2000,14 +2000,14 @@ var canvas_PFD_2 = {
if (managed_spd.getValue() == 1) {
if (getprop("/FMGC/internal/decel") == 1) {
if (getprop("/FMGC/internal/vapp-speed-set")) {
vapp = getprop("/FMGC/internal/computed-speeds/vapp_appr");
vapp = fmgc.FMGCInternal.vapp_appr;
} else {
vapp = getprop("/FMGC/internal/computed-speeds/vapp");
vapp = fmgc.FMGCInternal.vapp;
}
tgt_ias = vapp;
tgt_kts = vapp;
} else if (fmgc.FMGCInternal.phase == 6) {
clean = getprop("/FMGC/internal/computed-speeds/clean");
clean = fmgc.FMGCInternal.clean;
tgt_ias = clean;
tgt_kts = clean;
}
@ -2148,7 +2148,7 @@ var canvas_PFD_2 = {
me["F_target"].hide();
me["clean_speed"].hide();
tgt_S = tgt_S = getprop("/FMGC/internal/computed-speeds/slat");
tgt_S = tgt_S = fmgc.FMGCInternal.slat;
if (tgt_S <= 30) {
me.Strgt = 0 - me.ASI;
@ -2182,7 +2182,7 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["clean_speed"].hide();
tgt_F = tgt_S = getprop("/FMGC/internal/computed-speeds/flap2");
tgt_F = tgt_S = fmgc.FMGCInternal.flap2;
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -2216,7 +2216,7 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["clean_speed"].hide();
tgt_F = tgt_S = getprop("/FMGC/internal/computed-speeds/flap3");
tgt_F = tgt_S = fmgc.FMGCInternal.flap3;
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -2255,7 +2255,7 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["F_target"].hide();
tgt_clean = tgt_S = getprop("/FMGC/internal/computed-speeds/clean");
tgt_clean = tgt_S = fmgc.FMGCInternal.clean;
me.cleantrgt = tgt_clean - 30 - me.ASI;
me.SPDcleantrgtdiff = tgt_clean - ind_spd;

View file

@ -109,10 +109,10 @@ setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX");
var FMGCinit = func {
fmgc.FMGCInternal.takeoffState = 0;
fmgc.FMGCInternal.minspeed = 0;
fmgc.FMGCInternal.maxspeed = 338;
fmgc.FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
FMGCInternal.takeoffState = 0;
FMGCInternal.minspeed = 0;
FMGCInternal.maxspeed = 338;
FMGCInternal.phase = 0; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
setprop("/FMGC/internal/mng-spd", 157);
setprop("/FMGC/internal/mng-spd-cmd", 157);
setprop("/FMGC/internal/mng-kts-mach", 0);
@ -140,6 +140,36 @@ var FMGCInternal = {
alpha_prot: 0,
alpha_max: 0,
vmo_mmo: 0,
vsw: 0,
vls_min: 0,
clean: 0,
vs1g_clean: 0,
vs1g_conf_1: 0,
vs1g_conf_1f: 0,
vs1g_conf_2: 0,
vs1g_conf_3: 0,
vs1g_conf_full: 0,
slat: 0,
flap2: 0,
flap3: 0,
vls: 0,
vapp: 0,
clean_to: 0,
vs1g_clean_to: 0,
vs1g_conf_2_to: 0,
vs1g_conf_3_to: 0,
vs1g_conf_full_to: 0,
slat_to: 0,
flap2_to: 0,
clean_appr: 0,
vs1g_clean_appr: 0,
vs1g_conf_2_appr: 0,
vs1g_conf_3_appr: 0,
vs1g_conf_full_appr: 0,
slat_appr: 0,
flap2_appr: 0,
vls_appr: 0,
vapp_appr: 0,
# PERF
transAlt: 18000,
@ -247,7 +277,7 @@ setlistener("/gear/gear[0]/wow", func {
var trimReset = func {
flaps = getprop("/controls/flight/flaps-pos");
if (pts.Gear.wow[0].getBoolValue() and !fmgc.FMGCInternal.takeoffState and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
if (pts.Gear.wow[0].getBoolValue() and !FMGCInternal.takeoffState and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
interpolate("/controls/flight/elevator-trim", 0.0, 1.5);
}
}
@ -257,9 +287,9 @@ var trimReset = func {
###############
var updateARPT = func {
setprop("autopilot/route-manager/departure/airport", fmgc.FMGCInternal.depApt);
setprop("autopilot/route-manager/destination/airport", fmgc.FMGCInternal.arrApt);
setprop("autopilot/route-manager/alternate/airport", fmgc.FMGCInternal.altAirport);
setprop("autopilot/route-manager/departure/airport", FMGCInternal.depApt);
setprop("autopilot/route-manager/destination/airport", FMGCInternal.arrApt);
setprop("autopilot/route-manager/alternate/airport", FMGCInternal.altAirport);
if (getprop("/autopilot/route-manager/active") != 1) {
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
}
@ -566,7 +596,7 @@ var masterFMGC = maketimer(0.2, func {
# cruiseft = FMGCInternal.crzFt;
# cruiseft_b = FMGCInternal.crzFt - 200;
newcruise = getprop("/it-autoflight/internal/alt");
phase = fmgc.FMGCInternal.phase;
phase = FMGCInternal.phase;
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
wowl = getprop("/gear/gear[1]/wow");
@ -643,11 +673,11 @@ var masterFMGC = maketimer(0.2, func {
}
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
fmgc.FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4;
FMGCInternal.maxspeed = getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4;
} elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) {
fmgc.FMGCInternal.maxspeed = 284;
FMGCInternal.maxspeed = 284;
} else {
fmgc.FMGCInternal.maxspeed = getprop("/it-fbw/speeds/vmo-mmo");
FMGCInternal.maxspeed = getprop("/it-fbw/speeds/vmo-mmo");
}
############################
@ -655,111 +685,102 @@ var masterFMGC = maketimer(0.2, func {
############################
flap = getprop("/controls/flight/flaps-pos");
weight_lbs = getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000;
tow = getprop("/FMGC/internal/tow") or 0;
lw = getprop("/FMGC/internal/lw") or 0;
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
# current speeds
clean = 2 * weight_lbs * 0.45359237 + 85;
FMGCInternal.clean = 2 * weight_lbs * 0.45359237 + 85;
if (altitude > 20000) {
clean += (altitude - 20000) / 1000;
FMGCInternal.clean += (altitude - 20000) / 1000;
}
setprop("/FMGC/internal/computed-speeds/clean", clean);
setprop("/FMGC/internal/computed-speeds/vs1g_clean", 0.0024 * weight_lbs * weight_lbs + 0.124 * weight_lbs + 88.942);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_1", -0.0007 * weight_lbs * weight_lbs + 0.6795 * weight_lbs + 44.673);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_1f", -0.0001 * weight_lbs * weight_lbs + 0.5211 * weight_lbs + 49.027);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2", -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 44.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3", -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 43.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full", -0.0007 * weight_lbs * weight_lbs + 0.6002 * weight_lbs + 38.479);
setprop("/FMGC/internal/computed-speeds/slat", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.23);
setprop("/FMGC/internal/computed-speeds/flap2", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_2")) * 1.47);
setprop("/FMGC/internal/computed-speeds/flap3", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_3")) * 1.36);
FMGCInternal.vs1g_clean = 0.0024 * weight_lbs * weight_lbs + 0.124 * weight_lbs + 88.942;
FMGCInternal.vs1g_conf_1 = -0.0007 * weight_lbs * weight_lbs + 0.6795 * weight_lbs + 44.673;
FMGCInternal.vs1g_conf_1f = -0.0001 * weight_lbs * weight_lbs + 0.5211 * weight_lbs + 49.027;
FMGCInternal.vs1g_conf_2 = -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 44.279;
FMGCInternal.vs1g_conf_3 = -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 43.279;
FMGCInternal.vs1g_conf_full = -0.0007 * weight_lbs * weight_lbs + 0.6002 * weight_lbs + 38.479;
FMGCInternal.slat = FMGCInternal.vs1g_clean * 1.23;
FMGCInternal.flap2 = FMGCInternal.vs1g_conf_2 * 1.47;
FMGCInternal.flap3 = FMGCInternal.vs1g_conf_3 * 1.36;
if (getprop("/FMGC/internal/ldg-config-3-set")) {
vls = num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_3")) * 1.23;
FMGCInternal.vls = FMGCInternal.vs1g_conf_3 * 1.23;
} else {
vls = num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_full")) * 1.23
FMGCInternal.vls = FMGCInternal.vs1g_conf_full * 1.23
}
if (vls < 113) {
vls = 113;
if (FMGCInternal.vls < 113) {
FMGCInternal.vls = 113;
}
setprop("/FMGC/internal/computed-speeds/vls", vls);
if (!getprop("/FMGC/internal/vapp-speed-set")) {
if (fmgc.FMGCInternal.destWind < 5) {
vapp = vls + 5;
} else if (fmgc.FMGCInternal.destWind > 15) {
vapp = vls + 15;
if (FMGCInternal.destWind < 5) {
FMGCInternal.vapp = FMGCInternal.vls + 5;
} else if (FMGCInternal.destWind > 15) {
FMGCInternal.vapp = FMGCInternal.vls + 15;
} else {
vapp = vls + fmgc.FMGCInternal.destWind;
FMGCInternal.vapp = FMGCInternal.vls + FMGCInternal.destWind;
}
setprop("/FMGC/internal/computed-speeds/vapp", vapp);
}
# predicted takeoff speeds
if (FMGCInternal.phase == 1) {
setprop("/FMGC/internal/computed-speeds/clean_to", getprop("/FMGC/internal/computed-speeds/clean"));
setprop("/FMGC/internal/computed-speeds/vs1g_clean_to", getprop("/FMGC/internal/computed-speeds/vs1g_clean"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2_to", getprop("/FMGC/internal/computed-speeds/vs1g_conf_2"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3_to", getprop("/FMGC/internal/computed-speeds/vs1g_conf_3"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full_to", getprop("/FMGC/internal/computed-speeds/vs1g_conf_full"));
setprop("/FMGC/internal/computed-speeds/slat_to", getprop("/FMGC/internal/computed-speeds/slat"));
setprop("/FMGC/internal/computed-speeds/flap2_to", getprop("/FMGC/internal/computed-speeds/flap2"));
FMGCInternal.clean_to = FMGCInternal.clean;
FMGCInternal.vs1g_clean_to = FMGCInternal.vs1g_clean;
FMGCInternal.vs1g_conf_2_to = FMGCInternal.vs1g_conf_2;
FMGCInternal.vs1g_conf_3_to = FMGCInternal.vs1g_conf_3;
FMGCInternal.vs1g_conf_full_to = FMGCInternal.vs1g_conf_full;
FMGCInternal.slat_to = FMGCInternal.slat;
FMGCInternal.flap2_to = FMGCInternal.flap2;
} else {
clean_to = 2 * tow * 0.45359237 + 85;
FMGCInternal.clean_to = 2 * FMGCInternal.tow * 0.45359237 + 85;
if (altitude > 20000) {
clean_to += (altitude - 20000) / 1000;
FMGCInternal.clean_to += (altitude - 20000) / 1000;
}
setprop("/FMGC/internal/computed-speeds/clean_to", clean_to);
setprop("/FMGC/internal/computed-speeds/vs1g_clean_to", 0.0024 * tow * tow + 0.124 * tow + 88.942);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2_to", -0.0005 * tow * tow + 0.5488 * tow + 44.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3_to", -0.0005 * tow * tow + 0.5488 * tow + 43.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full_to", -0.0007 * tow * tow + 0.6002 * tow + 38.479);
setprop("/FMGC/internal/computed-speeds/slat_to", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean_to")) * 1.23);
setprop("/FMGC/internal/computed-speeds/flap2_to", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_2_to")) * 1.47);
FMGCInternal.vs1g_clean_to = 0.0024 * FMGCInternal.tow * FMGCInternal.tow + 0.124 * FMGCInternal.tow + 88.942;
FMGCInternal.vs1g_conf_2_to = -0.0005 * FMGCInternal.tow * FMGCInternal.tow + 0.5488 * FMGCInternal.tow + 44.279;
FMGCInternal.vs1g_conf_3_to = -0.0005 * FMGCInternal.tow * FMGCInternal.tow + 0.5488 * FMGCInternal.tow + 43.279;
FMGCInternal.vs1g_conf_full_to = -0.0007 * FMGCInternal.tow * FMGCInternal.tow + 0.6002 * FMGCInternal.tow + 38.479;
FMGCInternal.slat_to = FMGCInternal.vs1g_clean_to * 1.23;
FMGCInternal.flap2_to = FMGCInternal.vs1g_conf_2_to * 1.47;
}
# predicted approach (temp go-around) speeds
if (FMGCInternal.phase == 5 or FMGCInternal.phase == 6) {
setprop("/FMGC/internal/computed-speeds/clean_appr", getprop("/FMGC/internal/computed-speeds/clean"));
setprop("/FMGC/internal/computed-speeds/vs1g_clean_appr", getprop("/FMGC/internal/computed-speeds/vs1g_clean"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_2"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_3"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_full"));
setprop("/FMGC/internal/computed-speeds/slat_appr", getprop("/FMGC/internal/computed-speeds/slat"));
setprop("/FMGC/internal/computed-speeds/flap2_appr", getprop("/FMGC/internal/computed-speeds/flap2"));
setprop("/FMGC/internal/computed-speeds/vls_appr", getprop("/FMGC/internal/computed-speeds/vls"));
FMGCInternal.clean_appr = FMGCInternal.clean;
FMGCInternal.vs1g_clean_appr = FMGCInternal.vs1g_clean;
FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2;
FMGCInternal.vs1g_conf_3_appr = FMGCInternal.vs1g_conf_3;
FMGCInternal.vs1g_conf_full_appr = FMGCInternal.vs1g_conf_full;
FMGCInternal.slat_appr = FMGCInternal.slat;
FMGCInternal.flap2_appr = FMGCInternal.flap2;
FMGCInternal.vls_appr = FMGCInternal.vls;
if (!getprop("/FMGC/internal/vapp-speed-set")) {
setprop("/FMGC/internal/computed-speeds/vapp_appr", getprop("/FMGC/internal/computed-speeds/vapp"));
FMGCInternal.vapp_appr = FMGCInternal.vapp;
}
} else {
clean_appr = 2 * lw * 0.45359237 + 85;
FMGCInternal.clean_appr = 2 * FMGCInternal.lw * 0.45359237 + 85;
if (altitude > 20000) {
clean_appr += (altitude - 20000) / 1000;
FMGCInternal.clean_appr += (altitude - 20000) / 1000;
}
setprop("/FMGC/internal/computed-speeds/clean_appr", clean_appr);
setprop("/FMGC/internal/computed-speeds/vs1g_clean_appr", 0.0024 * lw * lw + 0.124 * lw + 88.942);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2_appr", -0.0005 * lw * lw + 0.5488 * lw + 44.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3_appr", -0.0005 * lw * lw + 0.5488 * lw + 43.279);
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full_appr", -0.0007 * lw * lw + 0.6002 * lw + 38.479);
setprop("/FMGC/internal/computed-speeds/slat_appr", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean_appr")) * 1.23);
setprop("/FMGC/internal/computed-speeds/flap2_appr", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_2_appr")) * 1.47);
FMGCInternal.vs1g_clean_appr = 0.0024 * FMGCInternal.lw * FMGCInternal.lw + 0.124 * FMGCInternal.lw + 88.942;
FMGCInternal.vs1g_conf_2_appr = -0.0005 * FMGCInternal.lw * FMGCInternal.lw + 0.5488 * FMGCInternal.lw + 44.279;
FMGCInternal.vs1g_conf_3_appr = -0.0005 * FMGCInternal.lw * FMGCInternal.lw + 0.5488 * FMGCInternal.lw + 43.279;
FMGCInternal.vs1g_conf_full_appr = -0.0007 * FMGCInternal.lw * FMGCInternal.lw + 0.6002 * FMGCInternal.lw + 38.479;
FMGCInternal.slat_appr = FMGCInternal.vs1g_clean_appr * 1.23;
FMGCInternal.flap2_appr = FMGCInternal.vs1g_conf_2_appr * 1.47;
if (getprop("/FMGC/internal/ldg-config-3-set")) {
vls_appr = num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_3_appr")) * 1.23;
FMGCInternal.vls_appr = FMGCInternal.vs1g_conf_3_appr * 1.23;
} else {
vls_appr = num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_full_appr")) * 1.23
FMGCInternal.vls_appr = FMGCInternal.vs1g_conf_full_appr * 1.23
}
if (vls_appr < 113) {
vls_appr = 113;
if (FMGCInternal.vls_appr < 113) {
FMGCInternal.vls_appr = 113;
}
setprop("/FMGC/internal/computed-speeds/vls_appr", vls_appr);
if (!getprop("/FMGC/internal/vapp-speed-set")) {
if (fmgc.FMGCInternal.destWind < 5) {
vapp_appr = vls_appr + 5;
} else if (fmgc.FMGCInternal.destWind > 15) {
vapp_appr = vls_appr + 15;
if (FMGCInternal.destWind < 5) {
FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 5;
} else if (FMGCInternal.destWind > 15) {
FMGCInternal.vapp_appr = FMGCInternal.vls_appr + 15;
} else {
vapp_appr = vls_appr + fmgc.FMGCInternal.destWind;
FMGCInternal.vapp_appr = FMGCInternal.vls_appr + FMGCInternal.destWind;
}
setprop("/FMGC/internal/computed-speeds/vapp_appr", vapp_appr);
}
}
@ -771,83 +792,83 @@ var masterFMGC = maketimer(0.2, func {
aoa = getprop("/systems/navigation/adr/output/aoa-1");
cas = getprop("/systems/navigation/adr/output/cas-1");
if (aoa > -5) {
fmgc.FMGCInternal.alpha_prot = cas * math.sqrt((aoa - aoa_0)/(aoa_prot - aoa_0));
fmgc.FMGCInternal.alpha_max = cas * math.sqrt((aoa - aoa_0)/(aoa_max - aoa_0));
FMGCInternal.alpha_prot = cas * math.sqrt((aoa - aoa_0)/(aoa_prot - aoa_0));
FMGCInternal.alpha_max = cas * math.sqrt((aoa - aoa_0)/(aoa_max - aoa_0));
} else {
fmgc.FMGCInternal.alpha_prot = 0;
fmgc.FMGCInternal.alpha_max = 0;
FMGCInternal.alpha_prot = 0;
FMGCInternal.alpha_max = 0;
}
setprop("/FMGC/internal/computed-speeds/vs1g_conf_2_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_2"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_3_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_3"));
setprop("/FMGC/internal/computed-speeds/vs1g_conf_full_appr", getprop("/FMGC/internal/computed-speeds/vs1g_conf_full"));
#FMGCInternal.vs1g_conf_2_appr = FMGCInternal.vs1g_conf_2;
#FMGCInternal.vs1g_conf_3_appr = FMGCInternal.vs1g_conf_3;
#FMGCInternal.vs1g_conf_full_appr = FMGCInternal.vs1g_conf_full;
if (flap == 0) { # 0
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_clean"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/clean");
FMGCInternal.vsw = FMGCInternal.vs1g_clean;
FMGCInternal.minspeed = FMGCInternal.clean;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.28);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.28;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.23;
}
} else if (flap == 1) { # 1
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_conf_2"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/slat");
FMGCInternal.vsw = FMGCInternal.vs1g_conf_2;
FMGCInternal.minspeed = FMGCInternal.slat;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_1")) * 1.28);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1 * 1.28;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_1")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1 * 1.23;
}
} else if (flap == 2) { # 1+F
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_conf_1f"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/slat");
FMGCInternal.vsw = FMGCInternal.vs1g_conf_1f;
FMGCInternal.minspeed = FMGCInternal.slat;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.13);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.13;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_1f")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_1f * 1.23;
}
} else if (flap == 3) { # 2
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_conf_2"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/flap2");
FMGCInternal.vsw = FMGCInternal.vs1g_conf_2;
FMGCInternal.minspeed = FMGCInternal.flap2;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.13);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.13;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_2")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_2 * 1.23;
}
} else if (flap == 4) { # 3
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_conf_3"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/flap3");
FMGCInternal.vsw = FMGCInternal.vs1g_conf_3;
FMGCInternal.minspeed = FMGCInternal.flap3;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.13);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.13;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_3")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_3 * 1.23;
}
} else if (flap == 5) { # FULL
setprop("/FMGC/internal/computed-speeds/vsw", getprop("/FMGC/internal/computed-speeds/vs1g_conf_full"));
fmgc.FMGCInternal.minspeed = getprop("/FMGC/internal/computed-speeds/vapp");
FMGCInternal.vsw = FMGCInternal.vs1g_conf_full;
FMGCInternal.minspeed = FMGCInternal.vapp;
if (fmgc.FMGCInternal.takeoffState) {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_clean")) * 1.13);
if (FMGCInternal.takeoffState) {
FMGCInternal.vls_min = FMGCInternal.vs1g_clean * 1.13;
} else {
setprop("/FMGC/internal/computed-speeds/vls_min", num(getprop("/FMGC/internal/computed-speeds/vs1g_conf_full")) * 1.23);
FMGCInternal.vls_min = FMGCInternal.vs1g_conf_full * 1.23;
}
}
if (gear0 and flaps < 5 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA")) {
if (!fmgc.FMGCInternal.takeoffState) {
if (!FMGCInternal.takeoffState) {
fmgc.FMGCNodes.toState.setValue(1);
}
fmgc.FMGCInternal.takeoffState = 1;
FMGCInternal.takeoffState = 1;
} elsif (pts.Position.gearAglFt.getValue() >= 55) {
if (fmgc.FMGCInternal.takeoffState) {
if (FMGCInternal.takeoffState) {
fmgc.FMGCNodes.toState.setValue(0);
}
fmgc.FMGCInternal.takeoffState = 0;
FMGCInternal.takeoffState = 0;
}
############################
@ -857,7 +878,7 @@ var masterFMGC = maketimer(0.2, func {
departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway;
destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway;
if (destination_rwy != nil and phase >= 2) {
var airport = airportinfo(fmgc.FMGCInternal.arrApt);
var airport = airportinfo(FMGCInternal.arrApt);
setprop("/FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg"));
runway_ils = destination_rwy.ils_frequency_mhz;
@ -888,7 +909,7 @@ var masterFMGC = maketimer(0.2, func {
});
var reset_FMGC = func {
fmgc.FMGCInternal.phase = 0;
FMGCInternal.phase = 0;
fd1 = getprop("/it-autoflight/input/fd1");
fd2 = getprop("/it-autoflight/input/fd2");
spd = getprop("/it-autoflight/input/kts");
@ -952,7 +973,7 @@ var ManagedSPD = maketimer(0.25, func {
kts_sel = getprop("/it-autoflight/input/kts");
mach_sel = getprop("/it-autoflight/input/mach");
srsSPD = getprop("/it-autoflight/settings/togaspd");
phase = fmgc.FMGCInternal.phase; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
phase = FMGCInternal.phase; # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
flap = getprop("/controls/flight/flaps-pos");
mach_switchover = getprop("/FMGC/internal/mach-switchover");
decel = getprop("/FMGC/internal/decel");
@ -984,8 +1005,8 @@ var ManagedSPD = maketimer(0.25, func {
}
if (mng_spd_cmd != 250 and !decel) {
setprop("/FMGC/internal/mng-spd-cmd", 250);
} else if (mng_spd_cmd != fmgc.FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", fmgc.FMGCInternal.minspeed);
} else if (mng_spd_cmd != FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", FMGCInternal.minspeed);
}
} else if ((FMGCInternal.phase == 2 or FMGCInternal.phase == 3) and altitude > 10070 and !mach_switchover) {
if (mngktsmach) {
@ -1021,8 +1042,8 @@ var ManagedSPD = maketimer(0.25, func {
}
if (mng_spd_cmd != mng_alt_spd and !decel) {
setprop("/FMGC/internal/mng-spd-cmd", mng_alt_spd);
} else if (mng_spd_cmd != fmgc.FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", fmgc.FMGCInternal.minspeed);
} else if (mng_spd_cmd != FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", FMGCInternal.minspeed);
}
} else if ((FMGCInternal.phase == 4 or FMGCInternal.phase == 5 or FMGCInternal.phase == 6) and altitude <= 10980) {
if (mngktsmach) {
@ -1030,15 +1051,15 @@ var ManagedSPD = maketimer(0.25, func {
}
if (mng_spd_cmd != 250 and !decel) {
setprop("/FMGC/internal/mng-spd-cmd", 250);
} else if (mng_spd_cmd != fmgc.FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", fmgc.FMGCInternal.minspeed);
} else if (mng_spd_cmd != FMGCInternal.minspeed and decel) {
setprop("/FMGC/internal/mng-spd-cmd", FMGCInternal.minspeed);
}
}
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
if (mng_spd_cmd > fmgc.FMGCInternal.maxspeed - 5) {
setprop("/FMGC/internal/mng-spd", fmgc.FMGCInternal.maxspeed - 5);
if (mng_spd_cmd > FMGCInternal.maxspeed - 5) {
setprop("/FMGC/internal/mng-spd", FMGCInternal.maxspeed - 5);
} else {
setprop("/FMGC/internal/mng-spd", mng_spd_cmd);
}
@ -1156,7 +1177,7 @@ setlistener("/FMGC/internal/fuel-calculating", func() {
# Maketimers
var timer30secLanding = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
fmgc.FMGCInternal.phase = 7;
FMGCInternal.phase = 7;
if (FMGCInternal.costIndexSet) {
setprop("/FMGC/internal/last-cost-index", FMGCInternal.costIndex);
} else {

View file

@ -7,7 +7,7 @@ var fuelPredInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.rteRsv = 0.05 * num(fmgc.FMGCInternal.tripFuel);
fmgc.FMGCInternal.rteRsv = 0.05 * fmgc.FMGCInternal.tripFuel;
fmgc.FMGCInternal.rteRsvSet = 0;
fmgc.FMGCInternal.rtePercent = 5.0;
fmgc.FMGCInternal.rtePercentSet = 0;
@ -19,7 +19,7 @@ var fuelPredInput = func(key, i) {
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
var perc = num(split("/", scratchpad)[1]);
if (perc != nil and perc >= 0.0 and perc <= 15.0) {
fmgc.FMGCInternal.rteRsv = num(perc) / 100 * num(fmgc.FMGCInternal.tripFuel);
fmgc.FMGCInternal.rteRsv = perc / 100 * fmgc.FMGCInternal.tripFuel;
fmgc.FMGCInternal.rteRsvSet = 0;
fmgc.FMGCInternal.rtePercent = perc;
fmgc.FMGCInternal.rtePercentSet = 1;
@ -29,8 +29,8 @@ var fuelPredInput = func(key, i) {
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
fmgc.FMGCInternal.rteRsv = scratchpad;
fmgc.FMGCInternal.rteRsvSet = 1;
if (scratchpad / num(fmgc.FMGCInternal.tripFuel) * 100 <= 15.0) {
fmgc.FMGCInternal.rtePercent = scratchpad / num(fmgc.FMGCInternal.tripFuel) * 100;
if (scratchpad / fmgc.FMGCInternal.tripFuel * 100 <= 15.0) {
fmgc.FMGCInternal.rtePercent = scratchpad / fmgc.FMGCInternal.tripFuel * 100;
} else {
fmgc.FMGCInternal.rtePercent = 15.0; # need reasearch on this value
}
@ -110,7 +110,7 @@ var fuelPredInput = func(key, i) {
fmgc.FMGCInternal.minDestFobSet = 1;
setprop("/FMGC/internal/fuel-calculating", 1);
mcdu_scratchpad.scratchpads[i].empty();
if (num(fmgc.FMGCInternal.minDestFob) < num(fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel)) {
if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) {
mcdu_message(i, "CHECK MIN DEST FOB");
}
} else {
@ -130,7 +130,7 @@ var fuelPredInput = func(key, i) {
fmgc.FMGCInternal.zfw = sprintf("%3.1f", math.round(zfw / 1000, 0.1));
fmgc.FMGCInternal.zfwSet = 1;
if (fmgc.FMGCInternal.blockSet != 1) {
fmgc.FMGCInternal.block = num(getprop("consumables/fuel/total-fuel-lbs") / 1000);
fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000;
fmgc.FMGCInternal.blockSet = 1;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
@ -151,7 +151,7 @@ var fuelPredInput = func(key, i) {
fmgc.FMGCInternal.zfwcg = zfwcg;
fmgc.FMGCInternal.zfwcgSet = 1;
if (fmgc.FMGCInternal.blockSet != 1) {
fmgc.FMGCInternal.block = num(getprop("consumables/fuel/total-fuel-lbs") / 1000);
fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000;
fmgc.FMGCInternal.blockSet = 1;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
@ -178,7 +178,7 @@ var fuelPredInput = func(key, i) {
fmgc.FMGCInternal.zfw = scratchpad;
fmgc.FMGCInternal.zfwSet = 1;
if (fmgc.FMGCInternal.blockSet != 1) {
fmgc.FMGCInternal.block = num(getprop("consumables/fuel/total-fuel-lbs") / 1000);
fmgc.FMGCInternal.block = getprop("consumables/fuel/total-fuel-lbs") / 1000;
fmgc.FMGCInternal.blockSet = 1;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);

View file

@ -35,7 +35,7 @@ var initInputB = func(key, i) {
}
} else if (key == "L3" and getprop("/FMGC/internal/block-confirmed") and !getprop("/FMGC/internal/fuel-calculating")) {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.rteRsv = 0.05 * num(fmgc.FMGCInternal.tripFuel);
fmgc.FMGCInternal.rteRsv = 0.05 * fmgc.FMGCInternal.tripFuel;
fmgc.FMGCInternal.rteRsvSet = 0;
fmgc.FMGCInternal.rtePercent = 5.0;
fmgc.FMGCInternal.rtePercentSet = 0;
@ -47,7 +47,7 @@ var initInputB = func(key, i) {
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
var perc = num(split("/", scratchpad)[1]);
if (perc != nil and perc >= 0.0 and perc <= 15.0) {
fmgc.FMGCInternal.rteRsv = num(perc) / 100 * num(fmgc.FMGCInternal.tripFuel);
fmgc.FMGCInternal.rteRsv = perc / 100 * fmgc.FMGCInternal.tripFuel;
fmgc.FMGCInternal.rteRsvSet = 0;
fmgc.FMGCInternal.rtePercent = perc;
fmgc.FMGCInternal.rtePercentSet = 1;
@ -57,8 +57,8 @@ var initInputB = func(key, i) {
} else if (tfs >= 1 and tfs <= 4 and tf != nil and tf >= 0 and tf <= 21.7) {
fmgc.FMGCInternal.rteRsv = scratchpad;
fmgc.FMGCInternal.rteRsvSet = 1;
if (scratchpad / num(fmgc.FMGCInternal.tripFuel) * 100 <= 15.0) {
fmgc.FMGCInternal.rtePercent = scratchpad / num(fmgc.FMGCInternal.tripFuel) * 100;
if (scratchpad / fmgc.FMGCInternal.tripFuel * 100 <= 15.0) {
fmgc.FMGCInternal.rtePercent = scratchpad / fmgc.FMGCInternal.tripFuel * 100;
} else {
fmgc.FMGCInternal.rtePercent = 15.0; # need reasearch on this value
}
@ -138,7 +138,7 @@ var initInputB = func(key, i) {
fmgc.FMGCInternal.minDestFobSet = 1;
setprop("/FMGC/internal/fuel-calculating", 1);
mcdu_scratchpad.scratchpads[i].empty();
if (num(fmgc.FMGCInternal.minDestFob) < num(fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel)) {
if (fmgc.FMGCInternal.minDestFob < fmgc.FMGCInternal.finalFuel + fmgc.FMGCInternal.altFuel) {
mcdu_message(i, "CHECK MIN DEST FOB");
}
} else {
@ -158,7 +158,7 @@ var initInputB = func(key, i) {
fmgc.FMGCInternal.zfw = sprintf("%3.1f", math.round(zfw / 1000, 0.1));
fmgc.FMGCInternal.zfwSet = 1;
if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) {
fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel);
fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);
@ -182,7 +182,7 @@ var initInputB = func(key, i) {
fmgc.FMGCInternal.zfwcg = zfwcg;
fmgc.FMGCInternal.zfwcgSet = 1;
if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) {
fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel);
fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);
@ -212,7 +212,7 @@ var initInputB = func(key, i) {
fmgc.FMGCInternal.zfw = scratchpad;
fmgc.FMGCInternal.zfwSet = 1;
if (!getprop("/FMGC/internal/block-confirmed") and fmgc.FMGCInternal.blockSet) {
fmgc.FMGCInternal.tow = num(fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel);
fmgc.FMGCInternal.tow = fmgc.FMGCInternal.zfw + fmgc.FMGCInternal.block - fmgc.FMGCInternal.taxiFuel;
setprop("/FMGC/internal/fuel-request-set", 1);
setprop("/FMGC/internal/fuel-calculating", 1);
setprop("/FMGC/internal/block-calculating", 0);