Improve INIT A validation of tropopause and GND TEMP
This commit is contained in:
parent
3e1184a4df
commit
4b02640e88
1 changed files with 52 additions and 14 deletions
|
@ -310,27 +310,65 @@ var initInputA = func(key, i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
|
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
|
||||||
} else if (key == "R5") {
|
} else if (key == "R5") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
|
if (fmgc.FMGCInternal.tropoSet) {
|
||||||
fmgc.FMGCInternal.tropo = 36090;
|
fmgc.FMGCInternal.tropo = 36090;
|
||||||
fmgc.FMGCInternal.tropoSet = 0;
|
fmgc.FMGCInternal.tropoSet = 0;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else {
|
} else {
|
||||||
var tropo = size(scratchpad);
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
if (tropo == 5 and scratchpad <= 99990) {
|
}
|
||||||
fmgc.FMGCInternal.tropo = scratchpad;
|
} else {
|
||||||
|
if (num(scratchpad) == nil) {
|
||||||
|
if (find("FL", scratchpad) != -1) {
|
||||||
|
var tropos = size(split("FL", scratchpad)[1]);
|
||||||
|
var tropon = num(split("FL", scratchpad)[1]);
|
||||||
|
if (tropon != nil) {
|
||||||
|
if ((tropos == 2 or tropos == 3) and tropon >= 10 and tropon <= 999) {
|
||||||
|
fmgc.FMGCInternal.tropo = tropon * 100;
|
||||||
fmgc.FMGCInternal.tropoSet = 1;
|
fmgc.FMGCInternal.tropoSet = 1;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
|
} else {
|
||||||
|
mcdu_message(i, "ENTRY OUT OF RANGE");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var tropos = size(scratchpad);
|
||||||
|
var tropon = num(scratchpad);
|
||||||
|
if ((tropos == 4 or tropos == 5) and tropon >= 1000 and tropon <= 99990) {
|
||||||
|
fmgc.FMGCInternal.tropo = math.round(tropon, 10);
|
||||||
|
fmgc.FMGCInternal.tropoSet = 1;
|
||||||
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
|
} else if ((tropos == 2 or tropos == 3) and tropon >= 10 and tropon <= 999) {
|
||||||
|
fmgc.FMGCInternal.tropo = num(scratchpad) * 100;
|
||||||
|
fmgc.FMGCInternal.tropoSet = 1;
|
||||||
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
|
} else {
|
||||||
|
mcdu_message(i, "ENTRY OUT OF RANGE");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (key == "R6") {
|
} else if (key == "R6") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
|
if (fmgc.FMGCInternal.gndTempSet) {
|
||||||
fmgc.FMGCInternal.gndTempSet = 0;
|
fmgc.FMGCInternal.gndTempSet = 0;
|
||||||
|
fmgc.FMGCInternal.gndTemp = 15;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
} else if (int(scratchpad) != nil and fmgc.FMGCInternal.phase == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
} else {
|
||||||
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
|
}
|
||||||
|
} else if (isnum(scratchpad) and fmgc.FMGCInternal.phase == 0) {
|
||||||
|
if (size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||||
fmgc.FMGCInternal.gndTemp = scratchpad;
|
fmgc.FMGCInternal.gndTemp = scratchpad;
|
||||||
fmgc.FMGCInternal.gndTempSet = 1;
|
fmgc.FMGCInternal.gndTempSet = 1;
|
||||||
mcdu_scratchpad.scratchpads[i].empty();
|
mcdu_scratchpad.scratchpads[i].empty();
|
||||||
|
} else {
|
||||||
|
mcdu_message(i, "ENTRY OUT OF RANGE");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mcdu_message(i, "NOT ALLOWED");
|
mcdu_message(i, "NOT ALLOWED");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue