A3XX: Fix TO memo showing up before 2mins, showing up after landing

This commit is contained in:
Joshua Davidson 2017-12-30 10:27:24 -05:00
parent 220828980b
commit ed1cf4323d
3 changed files with 27 additions and 67 deletions

View file

@ -12,34 +12,17 @@ setprop("/ECAM/Lower/page", "fctl");
var ECAM = { var ECAM = {
init: func() { init: func() {
setprop("/ECAM/phase-1-inhibit", 0); setprop("/ECAM/engine-start-time", 0);
setprop("/ECAM/phase-2-inhibit", 0); setprop("/ECAM/engine-start-time-switch", 0);
setprop("/ECAM/phase-3-inhibit", 0); setprop("/ECAM/to-memo-enable", 1);
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);
var stateL = getprop("/engines/engine[0]/state"); var stateL = getprop("/engines/engine[0]/state");
var stateR = getprop("/engines/engine[1]/state"); var stateR = getprop("/engines/engine[1]/state");
var thrustL = getprop("/systems/thrust/state1"); var thrustL = getprop("/systems/thrust/state1");
var thrustR = getprop("/systems/thrust/state2"); var thrustR = getprop("/systems/thrust/state2");
var elec = getprop("/systems/electrical/on"); var elec = getprop("/systems/electrical/on");
var speed = getprop("/velocities/airspeed-kt"); 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 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() { MSGclr: func() {
setprop("/ECAM/ecam-checklist-active", 0); setprop("/ECAM/ecam-checklist-active", 0);
@ -68,55 +51,30 @@ var ECAM = {
thrustR = getprop("/systems/thrust/state2"); thrustR = getprop("/systems/thrust/state2");
elec = getprop("/systems/electrical/on"); elec = getprop("/systems/electrical/on");
speed = getprop("/velocities/airspeed-kt"); speed = getprop("/velocities/airspeed-kt");
wowL = getprop("/gear/gear[1]/wow"); wow = 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");
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"); setprop("/ECAM/left-msg", "TO-MEMO");
} else { } else {
setprop("/ECAM/left-msg", "NONE"); 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);
}
}, },
}; };

View file

@ -51,6 +51,8 @@ var variousReset = func {
setprop("/modes/fcu/hdg-time", 0); setprop("/modes/fcu/hdg-time", 0);
setprop("/controls/switching/ATTHDG", 0); setprop("/controls/switching/ATTHDG", 0);
setprop("/controls/switching/AIRDATA", 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 { setlistener("/sim/signals/fdm-initialized", func {

View file

@ -1 +1 @@
4206 4207