1
0
Fork 0

Clean-up INITA, fix formatting for entries

This commit is contained in:
Matthew Maring 2020-04-14 16:31:32 -04:00 committed by Jonathan Redpath
parent bfe20940da
commit 19bd42adc3
3 changed files with 64 additions and 21 deletions

View file

@ -96,13 +96,15 @@ 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 alt_airport = props.globals.getNode("FMGC/internal/alt-airport", 1);
var altSet = props.globals.getNode("FMGC/internal/alt-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 cruiseTempSet = props.globals.getNode("FMGC/internal/cruise-temp-set", 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);
@ -1125,10 +1127,16 @@ 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 and cruiseTemp.getValue() != -999) {
} else if (cruiseSet.getValue() == 1 and cruiseTempSet.getValue() == 1) {
me["INITA_CruiseFLTemp"].hide();
me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
me["Simple_L6"].setText(sprintf("%s", "FL" ~ cruiseFL.getValue()) ~ sprintf("/%sg", cruiseTemp.getValue()));
} else if (cruiseSet.getValue() == 1) {
me["INITA_CruiseFLTemp"].hide();
me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
setprop("FMGC/internal/cruise-temp", 15 - (2 * cruiseFL.getValue() / 10));
setprop("FMGC/internal/cruise-temp-set", 1);
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);
@ -1139,10 +1147,10 @@ var canvas_MCDU_base = {
me["INITA_FromTo"].hide();
me["Simple_L1"].show();
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
if (alt_airport.getValue() == "") {
me["Simple_L2"].setText("NONE");
} else {
if (altSet.getValue() == 1) {
me["Simple_L2"].setText(alt_airport.getValue());
} else {
me["Simple_L2"].setText("NONE");
}
me.showRight(1, -1, 0, 0, 0, 0);
me["Simple_R2S"].hide();

View file

@ -8,19 +8,21 @@ var initInputA = func(key, i) {
if (key == "L2") {
if (scratchpad == "CLR") {
setprop("FMGC/internal/alt-airport", "");
setprop("FMGC/internal/alt-set", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
fmgc.updateARPT();
} else if (scratchpad == "") {
setprop("FMGC/internal/alt-selected", 1);
#} 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("FMGC/internal/alt-set", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
fmgc.updateARPT();
setprop("FMGC/internal/alt-selected", 1);
#setprop("FMGC/internal/alt-selected", 1);
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
notAllowed(i);
@ -70,23 +72,37 @@ var initInputA = func(key, i) {
setprop("FMGC/internal/cruise-ft", 10000);
setprop("FMGC/internal/cruise-fl", 100);
setprop("FMGC/internal/cruise-lvl-set", 0);
setprop("FMGC/internal/cruise-temp", 15);
setprop("FMGC/internal/cruise-temp-set", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else if (find("/", scratchpad) != -1) {
var crztemp = split("/", scratchpad);
var crz = int(crztemp[0]);
var crzs = size(crztemp[0]);
var temp = num(crztemp[1]);
if (find("FL", crztemp[0]) != -1) {
var crz = int(substr(crztemp[0], 2));
var crzs = size(substr(crztemp[0], 2));
} else {
var crz = int(crztemp[0]);
var crzs = size(crztemp[0]);
}
var temp = int(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) {
print(crzs);
if (crzs == 0 and temps >= 1 and temps <= 3 and temp != nil and getprop("FMGC/internal/cruise-lvl-set")) {
if (temp >= -99 and temp <= 99) {
setprop("FMGC/internal/cruise-temp", temp);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else {
notAllowed(i);
} else if (crz > 0 and crz <= 430 and temp >= -100 and temp < 100) {
}
} else if (crzs >= 1 and crzs <= 3 and crz != nil and temps >= 1 and temps <= 3 and temp != nil) {
if (crz > 0 and crz <= 390 and temp >= -99 and temp <= 99) {
setprop("FMGC/internal/cruise-ft", crz * 100);
setprop("FMGC/internal/cruise-fl", crz);
setprop("FMGC/internal/cruise-fl-prog", crz);
setprop("FMGC/internal/cruise-lvl-set", 1);
setprop("FMGC/internal/cruise-temp", temp);
setprop("FMGC/internal/cruise-temp-set", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else {
notAllowed(i);
@ -95,19 +111,37 @@ var initInputA = func(key, i) {
notAllowed(i);
}
} else {
notAllowed(i);
if (find("FL", scratchpad) != -1) {
var crz = int(substr(scratchpad, 2));
var crzs = size(substr(scratchpad, 2));
} else {
var crz = int(scratchpad);
var crzs = size(scratchpad);
}
if (crzs >= 1 and crzs <= 3 and crz != nil) {
if (crz > 0 and crz <= 390) {
setprop("FMGC/internal/cruise-ft", crz * 100);
setprop("FMGC/internal/cruise-fl", crz);
setprop("FMGC/internal/cruise-fl-prog", crz);
setprop("FMGC/internal/cruise-lvl-set", 1);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else {
notAllowed(i);
}
} else {
notAllowed(i);
}
}
} else if (key == "R1") {
if (scratchpad == "CLR") {
clearFPLNComputer();
setprop("FMGC/internal/dep-arpt", "");
setprop("FMGC/internal/arr-arpt", "");
setprop("FMGC/internal/tofrom-set", 0);
fmgc.flightPlanController.reset();
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
} else if (scratchpad == "") {
setprop("FMGC/internal/alt-selected", 0);
#} else if (scratchpad == "") {
#setprop("FMGC/internal/alt-selected", 0);
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {
var tfs = size(scratchpad);

View file

@ -57,7 +57,7 @@ var MCDU_reset = func(i) {
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/alt-set", 0);
setprop("FMGC/internal/cost-index", "0");
setprop("FMGC/internal/cost-index-set", 0);
setprop("FMGC/internal/cruise-ft", 10000);
@ -65,7 +65,8 @@ var MCDU_reset = func(i) {
setprop("FMGC/internal/cruise-lvl-set", 0);
setprop("FMGC/internal/tropo", 36090);
setprop("FMGC/internal/tropo-set", 0);
setprop("FMGC/internal/cruise-temp", -999);
setprop("FMGC/internal/cruise-temp", 15);
setprop("FMGC/internal/cruise-temp-set", 0);
# IRSINIT
setprop("FMGC/internal/align-set", 0);