A3XX: Fix TO memo showing up before 2mins, showing up after landing
This commit is contained in:
parent
220828980b
commit
ed1cf4323d
3 changed files with 27 additions and 67 deletions
|
@ -12,34 +12,17 @@ setprop("/ECAM/Lower/page", "fctl");
|
|||
|
||||
var ECAM = {
|
||||
init: func() {
|
||||
setprop("/ECAM/phase-1-inhibit", 0);
|
||||
setprop("/ECAM/phase-2-inhibit", 0);
|
||||
setprop("/ECAM/phase-3-inhibit", 0);
|
||||
setprop("/ECAM/phase-4-inhibit", 0);
|
||||
setprop("/ECAM/phase-5-inhibit", 0);
|
||||
setprop("/ECAM/phase-6-inhibit", 0);
|
||||
setprop("/ECAM/phase-7-inhibit", 0);
|
||||
setprop("/ECAM/phase-8-inhibit", 0);
|
||||
setprop("/ECAM/phase-9-inhibit", 0);
|
||||
setprop("/ECAM/phase-10-inhibit", 0);
|
||||
setprop("/ECAM/engine-start-time", 0);
|
||||
setprop("/ECAM/engine-start-time-switch", 0);
|
||||
setprop("/ECAM/to-memo-enable", 1);
|
||||
var stateL = getprop("/engines/engine[0]/state");
|
||||
var stateR = getprop("/engines/engine[1]/state");
|
||||
var thrustL = getprop("/systems/thrust/state1");
|
||||
var thrustR = getprop("/systems/thrust/state2");
|
||||
var elec = getprop("/systems/electrical/on");
|
||||
var speed = getprop("/velocities/airspeed-kt");
|
||||
var wowL = getprop("/gear/gear[1]/wow");
|
||||
var wow = getprop("/gear/gear[0]/wow");
|
||||
var altitude = getprop("/position/gear-agl-ft");
|
||||
var phase1inhibit = getprop("/ECAM/phase-1-inhibit");
|
||||
var phase2inhibit = getprop("/ECAM/phase-2-inhibit");
|
||||
var phase3inhibit = getprop("/ECAM/phase-3-inhibit");
|
||||
var phase4inhibit = getprop("/ECAM/phase-4-inhibit");
|
||||
var phase5inhibit = getprop("/ECAM/phase-5-inhibit");
|
||||
var phase6inhibit = getprop("/ECAM/phase-6-inhibit");
|
||||
var phase7inhibit = getprop("/ECAM/phase-7-inhibit");
|
||||
var phase8inhibit = getprop("/ECAM/phase-8-inhibit");
|
||||
var phase9inhibit = getprop("/ECAM/phase-9-inhibit");
|
||||
var phase10inhibit = getprop("/ECAM/phase-10-inhibit");
|
||||
},
|
||||
MSGclr: func() {
|
||||
setprop("/ECAM/ecam-checklist-active", 0);
|
||||
|
@ -61,62 +44,37 @@ var ECAM = {
|
|||
setprop("/ECAM/msg/line7c", "w");
|
||||
setprop("/ECAM/msg/line8c", "w");
|
||||
},
|
||||
loop: func() {
|
||||
loop: func() {
|
||||
stateL = getprop("/engines/engine[0]/state");
|
||||
stateR = getprop("/engines/engine[1]/state");
|
||||
thrustL = getprop("/systems/thrust/state1");
|
||||
thrustR = getprop("/systems/thrust/state2");
|
||||
elec = getprop("/systems/electrical/on");
|
||||
speed = getprop("/velocities/airspeed-kt");
|
||||
wowL = getprop("/gear/gear[1]/wow");
|
||||
altitude = getprop("/position/gear-agl-ft");
|
||||
phase1inhibit = getprop("/ECAM/phase-1-inhibit");
|
||||
phase2inhibit = getprop("/ECAM/phase-2-inhibit");
|
||||
phase3inhibit = getprop("/ECAM/phase-3-inhibit");
|
||||
phase4inhibit = getprop("/ECAM/phase-4-inhibit");
|
||||
phase5inhibit = getprop("/ECAM/phase-5-inhibit");
|
||||
phase6inhibit = getprop("/ECAM/phase-6-inhibit");
|
||||
phase7inhibit = getprop("/ECAM/phase-7-inhibit");
|
||||
phase8inhibit = getprop("/ECAM/phase-8-inhibit");
|
||||
phase9inhibit = getprop("/ECAM/phase-9-inhibit");
|
||||
phase10inhibit = getprop("/ECAM/phase-10-inhibit");
|
||||
wow = getprop("/gear/gear[1]/wow");
|
||||
|
||||
if (getprop("/FMGC/status/phase") == 0 and getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) {
|
||||
if (stateL == 3 and stateR == 3 and wow == 1) {
|
||||
if (getprop("/ECAM/engine-start-time-switch") != 1) {
|
||||
setprop("/ECAM/engine-start-time", getprop("/sim/time/elapsed-sec"));
|
||||
setprop("/ECAM/engine-start-time-switch", 1);
|
||||
}
|
||||
} else if (wow == 1) {
|
||||
if (getprop("/ECAM/engine-start-time-switch") != 0) {
|
||||
setprop("/ECAM/engine-start-time-switch", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (wow == 0) {
|
||||
setprop("/ECAM/to-memo-enable", 0);
|
||||
} else if ((stateL != 3 or stateR != 3) and wow == 1) {
|
||||
setprop("/ECAM/to-memo-enable", 1);
|
||||
}
|
||||
|
||||
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) {
|
||||
setprop("/ECAM/left-msg", "TO-MEMO");
|
||||
} else {
|
||||
setprop("/ECAM/left-msg", "NONE");
|
||||
}
|
||||
|
||||
if (elec == 1 and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-1-inhibit", 1);
|
||||
} else if (stateL == 3 or stateR == 3 and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-1-inhibit", 0);
|
||||
setprop("/ECAM/phase-2-inhibit", 1);
|
||||
} else if (thrustL == "FLX" or thrustL == "TOGA" or thrustR == "FLX" or thrustR == "TOGA" and speed < 80 and !phase1inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-2-inhibit", 0);
|
||||
setprop("/ECAM/phase-3-inhibit", 1);
|
||||
} else if (thrustL == "FLX" or thrustL == "TOGA" or thrustR == "FLX" or thrustR == "TOGA" and speed > 80 and wowL and !phase1inhibit and !phase2inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-3-inhibit", 0);
|
||||
setprop("/ECAM/phase-4-inhibit", 1);
|
||||
} else if (speed > 80 and !wowL and altitude < 1501 and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-4-inhibit", 0);
|
||||
setprop("/ECAM/phase-5-inhibit", 1);
|
||||
} else if (speed > 80 and !wowL and altitude > 1501 and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-5-inhibit", 0);
|
||||
setprop("/ECAM/phase-6-inhibit", 1);
|
||||
} else if (speed > 80 and !wowL and altitude < 801 and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase7inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-6-inhibit", 0);
|
||||
setprop("/ECAM/phase-7-inhibit", 1);
|
||||
} else if (speed > 80 and wowL and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase8inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-7-inhibit", 0);
|
||||
setprop("/ECAM/phase-8-inhibit", 1);
|
||||
} else if (speed < 80 and wowL and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase9inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-8-inhibit", 0);
|
||||
setprop("/ECAM/phase-9-inhibit", 1);
|
||||
} else if (stateL == 0 and stateR == 0 and !phase1inhibit and !phase2inhibit and !phase3inhibit and !phase4inhibit and !phase5inhibit and !phase6inhibit and !phase7inhibit and !phase8inhibit and !phase10inhibit) {
|
||||
setprop("/ECAM/phase-9-inhibit", 0);
|
||||
setprop("/ECAM/phase-10-inhibit", 1);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ var variousReset = func {
|
|||
setprop("/modes/fcu/hdg-time", 0);
|
||||
setprop("/controls/switching/ATTHDG", 0);
|
||||
setprop("/controls/switching/AIRDATA", 0);
|
||||
setprop("/controls/switches/no-smoking-sign", 1);
|
||||
setprop("/controls/switches/seatbelt-sign", 1);
|
||||
}
|
||||
|
||||
setlistener("/sim/signals/fdm-initialized", func {
|
||||
|
|
|
@ -1 +1 @@
|
|||
4206
|
||||
4207
|
Reference in a new issue