Clean-up entabing for MCDU files
This commit is contained in:
parent
06c0dc01f6
commit
8882696511
10 changed files with 443 additions and 440 deletions
|
@ -1,6 +1,7 @@
|
|||
# A3XX MCDU
|
||||
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
|
||||
|
||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
||||
|
||||
var MCDU_1 = nil;
|
||||
var MCDU_2 = nil;
|
||||
|
@ -201,7 +202,7 @@ var canvas_MCDU_base = {
|
|||
tran_rect[2], # 1 xe
|
||||
tran_rect[3], # 2 ye
|
||||
tran_rect[0]); #3 xs
|
||||
# coordinates are top,right,bottom,left (ys, xe, ye, xs) ref: l621 of simgear/canvas/CanvasElement.cxx
|
||||
# coordinates are top,right,bottom,left (ys, xe, ye, xs) ref: l621 of simgear/canvas/CanvasElement.cxx
|
||||
me[key].set("clip", clip_rect);
|
||||
me[key].set("clip-frame", canvas.Element.PARENT);
|
||||
}
|
||||
|
@ -741,21 +742,23 @@ var canvas_MCDU_base = {
|
|||
if (alt_airport.getValue() == "") {
|
||||
me["Simple_L2"].setText("NONE");
|
||||
} else {
|
||||
me["Simple_L2"].setText(alt_airport.getValue());
|
||||
}
|
||||
me["Simple_L2"].setText("NONE");
|
||||
} else {
|
||||
me["Simple_L2"].setText(alt_airport.getValue());
|
||||
}
|
||||
me.showRight(1, -1, 0, 0, 0, 0);
|
||||
me["Simple_R2S"].hide();
|
||||
me["INITA_InitRequest"].hide();
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/latitude-deg") > 0) {
|
||||
me["Simple_L4"].setText(sprintf("%6.2fN", getprop("autopilot/route-manager/route/wp[0]/latitude-deg")));
|
||||
} else {
|
||||
me["Simple_L4"].setText(sprintf("%6.2fS", getprop("autopilot/route-manager/route/wp[0]/latitude-deg") * -1));
|
||||
}
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/longitude-deg") > 0) {
|
||||
me["Simple_R4"].setText(sprintf("%7.2fE", getprop("autopilot/route-manager/route/wp[0]/longitude-deg")));
|
||||
} else {
|
||||
me["Simple_R4"].setText(sprintf("%7.2fW", getprop("autopilot/route-manager/route/wp[0]/longitude-deg") * -1));
|
||||
}
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/latitude-deg") > 0) {
|
||||
me["Simple_L4"].setText(sprintf("%6.2fN", getprop("autopilot/route-manager/route/wp[0]/latitude-deg")));
|
||||
} else {
|
||||
me["Simple_L4"].setText(sprintf("%6.2fS", getprop("autopilot/route-manager/route/wp[0]/latitude-deg") * -1));
|
||||
}
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/longitude-deg") > 0) {
|
||||
me["Simple_R4"].setText(sprintf("%7.2fE", getprop("autopilot/route-manager/route/wp[0]/longitude-deg")));
|
||||
} else {
|
||||
me["Simple_R4"].setText(sprintf("%7.2fW", getprop("autopilot/route-manager/route/wp[0]/longitude-deg") * -1));
|
||||
}
|
||||
} else {
|
||||
me["INITA_CoRoute"].show();
|
||||
me["INITA_FromTo"].show();
|
||||
|
@ -849,87 +852,87 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (toFromSet.getValue() == 1) {
|
||||
#need to convert lat/long format
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/latitude-deg") > 0) {
|
||||
me["Simple_L1"].setText(sprintf("%6.2fN", getprop("autopilot/route-manager/route/wp[0]/latitude-deg")));
|
||||
} else {
|
||||
me["Simple_L1"].setText(sprintf("%6.2fS", getprop("autopilot/route-manager/route/wp[0]/latitude-deg") * -1));
|
||||
}
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/longitude-deg") > 0) {
|
||||
me["Simple_R1"].setText(sprintf("%7.2fE", getprop("autopilot/route-manager/route/wp[0]/longitude-deg")));
|
||||
} else {
|
||||
me["Simple_R1"].setText(sprintf("%7.2fW", getprop("autopilot/route-manager/route/wp[0]/longitude-deg") * -1));
|
||||
}
|
||||
me["Simple_C1"].setText(sprintf("%s", depArpt.getValue()));
|
||||
#need to convert lat/long format
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/latitude-deg") > 0) {
|
||||
me["Simple_L1"].setText(sprintf("%6.2fN", getprop("autopilot/route-manager/route/wp[0]/latitude-deg")));
|
||||
} else {
|
||||
me["Simple_L1"].setText(sprintf("%6.2fS", getprop("autopilot/route-manager/route/wp[0]/latitude-deg") * -1));
|
||||
}
|
||||
if (getprop("autopilot/route-manager/route/wp[0]/longitude-deg") > 0) {
|
||||
me["Simple_R1"].setText(sprintf("%7.2fE", getprop("autopilot/route-manager/route/wp[0]/longitude-deg")));
|
||||
} else {
|
||||
me["Simple_R1"].setText(sprintf("%7.2fW", getprop("autopilot/route-manager/route/wp[0]/longitude-deg") * -1));
|
||||
}
|
||||
me["Simple_C1"].setText(sprintf("%s", depArpt.getValue()));
|
||||
} else {
|
||||
me["Simple_L1"].setText("-----.--");
|
||||
me["Simple_R1"].setText("------.--");
|
||||
me["Simple_C1"].setText("----");
|
||||
me["Simple_L1"].setText("-----.--");
|
||||
me["Simple_R1"].setText("------.--");
|
||||
me["Simple_C1"].setText("----");
|
||||
}
|
||||
|
||||
#need to convert lat/long format
|
||||
gps_lat = getprop("position/latitude-deg");
|
||||
gps_lon = getprop("position/longitude-deg");
|
||||
if (gps_lat > 0) {
|
||||
me["Simple_L2"].setText(sprintf("%6.2fN", gps_lat));
|
||||
} else {
|
||||
me["Simple_L2"].setText(sprintf("%6.2fS", gps_lat * -1));
|
||||
}
|
||||
if (gps_lon > 0) {
|
||||
me["Simple_R2"].setText(sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_R2"].setText(sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
if (getprop("systems/navigation/adr/operating-1")) {
|
||||
#me["Simple_C3"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
me["Simple_L2"].setText(sprintf("%6.2fN", gps_lat));
|
||||
} else {
|
||||
me["Simple_C3"].setText("-----.--/-----.--");
|
||||
me["Simple_L2"].setText(sprintf("%6.2fS", gps_lat * -1));
|
||||
}
|
||||
if (gps_lon > 0) {
|
||||
me["Simple_R2"].setText(sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_R2"].setText(sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
if (getprop("systems/navigation/adr/operating-1")) {
|
||||
#me["Simple_C3"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C3"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
} else {
|
||||
me["Simple_C3"].setText("-----.--/-----.--");
|
||||
}
|
||||
if (getprop("systems/navigation/adr/operating-2")) {
|
||||
#me["Simple_C4"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
#me["Simple_C4"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C4"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
} else {
|
||||
me["Simple_C4"].setText("-----.--/-----.--");
|
||||
me["Simple_C4"].setText("-----.--/-----.--");
|
||||
}
|
||||
if (getprop("systems/navigation/adr/operating-3")) {
|
||||
#me["Simple_C5"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
#me["Simple_C5"].setText(getprop("position/latitude-string") ~ "/" ~ getprop("position/longitude-string"));
|
||||
if (gps_lat > 0 and gps_lon > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else if (gps_lat > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fN", gps_lat) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
} else if (gps_lon > 0) {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fE", gps_lon));
|
||||
} else {
|
||||
me["Simple_C5"].setText(sprintf("%6.2fS", gps_lat * -1) ~ "/" ~ sprintf("%7.2fW", gps_lon * -1));
|
||||
}
|
||||
} else {
|
||||
me["Simple_C5"].setText("-----.--/-----.--");
|
||||
me["Simple_C5"].setText("-----.--/-----.--");
|
||||
}
|
||||
|
||||
if (align_set.getValue() == 1) {
|
||||
#still need * to right of button instead of arrow
|
||||
me["Simple_R6"].setText("CONFIRM ALIGN ");
|
||||
me.colorRight("ack", "ack", "ack", "ack", "ack", "amb");
|
||||
#still need * to right of button instead of arrow
|
||||
me["Simple_R6"].setText("CONFIRM ALIGN ");
|
||||
me.colorRight("ack", "ack", "ack", "ack", "ack", "amb");
|
||||
me.colorRightArrow("ack", "ack", "ack", "ack", "ack", "amb");
|
||||
} else {
|
||||
me["Simple_R6"].setText("ALIGN ON REF ");
|
||||
me["Simple_R6"].setText("ALIGN ON REF ");
|
||||
}
|
||||
|
||||
me["Simple_L1S"].setText("LAT");
|
||||
|
@ -983,12 +986,12 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L6"].setText(" RETURN");
|
||||
|
||||
if (toFromSet.getValue() == 1 and alt_selected.getValue() == 0) {
|
||||
me["Simple_Title"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
||||
me["Simple_Title"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
||||
} else if (alt_airport.getValue() != "" and alt_selected.getValue() == 1) {
|
||||
me["Simple_Title"].setText(sprintf("%s", alt_airport.getValue()));
|
||||
me["Simple_Title"].setText(sprintf("%s", alt_airport.getValue()));
|
||||
} else {
|
||||
me["Simple_Title"].setText("ROUTE SELECTION");
|
||||
}
|
||||
me["Simple_Title"].setText("ROUTE SELECTION");
|
||||
}
|
||||
|
||||
} else if (page == "INITB") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
|
@ -1051,39 +1054,39 @@ 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((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_L2"].setText(sprintf("%4.1f/" ~ trip_time.getValue(), trip_fuel.getValue()));
|
||||
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
|
||||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
me["Simple_L2"].setText(sprintf("%4.1f/" ~ trip_time.getValue(), trip_fuel.getValue()));
|
||||
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
|
||||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
me["Simple_R3S"].hide();
|
||||
me["Simple_R3"].hide();
|
||||
me["Simple_R3_Arrow"].hide();
|
||||
me["Simple_C4"].hide();
|
||||
me["Simple_R4"].setText(sprintf("%4.1f/", tow.getValue()) ~ sprintf("%4.1f", lw.getValue()));
|
||||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
me["Simple_R4"].setText(sprintf("%4.1f/", tow.getValue()) ~ sprintf("%4.1f", lw.getValue()));
|
||||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
|
||||
me["Simple_Title"].setText("INIT FUEL PREDICTION ");
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
|
||||
me.colorLeft("ack", "grn", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "ack", "grn", "ack", "grn");
|
||||
me.colorLeft("ack", "grn", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "ack", "grn", "ack", "grn");
|
||||
} else {
|
||||
me["Simple_L2"].setText("---.-/----");
|
||||
me["Simple_L3"].setText("---.-/---.-");
|
||||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
me["Simple_L2"].setText("---.-/----");
|
||||
me["Simple_L3"].setText("---.-/---.-");
|
||||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
me["Simple_R3S"].show();
|
||||
me["Simple_R3"].show();
|
||||
me["Simple_R3_Arrow"].show();
|
||||
me["Simple_R4"].setText("---.-/---.-");
|
||||
me["Simple_R6"].setText("---.-/----");
|
||||
me["Simple_R6"].setText("---.-/----");
|
||||
|
||||
me["Simple_Title"].setText("INIT");
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
|
@ -1112,11 +1115,11 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (blockSet.getValue() == 1) {
|
||||
me["Simple_R2"].show();
|
||||
me["Simple_R2"].show();
|
||||
me["INITB_Block"].hide();
|
||||
} else {
|
||||
me["Simple_R2"].hide();
|
||||
me["INITB_Block"].show();
|
||||
me["Simple_R2"].hide();
|
||||
me["INITB_Block"].show();
|
||||
}
|
||||
|
||||
} else if (page == "FUELPRED") {
|
||||
|
@ -1197,34 +1200,34 @@ 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((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()));
|
||||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
|
||||
setprop("FMGC/internal/fob", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/gw", num(getprop("fdm/jsbsim/inertia/weight-lbs") / 1000));
|
||||
setprop("FMGC/internal/cg", num(getprop("FMGC/internal/zfwcg")));
|
||||
me["Simple_R4"].setText(sprintf("%4.1f/FF+FQ", fob.getValue()));
|
||||
me["Simple_R5"].setText(sprintf("%4.1f/", gw.getValue()) ~ sprintf("%4.1f", cg.getValue()));
|
||||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
me["Simple_L3"].setText(sprintf("%4.1f/", rte_rsv.getValue()) ~ sprintf("%4.1f", rte_percent.getValue()));
|
||||
me["Simple_L4"].setText(sprintf("%4.1f/" ~ alt_time.getValue(), alt_fuel.getValue()));
|
||||
me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue()));
|
||||
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
|
||||
|
||||
me.colorLeft("ack", "ack", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "blu", "grn", "grn", "grn");
|
||||
setprop("FMGC/internal/fob", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/gw", num(getprop("fdm/jsbsim/inertia/weight-lbs") / 1000));
|
||||
setprop("FMGC/internal/cg", num(getprop("FMGC/internal/zfwcg")));
|
||||
me["Simple_R4"].setText(sprintf("%4.1f/FF+FQ", fob.getValue()));
|
||||
me["Simple_R5"].setText(sprintf("%4.1f/", gw.getValue()) ~ sprintf("%4.1f", cg.getValue()));
|
||||
me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue()));
|
||||
|
||||
me.colorLeft("ack", "ack", "blu", "blu", "blu", "blu");
|
||||
me.colorRight("ack", "ack", "blu", "grn", "grn", "grn");
|
||||
} else {
|
||||
me["Simple_L3"].setText("---.-/---.-");
|
||||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
me["Simple_L3"].setText("---.-/---.-");
|
||||
me["Simple_L4"].setText("---.-/----");
|
||||
me["Simple_L5"].setText("---.-/----");
|
||||
me["Simple_L6"].setText("---.-");
|
||||
|
||||
me["Simple_R4"].setText("---.-/FF+FQ");
|
||||
me["Simple_R5"].setText("---.-/---.-");
|
||||
me["Simple_R6"].setText("---.-/----");
|
||||
me["Simple_R6"].setText("---.-/----");
|
||||
}
|
||||
|
||||
me["Simple_R3S"].setText("ZFWCG/ZFW");
|
||||
|
@ -1297,10 +1300,10 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (getprop("FMGC/status/phase") == 1) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
|
||||
if (v1Set.getValue() == 1) {
|
||||
me["PERFTO_V1"].hide();
|
||||
|
@ -1445,37 +1448,37 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (getprop("FMGC/status/phase") == 5) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
|
||||
me["Simple_L0S"].setText("DEST");
|
||||
me["Simple_L1S"].setText("QNH");
|
||||
if (dest_qnh.getValue() != -1) {
|
||||
if (dest_qnh.getValue() < 100) {
|
||||
me["Simple_L1"].setText(sprintf("%4.2f", dest_qnh.getValue()));
|
||||
} else {
|
||||
me["Simple_L1"].setText(sprintf("%4.0f", dest_qnh.getValue()));
|
||||
}
|
||||
me.fontLeft(default, 0, 0, 0, 0, 0);
|
||||
if (dest_qnh.getValue() < 100) {
|
||||
me["Simple_L1"].setText(sprintf("%4.2f", dest_qnh.getValue()));
|
||||
} else {
|
||||
me["Simple_L1"].setText(sprintf("%4.0f", dest_qnh.getValue()));
|
||||
}
|
||||
me.fontLeft(default, 0, 0, 0, 0, 0);
|
||||
} else {
|
||||
me["Simple_L1"].setText("[ ] ");
|
||||
me.fontLeft(symbol, 0, 0, 0, 0, 0);
|
||||
me["Simple_L1"].setText("[ ] ");
|
||||
me.fontLeft(symbol, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
me["Simple_L2S"].setText("TEMP");
|
||||
if (dest_temp.getValue() != -999) {
|
||||
me["Simple_L2"].setText(sprintf("%3.0fg ", dest_temp.getValue()));
|
||||
me["Simple_L2"].setText(sprintf("%3.0fg ", dest_temp.getValue()));
|
||||
} else {
|
||||
me["Simple_L2"].setText("---g ");
|
||||
me["Simple_L2"].setText("---g ");
|
||||
}
|
||||
|
||||
me["Simple_L3S"].setText("MAG WIND");
|
||||
if (dest_mag.getValue() != -1 and dest_wind.getValue() != -1) {
|
||||
me["Simple_L3"].setText(sprintf("%3.0fg/", dest_mag.getValue()) ~ sprintf("%3.0f", dest_wind.getValue()));
|
||||
me["Simple_L3"].setText(sprintf("%3.0fg/", dest_mag.getValue()) ~ sprintf("%3.0f", dest_wind.getValue()));
|
||||
} else {
|
||||
me["Simple_L3"].setText("---g/---");;
|
||||
me["Simple_L3"].setText("---g/---");;
|
||||
}
|
||||
|
||||
me["Simple_L4S"].setText("TRANS ALT");
|
||||
|
@ -1483,16 +1486,16 @@ var canvas_MCDU_base = {
|
|||
|
||||
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);
|
||||
}
|
||||
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_L5"].setText("[ ] ");
|
||||
me.fontLeft(0, 0, 0, 0, symbol, 0);
|
||||
}
|
||||
|
||||
me["Simple_R1S"].setText("FINAL");
|
||||
|
@ -1508,13 +1511,13 @@ var canvas_MCDU_base = {
|
|||
me["Simple_R4"].setText("CONF3 ");
|
||||
me["Simple_R5"].setText("FULL ");
|
||||
if (ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) {
|
||||
me["PERFAPPR_LDG_3"].hide();
|
||||
me["PERFAPPR_LDG_F"].show();
|
||||
me.fontSizeRight(0, 0, 0, normal, small, 0);
|
||||
me["PERFAPPR_LDG_3"].hide();
|
||||
me["PERFAPPR_LDG_F"].show();
|
||||
me.fontSizeRight(0, 0, 0, normal, small, 0);
|
||||
} else {
|
||||
me["PERFAPPR_LDG_3"].show();
|
||||
me["PERFAPPR_LDG_F"].hide();
|
||||
me.fontSizeRight(0, 0, 0, small, normal, 0);
|
||||
me["PERFAPPR_LDG_3"].show();
|
||||
me["PERFAPPR_LDG_F"].hide();
|
||||
me.fontSizeRight(0, 0, 0, small, normal, 0);
|
||||
}
|
||||
|
||||
me["Simple_L6S"].setText(" PREV");
|
||||
|
@ -1534,19 +1537,19 @@ var canvas_MCDU_base = {
|
|||
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);
|
||||
setprop("FMGC/internal/vls-speed-appr", ((-0.0005 * lw.getValue() * lw.getValue()) + (0.5488 * lw.getValue()) + 43.279) * 1.23);
|
||||
} else {
|
||||
setprop("FMGC/internal/vls-speed-appr", ((-0.0007 * lw.getValue() * lw.getValue()) + (0.6002 * lw.getValue()) + 38.479) * 1.23);
|
||||
setprop("FMGC/internal/vls-speed-appr", ((-0.0007 * lw.getValue() * lw.getValue()) + (0.6002 * lw.getValue()) + 38.479) * 1.23);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
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()));
|
||||
|
@ -1613,10 +1616,10 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (getprop("FMGC/status/phase") == 6) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
|
||||
if (thrAccSet.getValue() == 1) {
|
||||
me["Simple_L5"].setFontSize(normal);
|
||||
|
@ -1706,14 +1709,14 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
|
||||
if (page == "CLB" and getprop("FMGC/status/phase") == 2) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (page == "CRZ" and getprop("FMGC/status/phase") == 3) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
}else if (page == "DES" and getprop("FMGC/status/phase") == 4) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if (page == "CRZ" and getprop("FMGC/status/phase") == 3) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
}else if (page == "DES" and getprop("FMGC/status/phase") == 4) {
|
||||
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
}
|
||||
|
||||
if (managedSpeed.getValue() == 1) {
|
||||
me["Simple_L1"].setText("MANAGED");
|
||||
|
|
|
@ -24,7 +24,7 @@ var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
|||
var fuelPredInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -47,54 +47,54 @@ var fuelPredInput = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
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/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
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/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
|
@ -111,16 +111,16 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
if (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
if ((zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) or (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9)) {
|
||||
|
@ -134,8 +134,8 @@ 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-set", 1);
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
var initInputA = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
} else if (scratchpad == "") {
|
||||
setprop("FMGC/internal/alt-selected", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 1) {
|
||||
var tfs = size(scratchpad);
|
||||
} else if (scratchpad == "") {
|
||||
setprop("FMGC/internal/alt-selected", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 1) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4) {
|
||||
setprop("FMGC/internal/alt-airport", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -23,11 +23,11 @@ var initInputA = func(key, i) {
|
|||
setprop("FMGC/internal/alt-selected", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("MCDUC/flight-num", "");
|
||||
|
@ -101,8 +101,8 @@ var initInputA = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (scratchpad == "") {
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||
|
|
|
@ -23,55 +23,55 @@ var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
|||
var initInputB = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 10.0) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 10.0) {
|
||||
setprop("FMGC/internal/taxi-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
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()));
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
# else if (key == "L2") {
|
||||
# if (scratchpad == "CLR") {
|
||||
# notAllowed(i);
|
||||
# } else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
# var tfs = size(scratchpad);
|
||||
# if (tfs >= 1 and tfs <= 4) {
|
||||
# var temp_rte = num(scratchpad * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100));
|
||||
# if (scratchpad >= 0.0 and scratchpad <= block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - temp_rte) {
|
||||
# setprop("FMGC/internal/trip-fuel", scratchpad);
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
#
|
||||
# setprop("FMGC/internal/rte-rsv", temp_rte);
|
||||
# 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);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
#
|
||||
# }
|
||||
# if (scratchpad == "CLR") {
|
||||
# notAllowed(i);
|
||||
# } else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
# var tfs = size(scratchpad);
|
||||
# if (tfs >= 1 and tfs <= 4) {
|
||||
# var temp_rte = num(scratchpad * (rte_percent.getValue() / 100) / (1 + rte_percent.getValue() / 100));
|
||||
# if (scratchpad >= 0.0 and scratchpad <= block.getValue() - taxi_fuel.getValue() - min_dest_fob.getValue() - temp_rte) {
|
||||
# setprop("FMGC/internal/trip-fuel", scratchpad);
|
||||
# setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
#
|
||||
# setprop("FMGC/internal/rte-rsv", temp_rte);
|
||||
# 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);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
# } else {
|
||||
# notAllowed(i);
|
||||
# }
|
||||
#
|
||||
# }
|
||||
else if (key == "L3") {
|
||||
if (scratchpad == "CLR") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
var tfs = size(scratchpad);
|
||||
|
@ -94,54 +94,54 @@ var initInputB = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
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/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
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/lw", num(tow.getValue() - trip_fuel.getValue()));
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
notAllowed(i);
|
||||
|
@ -204,13 +204,13 @@ var initInputB = func(key, i) {
|
|||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
if (scratchpad != "") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
setprop("FMGC/internal/zfw", num((getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs")) / 1000));
|
||||
if (scratchpad != "") {
|
||||
notAllowed(i);
|
||||
} else {
|
||||
setprop("FMGC/internal/zfw", num((getprop("fdm/jsbsim/inertia/weight-lbs") - getprop("consumables/fuel/total-fuel-lbs")) / 1000));
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
setprop("FMGC/internal/block", num(getprop("consumables/fuel/total-fuel-lbs") / 1000));
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,35 +4,35 @@ var initInputIRS = func(key, i) {
|
|||
if (key == "L6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
} else if (key == "R6") {
|
||||
if (getprop("FMGC/internal/tofrom-set") == 1 and getprop("systems/navigation/adr/any-adr-on") == 1) {
|
||||
if (getprop("FMGC/internal/align-set") == 0) {
|
||||
setprop("FMGC/internal/align-set", 1);
|
||||
} else {
|
||||
setprop("controls/adirs/mcducbtn", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
}
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "SELECT REFERENCE") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
|
||||
} else if (getprop("systems/navigation/adr/any-adr-on") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "IRS NOT ALIGNED") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
if (getprop("FMGC/internal/tofrom-set") == 1 and getprop("systems/navigation/adr/any-adr-on") == 1) {
|
||||
if (getprop("FMGC/internal/align-set") == 0) {
|
||||
setprop("FMGC/internal/align-set", 1);
|
||||
} else {
|
||||
setprop("controls/adirs/mcducbtn", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
}
|
||||
} else if (getprop("FMGC/internal/tofrom-set") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "SELECT REFERENCE") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT REFERENCE");
|
||||
} else if (getprop("systems/navigation/adr/any-adr-on") == 0) {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "IRS NOT ALIGNED") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||
}
|
||||
}
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "IRS NOT ALIGNED");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ var MCDU_reset = func(i) {
|
|||
setprop("FMGC/internal/v2", 0);
|
||||
|
||||
# IRSINIT variables
|
||||
setprop("FMGC/internal/align-set", 0);
|
||||
setprop("FMGC/internal/align-set", 0);
|
||||
|
||||
# ROUTE SELECTION variables
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
# ROUTE SELECTION variables
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
|
||||
# INT-B
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
|
@ -72,16 +72,16 @@ var MCDU_reset = func(i) {
|
|||
|
||||
#FUELPRED
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("FMGC/internal/pri-utc", "0000");
|
||||
setprop("FMGC/internal/alt-utc", "0000");
|
||||
setprop("FMGC/internal/pri-efob", 0);
|
||||
setprop("FMGC/internal/alt-efob", 0);
|
||||
setprop("FMGC/internal/fob", 0);
|
||||
setprop("FMGC/internal/gw", 0);
|
||||
setprop("FMGC/internal/cg", 0);
|
||||
|
||||
#PERF TO
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("FMGC/internal/pri-utc", "0000");
|
||||
setprop("FMGC/internal/alt-utc", "0000");
|
||||
setprop("FMGC/internal/pri-efob", 0);
|
||||
setprop("FMGC/internal/alt-efob", 0);
|
||||
setprop("FMGC/internal/fob", 0);
|
||||
setprop("FMGC/internal/gw", 0);
|
||||
setprop("FMGC/internal/cg", 0);
|
||||
|
||||
#PERF TO
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("FMGC/internal/vr-set", 0);
|
||||
setprop("FMGC/internal/v2-set", 0);
|
||||
setprop("FMGC/internal/to-flap", 0);
|
||||
|
@ -94,22 +94,22 @@ var MCDU_reset = func(i) {
|
|||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
|
||||
#PERF APPR
|
||||
setprop("FMGC/internal/dest-qnh", -1);
|
||||
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);
|
||||
setprop("FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 1);
|
||||
#PERF APPR
|
||||
setprop("FMGC/internal/dest-qnh", -1);
|
||||
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);
|
||||
setprop("FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 1);
|
||||
|
||||
#RADNAV
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
|
@ -143,12 +143,12 @@ var MCDU_reset = func(i) {
|
|||
}
|
||||
|
||||
var setMode = func(will) {
|
||||
setprop("MCDU/keyboard-entry", will);
|
||||
if (will == 0) {
|
||||
gui.popupTip("MCDU keyboard entry disabled");
|
||||
} else {
|
||||
gui.popupTip("MCDU keyboard entry enabled");
|
||||
}
|
||||
setprop("MCDU/keyboard-entry", will);
|
||||
if (will == 0) {
|
||||
gui.popupTip("MCDU keyboard entry disabled");
|
||||
} else {
|
||||
gui.popupTip("MCDU keyboard entry enabled");
|
||||
}
|
||||
}
|
||||
|
||||
var lskbutton = func(btn, i) {
|
||||
|
@ -438,7 +438,7 @@ var arrowbutton = func(btn, i) {
|
|||
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
|
@ -458,7 +458,7 @@ var arrowbutton = func(btn, i) {
|
|||
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
|
|
|
@ -19,98 +19,98 @@ var ldg_config_3_set = props.globals.getNode("FMGC/internal/ldg-config-3-set", 1
|
|||
var ldg_config_f_set = props.globals.getNode("FMGC/internal/ldg-config-f-set", 1);
|
||||
|
||||
var perfAPPRInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L1") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-qnh", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-qnh", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if ((scratchpad >= 25 and scratchpad <= 60) or (scratchpad >= 900 and scratchpad <= 1100)) {
|
||||
# doesn't support accidental temp input yet
|
||||
} else if ((scratchpad >= 25 and scratchpad <= 60) or (scratchpad >= 900 and scratchpad <= 1100)) {
|
||||
# doesn't support accidental temp input yet
|
||||
setprop("FMGC/internal/dest-qnh", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-temp", -999);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-temp", -999);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (scratchpad >= -100 and scratchpad < 100) {
|
||||
} else if (scratchpad >= -100 and scratchpad < 100) {
|
||||
setprop("FMGC/internal/dest-temp", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
var tfs = size(scratchpad);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-mag", -1);
|
||||
setprop("FMGC/internal/dest-wind", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
var tfs = size(scratchpad);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/dest-mag", -1);
|
||||
setprop("FMGC/internal/dest-wind", -1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
|
||||
var weather = split("/", scratchpad);
|
||||
var mag = size(weather[0]);
|
||||
var wind = size(weather[1]);
|
||||
if (mag >= 1 and mag <= 3 and weather[0] >= 1 and weather[0] <= 360 and wind >= 1 and wind <= 3 and weather[1] >= 0 and weather[1] <= 100) {
|
||||
setprop("FMGC/internal/dest-mag", weather[0]);
|
||||
setprop("FMGC/internal/dest-wind", weather[1]);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs >= 3 and tfs <= 7 and find("/", scratchpad) != -1) {
|
||||
var weather = split("/", scratchpad);
|
||||
var mag = size(weather[0]);
|
||||
var wind = size(weather[1]);
|
||||
if (mag >= 1 and mag <= 3 and weather[0] >= 1 and weather[0] <= 360 and wind >= 1 and wind <= 3 and weather[1] >= 0 and weather[1] <= 100) {
|
||||
setprop("FMGC/internal/dest-mag", weather[0]);
|
||||
setprop("FMGC/internal/dest-wind", weather[1]);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (scratchpad >= 0 and scratchpad <= 50000) {
|
||||
} else if (scratchpad >= 0 and scratchpad <= 50000) {
|
||||
setprop("FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(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);
|
||||
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 (scratchpad >= 0 and scratchpad <= 200) {
|
||||
} else if (scratchpad >= 0 and scratchpad <= 200) {
|
||||
setprop("FMGC/internal/vapp-speed", scratchpad);
|
||||
setprop("FMGC/internal/vapp-speed-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "L6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DES");
|
||||
} else if (key == "R4") {
|
||||
if (scratchpad == "" and ldg_config_f_set.getValue() == 1 and ldg_config_3_set.getValue() == 0) {
|
||||
setprop("FMGC/internal/ldg-config-3-set", 1);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
if (scratchpad == "" and ldg_config_f_set.getValue() == 1 and ldg_config_3_set.getValue() == 0) {
|
||||
setprop("FMGC/internal/ldg-config-3-set", 1);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 0);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "" and ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) {
|
||||
setprop("FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
if (scratchpad == "" and ldg_config_3_set.getValue() == 1 and ldg_config_f_set.getValue() == 0) {
|
||||
setprop("FMGC/internal/ldg-config-3-set", 0);
|
||||
setprop("FMGC/internal/ldg-config-f-set", 1);
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "GA");
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
||||
|
||||
var perfCRZInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2020 Matthew Maring (hayden2000)
|
||||
|
||||
var perfDESInput = func(key, i) {
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");
|
||||
if (key == "L2") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/cost-index", 0);
|
||||
|
|
|
@ -129,7 +129,7 @@ var perfTOInput = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs == 1) {
|
||||
if (scratchpad >= 1 and scratchpad <= 4) {
|
||||
if (scratchpad >= 1 and scratchpad <= 4) {
|
||||
setprop("FMGC/internal/to-flap", scratchpad);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
Loading…
Add table
Reference in a new issue