Moved block of checks inside the if clause for not called on man or fault page for perf reasons
Signed-off-by: merspieler <merspieler@airmail.cc>
This commit is contained in:
parent
bb1fa47049
commit
22e3a65815
1 changed files with 59 additions and 59 deletions
118
Nasal/ECAM.nas
118
Nasal/ECAM.nas
|
@ -350,70 +350,70 @@ var LowerECAM = {
|
|||
fault_sel = getprop("/ECAM/Lower/fault-select");
|
||||
fault_page = getprop("/ECAM/Lower/fault-page");
|
||||
page = getprop("/ECAM/Lower/page");
|
||||
aileron = getprop("/fdm/jsbsim/fbw/aileron-sidestick");
|
||||
elevator = getprop("/fdm/jsbsim/fbw/elevator-sidestick");
|
||||
APUMaster = getprop("/controls/APU/master");
|
||||
APURPM = getprop("/systems/apu/rpm");
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
engModeSel = getprop("/controls/engines/engine-start-switch");
|
||||
elapsedSec = getprop("/sim/time/elapsed-sec");
|
||||
|
||||
if (warnPhase == 2) {
|
||||
if (abs(aileron) > 0.3 or abs(elevator) > 0.3) {
|
||||
fctlTime = elapsedSec;
|
||||
fctlCounting = 1;
|
||||
} else if (fctlCounting) {
|
||||
if (fctlTime + 20 < elapsedSec) {
|
||||
fctlCounting = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fctlCounting = 0;
|
||||
}
|
||||
|
||||
if (APURPM > 95) {
|
||||
if (APUTime + 10 < elapsedSec) {
|
||||
APUCounting = 0;
|
||||
}
|
||||
} else {
|
||||
if (APUMaster) {
|
||||
APUTime = elapsedSec;
|
||||
APUCounting = 1;
|
||||
} else {
|
||||
APUCounting = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((APURPM <= 95 or APUCounting) and APUMaster) {
|
||||
showAPUPage = 1;
|
||||
} else {
|
||||
showAPUPage = 0;
|
||||
}
|
||||
|
||||
if (stateL == 3 or stateR == 3) {
|
||||
if (ENGCounting and ENGTime + 10 < elapsedSec) {
|
||||
ENGCounting = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (((stateL > 0 and stateL != 3) or (stateR > 0 and stateR != 3)) and engModeSel == 2) {
|
||||
ENGTime = elapsedSec;
|
||||
ENGCounting = 1;
|
||||
} else if ((stateL == 0 and stateR == 0) or engModeSel == 1) {
|
||||
ENGCounting = 0;
|
||||
}
|
||||
|
||||
if (ENGCounting or engModeSel == 0) {
|
||||
showENGPage = 1;
|
||||
} else {
|
||||
showENGPage = 0;
|
||||
}
|
||||
|
||||
if (!man_sel) {
|
||||
if (!fault_sel) {
|
||||
warnPhase = getprop("/ECAM/warning-phase");
|
||||
aileron = getprop("/fdm/jsbsim/fbw/aileron-sidestick");
|
||||
elevator = getprop("/fdm/jsbsim/fbw/elevator-sidestick");
|
||||
APUMaster = getprop("/controls/APU/master");
|
||||
APURPM = getprop("/systems/apu/rpm");
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
engModeSel = getprop("/controls/engines/engine-start-switch");
|
||||
elapsedSec = getprop("/sim/time/elapsed-sec");
|
||||
|
||||
if (warnPhase == 2) {
|
||||
if (abs(aileron) > 0.3 or abs(elevator) > 0.3) {
|
||||
fctlTime = elapsedSec;
|
||||
fctlCounting = 1;
|
||||
} else if (fctlCounting) {
|
||||
if (fctlTime + 20 < elapsedSec) {
|
||||
fctlCounting = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fctlCounting = 0;
|
||||
}
|
||||
|
||||
if (APURPM > 95) {
|
||||
if (APUTime + 10 < elapsedSec) {
|
||||
APUCounting = 0;
|
||||
}
|
||||
} else {
|
||||
if (APUMaster) {
|
||||
APUTime = elapsedSec;
|
||||
APUCounting = 1;
|
||||
} else {
|
||||
APUCounting = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((APURPM <= 95 or APUCounting) and APUMaster) {
|
||||
showAPUPage = 1;
|
||||
} else {
|
||||
showAPUPage = 0;
|
||||
}
|
||||
|
||||
if (stateL == 3 or stateR == 3) {
|
||||
if (ENGCounting and ENGTime + 10 < elapsedSec) {
|
||||
ENGCounting = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (((stateL > 0 and stateL != 3) or (stateR > 0 and stateR != 3)) and engModeSel == 2) {
|
||||
ENGTime = elapsedSec;
|
||||
ENGCounting = 1;
|
||||
} else if ((stateL == 0 and stateR == 0) or engModeSel == 1) {
|
||||
ENGCounting = 0;
|
||||
}
|
||||
|
||||
if (ENGCounting or engModeSel == 0) {
|
||||
showENGPage = 1;
|
||||
} else {
|
||||
showENGPage = 0;
|
||||
}
|
||||
|
||||
if (warnPhase == 1 or warnPhase == 10) {
|
||||
if (showENGPage) {
|
||||
if (page != "eng") {
|
||||
|
|
Reference in a new issue