PERFTO params not modifiable after prefligh
This commit is contained in:
parent
d39f6c89bd
commit
3036056696
2 changed files with 66 additions and 73 deletions
|
@ -3741,7 +3741,8 @@ var canvas_MCDU_base = {
|
|||
if (page != "PROGDONE") {
|
||||
me["Simple_R1"].setText("FL398 ");
|
||||
} else {
|
||||
me["Simple_R1"].setText("----- ");
|
||||
me["Simple_L1"].setText("-----");
|
||||
me["Simple_R1"].setText("----- ");
|
||||
me["Simple_L1"].setColor(AMBER);
|
||||
me["Simple_C1"].setColor(WHITE);
|
||||
me["Simple_R1"].setColor(WHITE);
|
||||
|
|
|
@ -19,91 +19,81 @@ var perfTOCheckVSpeeds = func(i) {
|
|||
}
|
||||
}
|
||||
|
||||
var perfTOInput = func(key, i) {
|
||||
var perfTOInput = func(key, i) {
|
||||
var modifiable = (fmgc.FMGCInternal.phase == 0) ? true : false;
|
||||
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
|
||||
if (key == "L1") {
|
||||
if (fmgc.FMGCInternal.phase != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.v1 = 0;
|
||||
fmgc.FMGCInternal.v1set = 0;
|
||||
fmgc.FMGCNodes.v1.setValue(0);
|
||||
fmgc.FMGCNodes.v1set.setValue(0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.v1 = scratchpad;
|
||||
fmgc.FMGCInternal.v1set = 1;
|
||||
|
||||
# for sounds:
|
||||
fmgc.FMGCNodes.v1.setValue(scratchpad);
|
||||
fmgc.FMGCNodes.v1set.setValue(1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
if (key == "L1" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.v1 = 0;
|
||||
fmgc.FMGCInternal.v1set = 0;
|
||||
fmgc.FMGCNodes.v1.setValue(0);
|
||||
fmgc.FMGCNodes.v1set.setValue(0);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.v1 = scratchpad;
|
||||
fmgc.FMGCInternal.v1set = 1;
|
||||
|
||||
# for sounds:
|
||||
fmgc.FMGCNodes.v1.setValue(scratchpad);
|
||||
fmgc.FMGCNodes.v1set.setValue(1);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L2") {
|
||||
if (fmgc.FMGCInternal.phase != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.vr = 0;
|
||||
fmgc.FMGCInternal.vrset = 0;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.vr = scratchpad;
|
||||
fmgc.FMGCInternal.vrset = 1;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (key == "L2" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.vr = 0;
|
||||
fmgc.FMGCInternal.vrset = 0;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.vr = scratchpad;
|
||||
fmgc.FMGCInternal.vrset = 1;
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L3") {
|
||||
if (fmgc.FMGCInternal.phase != 1) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.v2 = 0;
|
||||
fmgc.FMGCInternal.v2set = 0;
|
||||
setprop("/it-autoflight/settings/togaspd", 157);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.v2 = scratchpad;
|
||||
fmgc.FMGCInternal.v2set = 1;
|
||||
fmgc.updatePitchArm2();
|
||||
setprop("/it-autoflight/settings/togaspd", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else if (key == "L3" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
fmgc.FMGCInternal.v2 = 0;
|
||||
fmgc.FMGCInternal.v2set = 0;
|
||||
setprop("/it-autoflight/settings/togaspd", 157);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
} else {
|
||||
var tfs = size(scratchpad);
|
||||
if (tfs == 3) {
|
||||
if (int(scratchpad) != nil and scratchpad >= 100 and scratchpad <= 350) {
|
||||
fmgc.FMGCInternal.v2 = scratchpad;
|
||||
fmgc.FMGCInternal.v2set = 1;
|
||||
fmgc.updatePitchArm2();
|
||||
setprop("/it-autoflight/settings/togaspd", scratchpad);
|
||||
mcdu_scratchpad.scratchpads[i].empty();
|
||||
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
perfTOCheckVSpeeds(i); # do V-speeds validation
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
} else if (key == "L4") {
|
||||
if (scratchpad == "CLR") {
|
||||
|
@ -120,7 +110,7 @@ var perfTOInput = func(key, i) {
|
|||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "L5") {
|
||||
} else if (key == "L5" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/systems/thrust/clbreduc-ft", 1500);
|
||||
setprop("/FMGC/internal/accel-agl-ft", 1500);
|
||||
|
@ -160,7 +150,7 @@ var perfTOInput = func(key, i) {
|
|||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R3") {
|
||||
} else if (key == "R3" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/to-flap", 0);
|
||||
setprop("/FMGC/internal/to-ths", "0.0");
|
||||
|
@ -230,7 +220,7 @@ var perfTOInput = func(key, i) {
|
|||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R4") {
|
||||
} else if (key == "R4" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/flex", 0);
|
||||
setprop("/FMGC/internal/flex-set", 0);
|
||||
|
@ -251,7 +241,7 @@ var perfTOInput = func(key, i) {
|
|||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
} else if (key == "R5") {
|
||||
} else if (key == "R5" and modifiable) {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("/FMGC/internal/eng-out-reduc", "1500");
|
||||
setprop("MCDUC/reducacc-set", 0);
|
||||
|
@ -268,5 +258,7 @@ var perfTOInput = func(key, i) {
|
|||
}
|
||||
} else if (key == "R6") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PERFCLB");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(i, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue