1
0
Fork 0

Implement new speed logic, managed speed at correct values (note, pointer still incorrect on approach)

This commit is contained in:
Matthew Maring 2020-04-11 06:46:17 -04:00
parent f71f1c2bb1
commit 8e6cebb080
6 changed files with 164 additions and 145 deletions

View file

@ -126,7 +126,6 @@ var cruiseFL_prog = props.globals.getNode("FMGC/internal/cruise-fl-prog", 1);
# PERF
var altitude = props.globals.getNode("instrumentation/altimeter/indicated-altitude-ft", 1);
var vs1g = props.globals.getNode("FMGC/internal/vs1g", 1);
# TO PERF
var v1 = props.globals.getNode("FMGC/internal/v1", 1);
@ -136,10 +135,6 @@ var vrSet = props.globals.getNode("FMGC/internal/vr-set", 1);
var v2 = props.globals.getNode("FMGC/internal/v2", 1);
var v2Set = props.globals.getNode("FMGC/internal/v2-set", 1);
var f_speed_to = props.globals.getNode("FMGC/internal/f-speed-to", 1);
var s_speed_to = props.globals.getNode("FMGC/internal/s-speed-to", 1);
var o_speed_to = props.globals.getNode("FMGC/internal/o-speed-to", 1);
var clbReducFt = props.globals.getNode("systems/thrust/clbreduc-ft", 1);
var reducFt = props.globals.getNode("FMGC/internal/reduc-agl-ft", 1); # It's not AGL anymore
var thrAccSet = props.globals.getNode("MCDUC/thracc-set", 1);
@ -166,12 +161,7 @@ var dest_qnh = props.globals.getNode("FMGC/internal/dest-qnh", 1);
var dest_temp = props.globals.getNode("FMGC/internal/dest-temp", 1);
var dest_mag = props.globals.getNode("FMGC/internal/dest-mag", 1);
var dest_wind = props.globals.getNode("FMGC/internal/dest-wind", 1);
var vapp_speed = props.globals.getNode("FMGC/internal/vapp-speed", 1);
var vapp_speed_set = props.globals.getNode("FMGC/internal/vapp-speed-set", 1);
var f_speed_appr = props.globals.getNode("FMGC/internal/f-speed-appr", 1);
var s_speed_appr = props.globals.getNode("FMGC/internal/s-speed-appr", 1);
var o_speed_appr = props.globals.getNode("FMGC/internal/o-speed-appr", 1);
var vls_speed_appr = props.globals.getNode("FMGC/internal/vls-speed-appr", 1);
var final = props.globals.getNode("FMGC/internal/final", 1);
var mda = props.globals.getNode("FMGC/internal/mda", 1);
var dh = props.globals.getNode("FMGC/internal/dh", 1);
@ -1223,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((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/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/lw", num(tow.getValue() - trip_fuel.getValue()));
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
@ -1567,17 +1557,9 @@ var canvas_MCDU_base = {
me["Simple_R6S"].setText("NEXT ");
if (zfwSet.getValue() == 1 and blockSet.getValue() == 1) {
setprop("FMGC/internal/f-speed-to", ((-0.0005 * tow.getValue() * tow.getValue()) + (0.5488 * tow.getValue()) + 44.279) * 1.47);
setprop("FMGC/internal/s-speed-to", ((0.0024 * tow.getValue() * tow.getValue()) + (0.124 * tow.getValue()) + 88.942) * 1.23);
tgt_clean = 2 * tow.getValue() * 0.45359237 + 85;
if (altitude.getValue() > 20000) {
tgt_clean += (altitude.getValue() - 20000) / 1000;
}
setprop("FMGC/internal/o-speed-to", tgt_clean);
me["Simple_C1"].setText(sprintf("%3.0f", f_speed_to.getValue()));
me["Simple_C2"].setText(sprintf("%3.0f", s_speed_to.getValue()));
me["Simple_C3"].setText(sprintf("%3.0f", o_speed_to.getValue()));
me["Simple_C1"].setText(sprintf("%3.0f", getprop("FMGC/internal/computed-speeds/flap2_to")));
me["Simple_C2"].setText(sprintf("%3.0f", getprop("FMGC/internal/computed-speeds/slat_to")));
me["Simple_C3"].setText(sprintf("%3.0f", getprop("FMGC/internal/computed-speeds/clean_to")));
} else {
me["Simple_C1"].setText(" ---");
me["Simple_C2"].setText(" ---");
@ -1778,14 +1760,16 @@ var canvas_MCDU_base = {
me.fontSizeLeft(normal, normal, small, small, normal, normal);
me.fontSizeRight(normal, normal, normal, normal, small, normal);
me.fontSizeCenterS(small, small, small, small, small, small);
me.fontSizeCenter(normal, small, normal, normal, small, normal);
me.colorLeft("grn", "blu", "grn", "blu", "wht", "blu");
me.colorLeftS("wht", "wht", "wht", "wht", "grn", "blu");
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRight("wht", "blu", "grn", "grn", "wht", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "grn", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("wht", "wht", "grn", "grn", "wht", "wht");
me.colorCenter("wht", "wht", "grn", "grn", "blu", "wht");
me.colorCenterS("wht", "wht", "wht", "wht", "grn", "wht");
pageSwitch[i].setBoolValue(1);
@ -1867,10 +1851,10 @@ var canvas_MCDU_base = {
me["Simple_L3S"].setText(" MANAGED");
me["Simple_L3"].setText(sprintf(" %s", getprop("FMGC/internal/mng-spd")));
me["Simple_R1S"].setText("DES EFOB");
me["Simple_R1S"].setText("DEST EFOB");
me["Simple_R1"].setText("---");
me["Simple_R5S"].setText("DEST CABIN RATE");
me["Simple_R5S"].setText("DES CABIN RATE");
me["Simple_C5"].setText(" -350");
me["Simple_R5"].setText("FT/MIN");
@ -2019,7 +2003,7 @@ var canvas_MCDU_base = {
me["Simple_L5"].setText(" EXPEDITE");
me["Simple_R1S"].setText("DES EFOB");
me["Simple_R1S"].setText("DEST EFOB");
me["Simple_R1"].setText("---");
me["Simple_C2"].setText(" PRED TO");
@ -2126,20 +2110,6 @@ var canvas_MCDU_base = {
me["Simple_L4S"].setText("TRANS ALT");
me["Simple_L4"].setText(sprintf("%3.0f", transAlt.getValue()));
me["Simple_L5S"].setText(" VAPP");
if (vapp_speed.getValue() != -1) {
me["Simple_L5"].setText(sprintf("%3.0f", vapp_speed.getValue()));
me.fontLeft(0, 0, 0, 0, default, 0);
if (vapp_speed_set.getValue() == 1) {
me.fontSizeLeft(0, 0, 0, 0, normal, 0);
} else {
me.fontSizeLeft(0, 0, 0, 0, small, 0);
}
} else {
me["Simple_L5"].setText("[ ] ");
me.fontLeft(0, 0, 0, 0, symbol, 0);
}
me["Simple_R1S"].setText("FINAL");
me["Simple_R1"].setText("-----");
@ -2168,41 +2138,26 @@ var canvas_MCDU_base = {
me["Simple_R6S"].setText("NEXT ");
me["Simple_R6"].setText("PHASE ");
me["Simple_L5S"].setText(" VAPP");
if (zfwSet.getValue() == 1 and blockSet.getValue() == 1) {
setprop("FMGC/internal/f-speed-appr", ((-0.0005 * lw.getValue() * lw.getValue()) + (0.5488 * lw.getValue()) + 44.279) * 1.47);
setprop("FMGC/internal/s-speed-appr", ((0.0024 * lw.getValue() * lw.getValue()) + (0.124 * lw.getValue()) + 88.942) * 1.23);
tgt_clean = 2 * lw.getValue() * 0.45359237 + 85;
if (altitude.getValue() > 20000) {
tgt_clean += (altitude.getValue() - 20000) / 1000;
}
setprop("FMGC/internal/o-speed-appr", tgt_clean);
if (ldg_config_3_set.getValue() == 1) {
setprop("FMGC/internal/vls-speed-appr", ((-0.0005 * lw.getValue() * lw.getValue()) + (0.5488 * lw.getValue()) + 43.279) * 1.23);
me["Simple_C1"].setText(sprintf("%3.0f", getprop("FMGC/internal/computed-speeds/flap2_appr")));
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.fontLeft(0, 0, 0, 0, default, 0);
if (vapp_speed_set.getValue() == 1) {
me.fontSizeLeft(0, 0, 0, 0, normal, 0);
} else {
setprop("FMGC/internal/vls-speed-appr", ((-0.0007 * lw.getValue() * lw.getValue()) + (0.6002 * lw.getValue()) + 38.479) * 1.23);
me.fontSizeLeft(0, 0, 0, 0, small, 0);
}
if (vapp_speed_set.getValue() == 0) {
if (dest_wind.getValue() < 5) {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + 5);
} else if (dest_wind.getValue() > 15) {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + 15);
} else {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + dest_wind.getValue());
}
}
me["Simple_C1"].setText(sprintf("%3.0f", f_speed_appr.getValue()));
me["Simple_C2"].setText(sprintf("%3.0f", s_speed_appr.getValue()));
me["Simple_C3"].setText(sprintf("%3.0f", o_speed_appr.getValue()));
me["Simple_C5"].setText(sprintf("%3.0f", vls_speed_appr.getValue()));
} else {
me["Simple_C1"].setText(" ---");
me["Simple_C2"].setText(" ---");
me["Simple_C3"].setText(" ---");
me["Simple_C5"].setText(" ---");
me["Simple_L5"].setText("[ ] ");
me.fontLeft(0, 0, 0, 0, symbol, 0);
}
me["Simple_C1S"].setText("FLP RETR");
@ -2283,17 +2238,9 @@ var canvas_MCDU_base = {
me["Simple_R5S"].setText("ENG OUT ACC");
if (zfwSet.getValue() == 1 and blockSet.getValue() == 1) {
setprop("FMGC/internal/f-speed-appr", ((-0.0005 * lw.getValue() * lw.getValue()) + (0.5488 * lw.getValue()) + 44.279) * 1.47);
setprop("FMGC/internal/s-speed-appr", ((0.0024 * lw.getValue() * lw.getValue()) + (0.124 * lw.getValue()) + 88.942) * 1.23);
tgt_clean = 2 * lw.getValue() * 0.45359237 + 85;
if (altitude.getValue() > 20000) {
tgt_clean += (altitude.getValue() - 20000) / 1000;
}
setprop("FMGC/internal/o-speed-appr", tgt_clean);
me["Simple_C1"].setText(sprintf("%3.0f", f_speed_appr.getValue()));
me["Simple_C2"].setText(sprintf("%3.0f", s_speed_appr.getValue()));
me["Simple_C3"].setText(sprintf("%3.0f", o_speed_appr.getValue()));
me["Simple_C1"].setText(sprintf("%3.0f", getprop("FMGC/internal/computed-speeds/flap2_appr")));
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")));
} else {
me["Simple_C1"].setText(" ---");
me["Simple_C2"].setText(" ---");

View file

@ -135,8 +135,6 @@ var vr_set = props.globals.getNode("FMGC/internal/vr-set", 1);
var v2 = props.globals.getNode("FMGC/internal/v2", 1);
var v2_set = props.globals.getNode("FMGC/internal/v2-set", 1);
var flap_config = props.globals.getNode("controls/flight/flap-lever", 1);
var min_speed = props.globals.getNode("FMGC/internal/minspeed", 1);
var weight_lbs = props.globals.getNode("fdm/jsbsim/inertia/weight-lbs", 1);
# Create Nodes:
var vs_needle = props.globals.initNode("/instrumentation/pfd/vs-needle", 0.0, "DOUBLE");
@ -1266,8 +1264,7 @@ var canvas_PFD_1 = {
me["F_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_S = ((0.0024 * lbs1000 * lbs1000) + (0.124 * lbs1000) + 88.942) * 1.23;
tgt_S = getprop("FMGC/internal/computed-speeds/slat");
if (tgt_S <= 30) {
me.Strgt = 0 - me.ASI;
@ -1301,8 +1298,8 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_F = ((0.4352 * lbs1000) + 51.006) * 1.47;
tgt_F = getprop("FMGC/internal/computed-speeds/flap2");
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
} else if (tgt_F >= 420) {
@ -1335,8 +1332,7 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_F = ((0.4352 * lbs1000) + 50.006) * 1.36;
tgt_F = getprop("FMGC/internal/computed-speeds/flap3");
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -1375,10 +1371,7 @@ var canvas_PFD_1 = {
me["S_target"].hide();
me["F_target"].hide();
tgt_clean = 2 * weight_lbs.getValue() * 0.00045359237 + 85;
if (altitude.getValue() > 20000) {
tgt_clean += (altitude.getValue() - 20000) / 1000;
}
tgt_clean = getprop("FMGC/internal/computed-speeds/clean");
me.cleantrgt = tgt_clean - 30 - me.ASI;
me.SPDcleantrgtdiff = tgt_clean - ind_spd;
@ -1912,8 +1905,7 @@ var canvas_PFD_2 = {
me["F_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_S = ((0.0024 * lbs1000 * lbs1000) + (0.124 * lbs1000) + 88.942) * 1.23;
tgt_S = tgt_S = getprop("FMGC/internal/computed-speeds/slat");
if (tgt_S <= 30) {
me.Strgt = 0 - me.ASI;
@ -1947,8 +1939,8 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_F = ((0.4352 * lbs1000) + 51.006) * 1.47;
tgt_F = tgt_S = getprop("FMGC/internal/computed-speeds/flap2");
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
} else if (tgt_F >= 420) {
@ -1981,8 +1973,7 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["clean_speed"].hide();
lbs1000 = weight_lbs.getValue() / 1000;
tgt_F = ((0.4352 * lbs1000) + 50.006) * 1.36;
tgt_F = tgt_S = getprop("FMGC/internal/computed-speeds/flap3");
if (tgt_F <= 30) {
me.Ftrgt = 0 - me.ASI;
@ -2021,10 +2012,7 @@ var canvas_PFD_2 = {
me["S_target"].hide();
me["F_target"].hide();
tgt_clean = 2 * weight_lbs.getValue() * 0.00045359237 + 85;
if (altitude.getValue() > 20000) {
tgt_clean += (altitude.getValue() - 20000) / 1000;
}
tgt_clean = tgt_S = getprop("FMGC/internal/computed-speeds/clean");
me.cleantrgt = tgt_clean - 30 - me.ASI;
me.SPDcleantrgtdiff = tgt_clean - ind_spd;

View file

@ -164,10 +164,6 @@ var updateARPT = func {
}
}
# var updateVSPEEDS = func {
#
# }
setlistener("/FMGC/internal/cruise-ft", func {
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("FMGC/internal/cruise-ft"));
});
@ -284,19 +280,130 @@ var masterFMGC = maketimer(0.2, func {
setprop("FMGC/internal/maxspeed", getprop("it-fbw/speeds/vmo-mmo"));
}
# calculate speeds
flap = getprop("controls/flight/flap-pos");
weight_lbs = getprop("fdm/jsbsim/inertia/weight-lbs") / 1000;
tow = getprop("FMGC/internal/tow");
lw = getprop("FMGC/internal/lw");
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
dest_wind = getprop("FMGC/internal/dest-wind");
# current appr speeds
clean = 2 * weight_lbs * 0.45359237 + 85;
if (altitude > 20000) {
clean += (altitude - 20000) / 1000;
}
vs1g_clean = 0.0024 * weight_lbs * weight_lbs + 0.124 * weight_lbs + 88.942;
vs1g_conf_1 = -0.0007 * weight_lbs * weight_lbs + 0.6795 * weight_lbs + 44.673;
vs1g_conf_1f = -0.0001 * weight_lbs * weight_lbs + 0.5211 * weight_lbs + 49.027;
vs1g_conf_2 = -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 44.279;
vs1g_conf_3 = -0.0005 * weight_lbs * weight_lbs + 0.5488 * weight_lbs + 43.279;
vs1g_conf_full = -0.0007 * weight_lbs * weight_lbs + 0.6002 * weight_lbs + 38.479;
slat = vs1g_clean * 1.23;
flap2 = vs1g_conf_2 * 1.47;
flap3 = vs1g_conf_3 * 1.36;
if (getprop("FMGC/internal/ldg-config-3-set")) {
vls = vs1g_conf_3 * 1.23;
} else {
vls = vs1g_conf_full * 1.23
}
if (!getprop("FMGC/internal/vapp-speed-set")) {
if (dest_wind < 5) {
vapp = vls + 5;
} else if (dest_wind > 15) {
vapp = vls + 15;
} else {
vapp = vls + dest_wind;
}
}
# predicted to speeds
clean_to = 2 * tow * 0.45359237 + 85;
if (altitude > 20000) {
clean_to += (altitude - 20000) / 1000;
}
vs1g_clean_to = 0.0024 * tow * tow + 0.124 * tow + 88.942;
vs1g_conf_2_to = -0.0005 * tow * tow + 0.5488 * tow + 44.279;
vs1g_conf_3_to = -0.0005 * tow * tow + 0.5488 * tow + 43.279;
vs1g_conf_full_to = -0.0007 * tow * tow + 0.6002 * tow + 38.479;
slat_to = vs1g_clean_to * 1.23;
flap2_to = vs1g_conf_2_to * 1.47;
# predicted appr speeds
clean_appr = 2 * lw * 0.45359237 + 85;
if (altitude > 20000) {
clean_appr += (altitude - 20000) / 1000;
}
vs1g_clean_appr = 0.0024 * lw * lw + 0.124 * lw + 88.942;
vs1g_conf_2_appr = -0.0005 * lw * lw + 0.5488 * lw + 44.279;
vs1g_conf_3_appr = -0.0005 * lw * lw + 0.5488 * lw + 43.279;
vs1g_conf_full_appr = -0.0007 * lw * lw + 0.6002 * lw + 38.479;
slat_appr = vs1g_clean_appr * 1.23;
flap2_appr = vs1g_conf_2_appr * 1.47;
if (getprop("FMGC/internal/ldg-config-3-set")) {
vls_appr = vs1g_conf_3_appr * 1.23;
} else {
vls_appr = vs1g_conf_full_appr * 1.23
}
if (!getprop("FMGC/internal/vapp-speed-set")) {
if (dest_wind < 5) {
vapp_appr = vls_appr + 5;
} else if (dest_wind > 15) {
vapp_appr = vls_appr + 15;
} else {
vapp_appr = vls_appr + dest_wind;
}
}
# set the values globally
setprop("FMGC/internal/computed-speeds/clean", clean);
setprop("FMGC/internal/computed-speeds/vs1g_clean", vs1g_clean);
setprop("FMGC/internal/computed-speeds/vs1g_conf_1", vs1g_conf_1);
setprop("FMGC/internal/computed-speeds/vs1g_conf_1f", vs1g_conf_1f);
setprop("FMGC/internal/computed-speeds/vs1g_conf_2", vs1g_conf_2);
setprop("FMGC/internal/computed-speeds/vs1g_conf_3", vs1g_conf_3);
setprop("FMGC/internal/computed-speeds/vs1g_conf_full", vs1g_conf_full);
setprop("FMGC/internal/computed-speeds/slat", slat);
setprop("FMGC/internal/computed-speeds/flap2", flap2);
setprop("FMGC/internal/computed-speeds/flap3", flap3);
setprop("FMGC/internal/computed-speeds/vls", vls);
setprop("FMGC/internal/computed-speeds/vapp", vapp);
setprop("FMGC/internal/computed-speeds/vs1g_clean_to", vs1g_clean_to);
setprop("FMGC/internal/computed-speeds/vs1g_conf_2_to", vs1g_conf_2_to);
setprop("FMGC/internal/computed-speeds/vs1g_conf_3_to", vs1g_conf_3_to);
setprop("FMGC/internal/computed-speeds/vs1g_conf_full_to", vs1g_conf_full_to);
setprop("FMGC/internal/computed-speeds/slat_to", slat_to);
setprop("FMGC/internal/computed-speeds/flap2_to", flap2_to);
setprop("FMGC/internal/computed-speeds/clean_to", clean_to);
setprop("FMGC/internal/computed-speeds/vs1g_clean_appr", vs1g_clean_appr);
setprop("FMGC/internal/computed-speeds/vs1g_conf_2_appr", vs1g_conf_2_appr);
setprop("FMGC/internal/computed-speeds/vs1g_conf_3_appr", vs1g_conf_3_appr);
setprop("FMGC/internal/computed-speeds/vs1g_conf_full_appr", vs1g_conf_full_appr);
setprop("FMGC/internal/computed-speeds/slat_appr", slat_appr);
setprop("FMGC/internal/computed-speeds/flap2_appr", flap2_appr);
setprop("FMGC/internal/computed-speeds/clean_appr", clean_appr);
setprop("FMGC/internal/computed-speeds/vls_appr", vls_appr);
setprop("FMGC/internal/computed-speeds/vapp_appr", vapp_appr);
if (flap == 0) { # 0
setprop("FMGC/internal/minspeed", 202);
setprop("FMGC/internal/minspeed", clean);
} else if (flap == 1) { # 1
setprop("FMGC/internal/minspeed", 184);
setprop("FMGC/internal/minspeed", slat);
} else if (flap == 2) { # 1+F
setprop("FMGC/internal/minspeed", 171);
setprop("FMGC/internal/minspeed", slat);
} else if (flap == 3) { # 2
setprop("FMGC/internal/minspeed", 156);
setprop("FMGC/internal/minspeed", flap2);
} else if (flap == 4) { # 3
setprop("FMGC/internal/minspeed", 147);
setprop("FMGC/internal/minspeed", flap3);
} else if (flap == 5) { # FULL
setprop("FMGC/internal/minspeed", 131);
setprop("FMGC/internal/minspeed", vapp);
}
if (gear0 == 1 and (state1 == "MCT" or state1 == "MAN THR" or state1 == "TOGA") and (state2 == "MCT" or state2 == "MAN THR" or state2 == "TOGA") and flaps < 5) {

View file

@ -4,7 +4,7 @@
# From INIT-B
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
var block = props.globals.getNode("FMGC/internal/block", 1);
var fob = props.globals.getNode("FMGC/internal/fob", 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((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/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/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((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/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/lw", num(tow.getValue() - trip_fuel.getValue()));
} else {
notAllowed(i);

View file

@ -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.0);
setprop("FMGC/internal/block", 0);
setprop("FMGC/internal/block-set", 0);
setprop("FMGC/internal/taxi-fuel", 0.4);
setprop("FMGC/internal/trip-fuel", 0);
@ -110,7 +110,6 @@ var MCDU_reset = func(i) {
setprop("FMGC/internal/cruise-fl-prog", 100);
# PERF
setprop("FMGC/internal/vs1g", 0);
#PERF TO
setprop("FMGC/internal/v1", 0);
@ -120,10 +119,6 @@ var MCDU_reset = func(i) {
setprop("FMGC/internal/v2", 0);
setprop("FMGC/internal/v2-set", 0);
setprop("FMGC/internal/f-speed", 0);
setprop("FMGC/internal/s-speed", 0);
setprop("FMGC/internal/o-speed", 0);
setprop("FMGC/internal/reduc-agl-ft", "1500"); #eventually set to 1500 above runway
setprop("MCDUC/thracc-set", 0);
setprop("FMGC/internal/to-flap", 0);
@ -148,12 +143,7 @@ var MCDU_reset = func(i) {
setprop("FMGC/internal/dest-temp", -999);
setprop("FMGC/internal/dest-mag", -1);
setprop("FMGC/internal/dest-wind", -1);
setprop("FMGC/internal/vapp-speed", -1);
setprop("FMGC/internal/vapp-speed-set", 0);
setprop("FMGC/internal/f-speed-appr", -1);
setprop("FMGC/internal/s-speed-appr", -1);
setprop("FMGC/internal/o-speed-appr", -1);
setprop("FMGC/internal/vls-speed-appr", -1);
setprop("FMGC/internal/final", "");
setprop("FMGC/internal/mda", -1);
setprop("FMGC/internal/dh", -1);

View file

@ -6,12 +6,6 @@ var dest_temp = props.globals.getNode("FMGC/internal/dest-temp", 1);
var dest_mag = props.globals.getNode("FMGC/internal/dest-mag", 1);
var dest_wind = props.globals.getNode("FMGC/internal/dest-wind", 1);
var transAlt = props.globals.getNode("FMGC/internal/trans-alt", 1);
var vapp_speed = props.globals.getNode("FMGC/internal/vapp-speed", 1);
var vapp_speed_set = props.globals.getNode("FMGC/internal/vapp-speed-set", 1);
var f_speed_appr = props.globals.getNode("FMGC/internal/f-speed-appr", 1);
var s_speed_appr = props.globals.getNode("FMGC/internal/s-speed-appr", 1);
var o_speed_appr = props.globals.getNode("FMGC/internal/o-speed-appr", 1);
var vls_speed_appr = props.globals.getNode("FMGC/internal/vls-speed-appr", 1);
var final = props.globals.getNode("FMGC/internal/final", 1);
var mda = props.globals.getNode("FMGC/internal/mda", 1);
var dh = props.globals.getNode("FMGC/internal/dh", 1);
@ -84,19 +78,12 @@ var perfAPPRInput = func(key, i) {
}
} else if (key == "L5") {
if (scratchpad == "CLR") {
if (dest_wind.getValue() < 5) {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + 5);
} else if (dest_wind.getValue() > 15) {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + 15);
} else {
setprop("FMGC/internal/vapp-speed", vls_speed_appr.getValue() + dest_wind.getValue());
}
setprop("FMGC/internal/vapp-speed-set", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 200) {
setprop("FMGC/internal/vapp-speed", scratchpad);
setprop("FMGC/internal/vapp-speed-set", 1);
setprop("FMGC/internal/computed-speeds/vapp_appr", scratchpad);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else {
notAllowed(i);