if (getprop("/position/gear-agl-ft") <= 2000 and (getprop("/FMGC/status/phase") == 3 or getprop("/FMGC/status/phase") == 4 or getprop("/FMGC/status/phase") == 5) and wow == 0) {
} else if (getprop("/FMGC/status/phase") == 0 and stateL == 3 and stateR == 3 and getprop("/ECAM/engine-start-time") + 120 < getprop("/sim/time/elapsed-sec") and getprop("/ECAM/to-memo-enable") == 1 and wow == 1) {
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/switches/no-smoking-sign") == 1 and getprop("/controls/switches/seatbelt-sign") == 1 and getprop("/controls/flight/speedbrake-arm") == 1 and getprop("/controls/flight/flap-pos") > 0
if (abs(getprop("/engines/engine[0]/epr-actual") - eprlim) <= 0.005 or abs(getprop("/engines/engine[0]/epr-actual") - eprlim) <= 0.005) {
toPowerSet = 1;
} else {
toPowerSet = 0;
}
} else {
n1lim = getprop("/controls/engines/n1-limit");
if (abs(getprop("/engines/engine[0]/n1-actual") - n1lim) <= 0.1 or abs(getprop("/engines/engine[0]/n1-actual") - n1lim) <= 0.1) {
toPowerSet = 1;
} else {
toPowerSet = 0;
}
}
# Warning Phases
if (getprop("/systems/electrical/bus/ac1") < 110 and getprop("/systems/electrical/bus/ac2") < 110 and getprop("/systems/electrical/bus/ac-ess") < 110) { # Reset warning phases
if (getprop("/ECAM/warning-phase") != 1) {
setprop("/ECAM/warning-phase", 1);
}
} else {
phase = getprop("/ECAM/warning-phase");
mode = getprop("/modes/pfd/fma/pitch-mode");
modeI = getprop("/it-autoflight/mode/vert");
if (phase == 1 and (stateL == 3 or stateR == 3)) {
setprop("/ECAM/warning-phase", 2);
} else if (phase == 2 and toPowerSet) {
setprop("/ECAM/warning-phase", 3);
} else if (phase == 3 and speed >= 80) {
setprop("/ECAM/warning-phase", 4);
} else if (phase == 4 and getprop("/fdm/jsbsim/position/wow") == 0) { # Liftoff
setprop("/ECAM/warning-phase", 5);
} else if (phase == 5 and getprop("/position/gear-agl-ft") >= 1500) {
setprop("/ECAM/warning-phase", 6);
} else if (phase == 6 and getprop("/position/gear-agl-ft") < 800) {
if (mode == "OP CLB" or mode == "CLB" or (modeI == "V/S" and getprop("/it-autoflight/input/vs") >= 100) or (modeI == "FPA" and getprop("/it-autoflight/input/fpa") >= 0.1)) {
# Do not do this if we are climbing, not in FCOM, but prevents terrain from causing early mode change. If this ends up using baro alt, not radio, then delete this if
} else {
setprop("/ECAM/warning-phase", 7);
}
} else if (phase == 7 and getprop("/fdm/jsbsim/position/wow") == 1) { # Touchdown
setprop("/ECAM/warning-phase", 8);
} else if (phase == 8 and speed < 80) {
setprop("/ECAM/warning-phase", 9);
} else if (phase == 9 and (stateL == 0 or stateR == 0)) {
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/switches/no-smoking-sign") == 1 and getprop("/controls/switches/seatbelt-sign") == 1 and getprop("/controls/flight/speedbrake-arm") == 1 and getprop("/controls/flight/flap-pos") > 0
var eng1_state = getprop("/engines/engine[0]/state");
var eng2_state = getprop("/engines/engine[1]/state");
var eng_mode = getprop("/controls/engines/engine-start-switch");
var flaps = getprop("/controls/flight/flap-lever");
var agl = getprop("/position/gear-agl-ft");
var phase = getprop("/FMGC/status/phase");
var gear0 = getprop("/gear/gear[0]/wow");
var n1_left = getprop("/engines/engine[0]/n1-actual");
var n1_right = getprop("/engines/engine[1]/n1-actual");
var state1 = getprop("/systems/thrust/state1");
var state2 = getprop("/systems/thrust/state2");
var flx = getprop("/systems/thrust/lim-flex");
var thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
var thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
var eng_out = 0;
if ((getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") != 3) or (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") == 3)) {
if (n1_left >= 70 and state1 == "TOGA" or (flx == 1 and state1 == "MCT" and eng_out == 0) or (flx == 1 and (state1 == "MAN THR" and thr1 >= 0.83 and eng_out == 0)) or n1_right >= 70 and state2 == "TOGA" or (flx == 1 and state2 == "MCT"
and eng_out == 0) or (flx == 1 and (state2 == "MAN THR" and thr2 >= 0.83 and eng_out == 0))) {
if (eng_mode == 0 or eng1_state == 1 or eng1_state == 2 or eng2_state == 1 or eng2_state == 2 or (to_thr == 1 and agl < 1500) or eng_to == 1 or eng_timer > 0) {
} else if (((getprop("/engines/engine[0]/n2-actual") >= 59 or getprop("/engines/engine[1]/n2-actual") >= 59) and getprop("/gear/gear[1]/wow") == 1) or (getprop("/instrumentation/altimeter/indicated-altitude-ft") <= 16000
and getprop("/controls/gear/gear-down") == 1 and getprop("/gear/gear[1]/wow") == 0)) {