Fix non-numeric data entries, add cruise temp support, add dn trim support
This commit is contained in:
parent
d767bc325b
commit
9f5710e50e
11 changed files with 228 additions and 187 deletions
|
@ -29,6 +29,9 @@ setprop("MCDUC/colors/yel/g", 0.9333);
|
|||
setprop("MCDUC/colors/yel/b", 0.0000);
|
||||
|
||||
# Fetch nodes:
|
||||
var mcdu_keyboard_entry = props.globals.getNode("MCDU/keyboard-entry", 1);
|
||||
|
||||
#ACCONFIG
|
||||
var ac1 = props.globals.getNode("systems/electrical/bus/ac-1", 1);
|
||||
var ac2 = props.globals.getNode("systems/electrical/bus/ac-2", 1);
|
||||
var mcdu1_lgt = props.globals.getNode("controls/lighting/DU/mcdu1", 1);
|
||||
|
@ -38,7 +41,6 @@ var engType = props.globals.getNode("MCDUC/eng", 1);
|
|||
var database1 = props.globals.getNode("FMGC/internal/navdatabase", 1);
|
||||
var database2 = props.globals.getNode("FMGC/internal/navdatabase2", 1);
|
||||
var databaseCode = props.globals.getNode("FMGC/internal/navdatabasecode", 1);
|
||||
var mcdu_keyboard_entry = props.globals.getNode("MCDU/keyboard-entry", 1);
|
||||
|
||||
# RADNAV
|
||||
var vor1 = props.globals.getNode("FMGC/internal/vor1-mcdu", 1);
|
||||
|
@ -58,16 +60,18 @@ var ils1CRS = props.globals.getNode("instrumentation/nav[0]/radials/selected-deg
|
|||
var vor1CRS = props.globals.getNode("instrumentation/nav[2]/radials/selected-deg", 1);
|
||||
var vor2CRS = props.globals.getNode("instrumentation/nav[3]/radials/selected-deg", 1);
|
||||
|
||||
# INT-A variabless
|
||||
# INT-A
|
||||
var flightNum = props.globals.getNode("MCDUC/flight-num", 1);
|
||||
var flightNumSet = props.globals.getNode("MCDUC/flight-num-set", 1);
|
||||
var depArpt = props.globals.getNode("FMGC/internal/dep-arpt", 1);
|
||||
var arrArpt = props.globals.getNode("FMGC/internal/arr-arpt", 1);
|
||||
var alt_airport = props.globals.getNode("FMGC/internal/alt-airport", 1);
|
||||
var toFromSet = props.globals.getNode("FMGC/internal/tofrom-set", 1);
|
||||
var costIndex = props.globals.getNode("FMGC/internal/cost-index", 1);
|
||||
var costIndexSet = props.globals.getNode("FMGC/internal/cost-index-set", 1);
|
||||
var cruiseFL = props.globals.getNode("FMGC/internal/cruise-fl", 1);
|
||||
var cruiseSet = props.globals.getNode("FMGC/internal/cruise-lvl-set", 1);
|
||||
var cruiseTemp = props.globals.getNode("FMGC/internal/cruise-temp", 1);
|
||||
var tropo = props.globals.getNode("FMGC/internal/tropo", 1);
|
||||
var tropoSet = props.globals.getNode("FMGC/internal/tropo-set", 1);
|
||||
var ADIRSMCDUBTN = props.globals.getNode("controls/adirs/mcducbtn", 1);
|
||||
|
@ -75,10 +79,10 @@ var ADIRSMCDUBTN = props.globals.getNode("controls/adirs/mcducbtn", 1);
|
|||
# IRSINIT variables
|
||||
var align_set = props.globals.getNode("FMGC/internal/align-set", 1);
|
||||
|
||||
# ROUTE SELECTION variables
|
||||
# ROUTE SELECTION
|
||||
var alt_selected = props.globals.getNode("FMGC/internal/alt-selected", 1);
|
||||
|
||||
# INT-B variables
|
||||
# INT-B
|
||||
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
|
||||
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);
|
||||
var zfw = props.globals.getNode("FMGC/internal/zfw", 1);
|
||||
|
@ -101,11 +105,10 @@ var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1);
|
|||
var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1);
|
||||
var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1);
|
||||
|
||||
# FUELPRED Specials
|
||||
# FUELPRED
|
||||
var state1 = props.globals.getNode("engines/engine[0]/state", 1);
|
||||
var state2 = props.globals.getNode("engines/engine[1]/state", 1);
|
||||
var engrdy = props.globals.getNode("engines/ready", 1);
|
||||
var alt_airport = props.globals.getNode("FMGC/internal/alt-airport", 1);
|
||||
var pri_utc = props.globals.getNode("FMGC/internal/pri-utc", 1);
|
||||
var alt_utc = props.globals.getNode("FMGC/internal/alt-utc", 1);
|
||||
var pri_efob = props.globals.getNode("FMGC/internal/pri-efob", 1);
|
||||
|
@ -725,10 +728,10 @@ var canvas_MCDU_base = {
|
|||
me["INITA_CruiseFLTemp"].hide();
|
||||
me["Simple_L6"].setColor(1,1,1);
|
||||
me["Simple_L6"].setText("-----/---g");
|
||||
} else if (cruiseSet.getValue() == 1) {
|
||||
} else if (cruiseSet.getValue() == 1 and cruiseTemp.getValue() != -999) {
|
||||
me["INITA_CruiseFLTemp"].hide();
|
||||
me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
|
||||
me["Simple_L6"].setText(sprintf("%s", "FL" ~ cruiseFL.getValue() ~ "/---g"));
|
||||
me["Simple_L6"].setText(sprintf("%s", "FL" ~ cruiseFL.getValue()) ~ sprintf("/%sg", cruiseTemp.getValue()));
|
||||
} else {
|
||||
me["INITA_CruiseFLTemp"].show();
|
||||
me["Simple_L6"].setColor(0.7333,0.3803,0);
|
||||
|
@ -1331,8 +1334,12 @@ var canvas_MCDU_base = {
|
|||
}
|
||||
if (flapTHSSet.getValue() == 1) {
|
||||
me["Simple_R3"].setFont(default);
|
||||
me["Simple_R3"].setFontSize(normal);
|
||||
me["Simple_R3"].setText(sprintf("%s", flapTO.getValue() ~ "/UP" ~ THSTO.getValue()));
|
||||
me["Simple_R3"].setFontSize(normal);
|
||||
if (THSTO.getValue() >= 0) {
|
||||
me["Simple_R3"].setText(sprintf("%s", flapTO.getValue()) ~ sprintf("/UP%2.1f", THSTO.getValue()));
|
||||
} else {
|
||||
me["Simple_R3"].setText(sprintf("%s", flapTO.getValue()) ~ sprintf("/DN%2.1f", -1 * THSTO.getValue()));
|
||||
}
|
||||
} else {
|
||||
me["Simple_R3"].setFont(symbol);
|
||||
me["Simple_R3"].setFontSize(small);
|
||||
|
|
|
@ -29,14 +29,14 @@ var fuelPredInput = func(key, i) {
|
|||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
|
||||
var perc = split("/", scratchpad)[1];
|
||||
if (perc >= 0.0 and perc <= 100.0) {
|
||||
var perc = num(split("/", scratchpad)[1]);
|
||||
if (perc != nil and perc >= 0.0 and perc <= 100.0) {
|
||||
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", perc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
|
||||
setprop("FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -55,10 +55,9 @@ var fuelPredInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and 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()));
|
||||
|
@ -78,16 +77,14 @@ var fuelPredInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and 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()));
|
||||
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
|
@ -105,32 +102,34 @@ var fuelPredInput = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = size(zfwi[0]);
|
||||
var zfw = size(zfwi[1]);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
var zfwcg = num(zfwi[0]);
|
||||
var zfw = num(zfwi[1]);
|
||||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwcg);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
}
|
||||
}
|
||||
if (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfw);
|
||||
setprop("FMGC/internal/zfw-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
setprop("FMGC/internal/block", 30);
|
||||
setprop("FMGC/internal/block-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)) {
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
if (getprop("FMGC/internal/block-set") != 1) {
|
||||
|
|
|
@ -54,9 +54,7 @@ var initInputA = func(key, i) {
|
|||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -74,16 +72,20 @@ var initInputA = func(key, i) {
|
|||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var crz = int(scratchpad);
|
||||
var crzs = size(scratchpad);
|
||||
if (crzs >= 1 and crzs <= 3) {
|
||||
if (crz == nil) {
|
||||
} else if (find("/", scratchpad) != -1) {
|
||||
var crztemp = split("/", scratchpad);
|
||||
var crz = int(crztemp[0]);
|
||||
var crzs = size(crztemp[0]);
|
||||
var temp = num(crztemp[1]);
|
||||
var temps = size(crztemp[1]);
|
||||
if (crzs >= 1 and crzs <= 3 and temps >= 1 and temps <= 5) {
|
||||
if (crz == nil or temp == nil) {
|
||||
notAllowed(i);
|
||||
} else if (crz > 0 and crz <= 430) {
|
||||
} else if (crz > 0 and crz <= 430 and temp >= -100 and temp < 100) {
|
||||
setprop("FMGC/internal/cruise-ft", crz * 100);
|
||||
setprop("FMGC/internal/cruise-fl", crz);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 1);
|
||||
setprop("FMGC/internal/cruise-temp", temp);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
|
@ -91,6 +93,8 @@ var initInputA = func(key, i) {
|
|||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (key == "R1") {
|
||||
if (scratchpad == "CLR") {
|
||||
|
|
|
@ -28,7 +28,7 @@ var initInputB = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 10.0) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 10.0) {
|
||||
setprop("FMGC/internal/taxi-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
|
@ -76,14 +76,14 @@ var initInputB = func(key, i) {
|
|||
} else if (getprop("FMGC/internal/trip-fuel") != 0) {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 2 and tfs <= 5 and find("/", scratchpad) == 0) {
|
||||
var perc = split("/", scratchpad)[1];
|
||||
if (perc >= 0.0 and perc <= 100.0) {
|
||||
var perc = num(split("/", scratchpad)[1]);
|
||||
if (perc != nil and perc >= 0.0 and perc <= 100.0) {
|
||||
setprop("FMGC/internal/rte-rsv", num(perc) / 100 * num(trip_fuel.getValue()));
|
||||
setprop("FMGC/internal/rte-percent", perc);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 4) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= trip_fuel.getValue()) {
|
||||
setprop("FMGC/internal/rte-rsv", scratchpad);
|
||||
setprop("FMGC/internal/rte-percent", scratchpad / num(trip_fuel.getValue()) * 100);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -102,7 +102,7 @@ var initInputB = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/alt-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
|
@ -125,7 +125,7 @@ var initInputB = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 1 and tfs <= 3) {
|
||||
if (scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 0.0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/final-fuel", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
||||
|
@ -152,24 +152,26 @@ var initInputB = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad", "/" ~ sprintf("%3.1f", math.round(zfw / 1000, 0.1)));
|
||||
} else if (tfs >= 2 and tfs <= 11 and find("/", scratchpad) != -1) {
|
||||
var zfwi = split("/", scratchpad);
|
||||
var zfwcg = size(zfwi[0]);
|
||||
var zfw = size(zfwi[1]);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and zfwi[0] > 0 and zfwi[0] <= 99.9) {
|
||||
var zfwcg = num(zfwi[0]);
|
||||
var zfw = num(zfwi[1]);
|
||||
var zfwcgs = size(zfwi[0]);
|
||||
var zfws = size(zfwi[1]);
|
||||
if (zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", zfwi[0]);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
}
|
||||
if (zfw >= 1 and zfw <= 5 and zfwi[1] > 0 and zfwi[1] <= 999.9) {
|
||||
if (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9) {
|
||||
setprop("FMGC/internal/zfw", zfwi[1]);
|
||||
setprop("FMGC/internal/zfw-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)) {
|
||||
if ((zfwcg != nil and zfwcgs >= 1 and zfwcgs <= 5 and zfwcg > 0 and zfwcg <= 99.9) or (zfw != nil and zfws >= 1 and zfws <= 5 and zfw > 0 and zfw <= 999.9)) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
var zfwcg = size(scratchpad);
|
||||
if (zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
if (num(scratchpad) != nil and zfwcg >= 1 and zfwcg <= 5 and scratchpad > 0 and scratchpad <= 99.9) {
|
||||
setprop("FMGC/internal/zfwcg", scratchpad);
|
||||
setprop("FMGC/internal/zfwcg-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -192,7 +194,7 @@ var initInputB = func(key, i) {
|
|||
if (tfs == 0) {
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", sprintf("%3.1f", math.round(getprop("consumables/fuel/total-fuel-lbs") / 1000, 0.1)));
|
||||
} else if (tfs >= 1 and tfs <= 5) {
|
||||
if (scratchpad >= 1.0 and scratchpad <= maxblock) {
|
||||
if (num(scratchpad) != nil and scratchpad >= 1.0 and scratchpad <= maxblock) {
|
||||
setprop("FMGC/internal/block", scratchpad);
|
||||
setprop("FMGC/internal/block-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -9,119 +9,17 @@ var MCDU_init = func(i) {
|
|||
|
||||
var MCDU_reset = func(i) {
|
||||
setprop("MCDU[" ~ i ~ "]/active", 0);
|
||||
setprop("it-autoflight/settings/togaspd", 157);
|
||||
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
|
||||
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||
setprop("MCDU[" ~ i ~ "]/last-page", "NONE");
|
||||
setprop("MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
|
||||
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
|
||||
setprop("MCDU/keyboard-entry", 0);
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/thracc-set", 0);
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("FMGC/internal/flex", 0);
|
||||
setprop("FMGC/internal/dep-arpt", "");
|
||||
setprop("FMGC/internal/arr-arpt", "");
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("FMGC/internal/cruise-fl", 100);
|
||||
setprop("FMGC/internal/cost-index", "0");
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
setprop("FMGC/internal/reduc-agl-ft", "1500"); #eventually set to 1500 above runway
|
||||
setprop("FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("FMGC/internal/v1", 0);
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/v2", 0);
|
||||
setprop("FMGC/internal/f-speed", 0);
|
||||
setprop("FMGC/internal/s-speed", 0);
|
||||
setprop("FMGC/internal/o-speed", 0);
|
||||
setprop("FMGC/internal/minspeed", 0);
|
||||
#setprop("FMGC/internal/vapp-speed", 0);
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/v2", 0);
|
||||
|
||||
# IRSINIT variables
|
||||
setprop("FMGC/internal/align-set", 0);
|
||||
|
||||
# ROUTE SELECTION variables
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
|
||||
# INT-B
|
||||
setprop("FMGC/internal/block", 0.0);
|
||||
setprop("FMGC/internal/block-set", 0);
|
||||
setprop("FMGC/internal/zfw", 0);
|
||||
setprop("FMGC/internal/zfw-set", 0);
|
||||
setprop("FMGC/internal/zfwcg", 55.1);
|
||||
setprop("FMGC/internal/zfwcg-set", 0);
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("FMGC/internal/trip-fuel", 0);
|
||||
setprop("FMGC/internal/trip-time", "0000");
|
||||
setprop("FMGC/internal/rte-rsv", 0);
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("FMGC/internal/alt-fuel", 0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("FMGC/internal/final-fuel", 0);
|
||||
setprop("FMGC/internal/final-time", "0000");
|
||||
setprop("FMGC/internal/min-dest-fob", 0);
|
||||
setprop("FMGC/internal/tow", 0);
|
||||
setprop("FMGC/internal/lw", 0);
|
||||
setprop("FMGC/internal/trip-wind", "HD000");
|
||||
setprop("FMGC/internal/extra-fuel", 0);
|
||||
setprop("FMGC/internal/extra-time", "0000");
|
||||
|
||||
#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/vr-set", 0);
|
||||
setprop("FMGC/internal/v2-set", 0);
|
||||
setprop("FMGC/internal/to-flap", 0);
|
||||
setprop("FMGC/internal/to-ths", "0.0");
|
||||
setprop("FMGC/internal/tofrom-set", 0);
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("FMGC/internal/flap-ths-set", 0);
|
||||
setprop("FMGC/internal/flex-set", 0);
|
||||
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);
|
||||
|
||||
#RADNAV
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
setprop("FMGC/internal/ils1crs-set", 0);
|
||||
setprop("FMGC/internal/vor1freq-set", 0);
|
||||
setprop("FMGC/internal/vor1crs-set", 0);
|
||||
setprop("FMGC/internal/vor2freq-set", 0);
|
||||
setprop("FMGC/internal/vor2crs-set", 0);
|
||||
setprop("FMGC/internal/adf1freq-set", 0);
|
||||
setprop("FMGC/internal/adf2freq-set", 0);
|
||||
|
||||
#ACCONFIC
|
||||
#ACCONFIG
|
||||
setprop("FMGC/internal/navdatabase", "01JAN-28JAN");
|
||||
setprop("FMGC/internal/navdatabase2", "29JAN-26FEB");
|
||||
setprop("FMGC/internal/navdatabasecode", "AB20170101");
|
||||
|
@ -140,6 +38,123 @@ var MCDU_reset = func(i) {
|
|||
setprop("FMGC/print/mcdu/page2/R2req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R3req", 0);
|
||||
setprop("FMGC/print/mcdu/page2/R4req", 0);
|
||||
|
||||
#RADNAV
|
||||
setprop("FMGC/internal/ils1freq-set", 0);
|
||||
setprop("FMGC/internal/ils1crs-set", 0);
|
||||
setprop("FMGC/internal/vor1freq-set", 0);
|
||||
setprop("FMGC/internal/vor1crs-set", 0);
|
||||
setprop("FMGC/internal/vor2freq-set", 0);
|
||||
setprop("FMGC/internal/vor2crs-set", 0);
|
||||
setprop("FMGC/internal/adf1freq-set", 0);
|
||||
setprop("FMGC/internal/adf2freq-set", 0);
|
||||
|
||||
# INT-A
|
||||
setprop("MCDUC/flight-num", "");
|
||||
setprop("MCDUC/flight-num-set", 0);
|
||||
setprop("FMGC/internal/dep-arpt", "");
|
||||
setprop("FMGC/internal/arr-arpt", "");
|
||||
setprop("FMGC/internal/tofrom-set", 0);
|
||||
setprop("FMGC/internal/alt-airport", "");
|
||||
setprop("FMGC/internal/tofrom-set", 0);
|
||||
setprop("FMGC/internal/cost-index", "0");
|
||||
setprop("FMGC/internal/cost-index-set", 0);
|
||||
setprop("FMGC/internal/cruise-ft", 10000);
|
||||
setprop("FMGC/internal/cruise-fl", 100);
|
||||
setprop("FMGC/internal/cruise-lvl-set", 0);
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
setprop("FMGC/internal/cruise-temp", -999);
|
||||
|
||||
# IRSINIT
|
||||
setprop("FMGC/internal/align-set", 0);
|
||||
|
||||
# ROUTE SELECTION
|
||||
setprop("FMGC/internal/alt-selected", 0);
|
||||
|
||||
# INT-B
|
||||
setprop("FMGC/internal/zfw", 0);
|
||||
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-set", 0);
|
||||
setprop("FMGC/internal/taxi-fuel", 0.4);
|
||||
setprop("FMGC/internal/trip-fuel", 0);
|
||||
setprop("FMGC/internal/trip-time", "0000");
|
||||
setprop("FMGC/internal/rte-rsv", 0);
|
||||
setprop("FMGC/internal/rte-percent", 5.0);
|
||||
setprop("FMGC/internal/alt-fuel", 0);
|
||||
setprop("FMGC/internal/alt-time", "0000");
|
||||
setprop("FMGC/internal/final-fuel", 0);
|
||||
setprop("FMGC/internal/final-time", "0000");
|
||||
setprop("FMGC/internal/min-dest-fob", 0);
|
||||
setprop("FMGC/internal/tow", 0);
|
||||
setprop("FMGC/internal/lw", 0);
|
||||
setprop("FMGC/internal/trip-wind", "HD000");
|
||||
setprop("FMGC/internal/extra-fuel", 0);
|
||||
setprop("FMGC/internal/extra-time", "0000");
|
||||
|
||||
# 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
|
||||
setprop("FMGC/internal/vs1g", 0);
|
||||
|
||||
#PERF TO
|
||||
setprop("FMGC/internal/v1", 0);
|
||||
setprop("FMGC/internal/v1-set", 0);
|
||||
setprop("FMGC/internal/vr", 0);
|
||||
setprop("FMGC/internal/vr-set", 0);
|
||||
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);
|
||||
setprop("FMGC/internal/to-ths", "0.0");
|
||||
setprop("FMGC/internal/flap-ths-set", 0);
|
||||
setprop("FMGC/internal/flex", 0);
|
||||
setprop("FMGC/internal/flex-set", 0);
|
||||
setprop("FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
setprop("FMGC/internal/trans-alt", 18000);
|
||||
|
||||
# CLB PERF
|
||||
|
||||
# CRZ PERF
|
||||
|
||||
# DES PERF
|
||||
|
||||
# APPR PERF
|
||||
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);
|
||||
|
||||
# GA PERF
|
||||
}
|
||||
|
||||
var setMode = func(will) {
|
||||
|
|
|
@ -25,7 +25,7 @@ var perfAPPRInput = func(key, i) {
|
|||
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)) {
|
||||
} else if (num(scratchpad) != nil and (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", "");
|
||||
|
@ -37,7 +37,7 @@ var perfAPPRInput = func(key, i) {
|
|||
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 (num(scratchpad) != nil and scratchpad >= -100 and scratchpad < 100) {
|
||||
setprop("FMGC/internal/dest-temp", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
|
@ -52,13 +52,19 @@ var perfAPPRInput = func(key, i) {
|
|||
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();
|
||||
var mag = int(weather[0]);
|
||||
var mags = size(weather[0]);
|
||||
var wind = int(weather[1]);
|
||||
var winds = size(weather[1]);
|
||||
if (mags >= 1 and mags <= 3 and winds >= 1 and winds <= 3) {
|
||||
if (mag != nil and wind != nil and mag >= 1 and mag <= 360 and wind >= 0 and wind <= 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);
|
||||
}
|
||||
|
@ -70,7 +76,7 @@ var perfAPPRInput = func(key, i) {
|
|||
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 (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 50000) {
|
||||
setprop("FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
|
@ -88,7 +94,7 @@ var perfAPPRInput = func(key, i) {
|
|||
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 (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 200) {
|
||||
setprop("FMGC/internal/vapp-speed", scratchpad);
|
||||
setprop("FMGC/internal/vapp-speed-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -14,9 +14,7 @@ var perfCLBInput = func(key, i) {
|
|||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -14,9 +14,7 @@ var perfCRZInput = func(key, i) {
|
|||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -14,9 +14,7 @@ var perfDESInput = func(key, i) {
|
|||
var ci = int(scratchpad);
|
||||
var cis = size(scratchpad);
|
||||
if (cis >= 1 and cis <= 3) {
|
||||
if (ci == nil) {
|
||||
notAllowed(i);
|
||||
} else if (ci >= 0 and ci <= 999) {
|
||||
if (ci != nil and ci >= 0 and ci <= 999) {
|
||||
setprop("FMGC/internal/cost-index", ci);
|
||||
setprop("FMGC/internal/cost-index-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -17,7 +17,7 @@ var perfGAInput = func(key, i) {
|
|||
var thracc = split("/", scratchpad);
|
||||
var thrred = size(thracc[0]);
|
||||
var acc = size(thracc[1]);
|
||||
if ((thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
setprop("systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("FMGC/internal/reduc-agl-ft", thracc[1]);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
|
@ -39,7 +39,7 @@ var perfGAInput = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 5) {
|
||||
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
|
||||
setprop("FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
|
@ -14,7 +14,7 @@ var perfTOInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("FMGC/internal/v1", scratchpad);
|
||||
setprop("FMGC/internal/v1-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -34,7 +34,7 @@ var perfTOInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("FMGC/internal/vr", scratchpad);
|
||||
setprop("FMGC/internal/vr-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -55,7 +55,7 @@ var perfTOInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (scratchpad >= 100 and scratchpad <= 200) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 200) {
|
||||
setprop("FMGC/internal/v2", scratchpad);
|
||||
setprop("FMGC/internal/v2-set", 1);
|
||||
setprop("it-autoflight/settings/togaspd", scratchpad);
|
||||
|
@ -74,7 +74,7 @@ var perfTOInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 4 or tfs == 5) {
|
||||
if (scratchpad >= 1000 and scratchpad <= 18000) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 1000 and scratchpad <= 18000) {
|
||||
setprop("FMGC/internal/trans-alt", scratchpad);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
|
@ -97,7 +97,7 @@ var perfTOInput = func(key, i) {
|
|||
var thracc = split("/", scratchpad);
|
||||
var thrred = size(thracc[0]);
|
||||
var acc = size(thracc[1]);
|
||||
if ((thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
if (int(thrred) != nil and int(acc) != nil and (thrred >= 3 and thrred <= 5) and (acc >= 3 and acc <= 5)) {
|
||||
setprop("systems/thrust/clbreduc-ft", thracc[0]);
|
||||
setprop("FMGC/internal/reduc-agl-ft", thracc[1]);
|
||||
setprop("MCDUC/thracc-set", 1);
|
||||
|
@ -118,18 +118,32 @@ var perfTOInput = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 7 and find("/", scratchpad) != -1) {
|
||||
if (tfs == 7 and find("/UP", scratchpad) != -1) {
|
||||
var flapths = split("/UP", scratchpad);
|
||||
if ((flapths[0] >= 1 and flapths[0] <= 4) and (flapths[1] >= 0.0 and flapths[1] <= 2.5)) {
|
||||
setprop("FMGC/internal/to-flap", flapths[0]);
|
||||
setprop("FMGC/internal/to-ths", flapths[1]);
|
||||
var flap = int(flapths[0]);
|
||||
var trim = num(flapths[1]);
|
||||
if (flap != nil and trim != nil and (flap >= 1 and flap <= 4) and (trim >= 0.0 and trim <= 2.5)) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", trim);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs == 7 and find("/DN", scratchpad) != -1) {
|
||||
var flapths = split("/DN", scratchpad);
|
||||
var flap = int(flapths[0]);
|
||||
var trim = num(flapths[1]);
|
||||
if (flap != nil and trim != nil and (flap >= 1 and flap <= 4) and (trim > 0 and trim <= 2.5)) {
|
||||
setprop("FMGC/internal/to-flap", flap);
|
||||
setprop("FMGC/internal/to-ths", -1 * trim);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
} else if (tfs == 1) {
|
||||
if (scratchpad >= 1 and scratchpad <= 4) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 1 and scratchpad <= 4) {
|
||||
setprop("FMGC/internal/to-flap", scratchpad);
|
||||
setprop("FMGC/internal/flap-ths-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
@ -149,7 +163,7 @@ var perfTOInput = func(key, i) {
|
|||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 1 or tfs == 2) {
|
||||
if (scratchpad >= 0 and scratchpad <= 70) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 0 and scratchpad <= 70) {
|
||||
setprop("FMGC/internal/flex", scratchpad);
|
||||
setprop("FMGC/internal/flex-set", 1);
|
||||
var flex_calc = getprop("FMGC/internal/flex") - getprop("environment/temperature-degc");
|
||||
|
@ -170,7 +184,7 @@ var perfTOInput = func(key, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs >= 3 and tfs <= 5) {
|
||||
if (int(scratchpad) != nil and tfs >= 3 and tfs <= 5) {
|
||||
setprop("FMGC/internal/eng-out-reduc", scratchpad);
|
||||
setprop("MCDUC/reducacc-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
|
|
Loading…
Add table
Reference in a new issue