2017-06-02 00:53:50 +00:00
# A3XX ECAM Messages
# Joshua Davidson (it0uchpods)
2017-11-16 19:29:08 +00:00
##############################################
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
2017-07-13 17:30:33 +00:00
2018-09-29 23:48:17 +00:00
var stateL = 0;
var stateR = 0;
var thrustL = 0;
var thrustR = 0;
var elec = 0;
var speed = 0;
var wow = 0;
var altitude = 0;
2017-12-30 04:44:41 +00:00
setprop("/ECAM/left-msg", "NONE");
2017-06-02 00:53:50 +00:00
setprop("/position/gear-agl-ft", 0);
2017-12-30 04:44:41 +00:00
setprop("/ECAM/Lower/page", "fctl");
# w = White, b = Blue, g = Green, a = Amber, r = Red
2017-08-14 15:29:00 +00:00
2017-12-30 04:44:41 +00:00
var ECAM = {
init: func() {
2017-12-30 15:27:24 +00:00
setprop("/ECAM/engine-start-time", 0);
setprop("/ECAM/engine-start-time-switch", 0);
setprop("/ECAM/to-memo-enable", 1);
2017-12-30 15:54:45 +00:00
setprop("/ECAM/to-config", 0);
2018-01-14 16:19:10 +00:00
setprop("/ECAM/ldg-memo-enable", 0);
2018-10-02 13:31:48 +00:00
setprop("/systems/gear/landing-gear-warning-light", 0);
2017-12-30 04:44:41 +00:00
},
MSGclr: func() {
setprop("/ECAM/ecam-checklist-active", 0);
setprop("/ECAM/left-msg", "NONE");
setprop("/ECAM/msg/line1", "");
2017-08-14 15:29:00 +00:00
setprop("/ECAM/msg/line2", "");
setprop("/ECAM/msg/line3", "");
setprop("/ECAM/msg/line4", "");
setprop("/ECAM/msg/line5", "");
setprop("/ECAM/msg/line6", "");
setprop("/ECAM/msg/line7", "");
setprop("/ECAM/msg/line8", "");
2017-12-30 04:44:41 +00:00
setprop("/ECAM/msg/line1c", "w");
setprop("/ECAM/msg/line2c", "w");
setprop("/ECAM/msg/line3c", "w");
setprop("/ECAM/msg/line4c", "w");
setprop("/ECAM/msg/line5c", "w");
setprop("/ECAM/msg/line6c", "w");
setprop("/ECAM/msg/line7c", "w");
setprop("/ECAM/msg/line8c", "w");
},
2017-12-30 15:27:24 +00:00
loop: func() {
2017-12-30 04:44:41 +00:00
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");
2018-01-14 16:19:10 +00:00
wow = getprop("/gear/gear[0]/wow");
2017-12-30 04:44:41 +00:00
2017-12-30 15:27:24 +00:00
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);
}
2018-01-14 16:19:10 +00:00
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) {
setprop("/ECAM/ldg-memo-enable", 1);
} else if (getprop("/ECAM/left-msg") == "LDG-MEMO" and getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") <= 80 and wow == 1) {
setprop("/ECAM/ldg-memo-enable", 0);
} else if (getprop("/ECAM/left-msg") != "LDG-MEMO") {
setprop("/ECAM/ldg-memo-enable", 0);
}
2017-12-30 15:27:24 +00:00
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) {
2017-12-30 04:44:41 +00:00
setprop("/ECAM/left-msg", "TO-MEMO");
2018-01-14 16:19:10 +00:00
} else if (getprop("/ECAM/ldg-memo-enable") == 1) {
setprop("/ECAM/left-msg", "LDG-MEMO");
2017-12-30 04:44:41 +00:00
} else {
setprop("/ECAM/left-msg", "NONE");
}
2017-12-30 15:54:45 +00:00
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
and getprop("/controls/flight/flap-pos") < 5) {
# Do nothing
} else {
setprop("/ECAM/to-config", 0);
}
},
toConfig: func() {
2018-01-14 03:38:47 +00:00
stateL = getprop("/engines/engine[0]/state");
stateR = getprop("/engines/engine[1]/state");
2018-01-14 16:19:10 +00:00
wow = getprop("/gear/gear[0]/wow");
2018-01-14 03:38:47 +00:00
if (wow == 1 and stateL == 3 and stateR == 3 and getprop("/ECAM/left-msg") != "TO-MEMO") {
setprop("/ECAM/to-memo-enable", 1);
setprop("/ECAM/engine-start-time", getprop("/ECAM/engine-start-time") - 120);
}
2017-12-30 15:54:45 +00:00
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
and getprop("/controls/flight/flap-pos") < 5) {
setprop("/ECAM/to-config", 1);
}
2017-12-30 04:44:41 +00:00
},
};
2017-08-14 15:29:00 +00:00
2017-12-30 04:44:41 +00:00
ECAM.MSGclr();