This repository has been archived on 2021-09-26. You can view files and clone it, but cannot push or open issues or pull requests.
IDG-A32X/Nasal/ECAM.nas

78 lines
2.3 KiB
Text
Raw Normal View History

2017-06-02 00:53:50 +00:00
# A3XX ECAM Messages
# Joshua Davidson (it0uchpods)
2017-07-14 15:57:14 +00:00
#######################################
# Copyright (c) A3XX Development Team #
#######################################
2017-06-02 00:53:50 +00:00
# It no works yet, so please don't touch a thing until it works. Thanks -JD
##################
# Init Functions #
##################
setprop("/position/gear-agl-ft", 0);
2017-06-22 01:45:56 +00:00
setprop("/ECAM/noupdate", 0);
setprop("/ECAM/donotrevert", 0);
2017-06-02 00:53:50 +00:00
######################################################
# w = White, b = Blue, g = Green, a = Amber, r = Red #
######################################################
var ECAMinit = func {
MSGclr();
2017-06-22 01:45:56 +00:00
ECAMloop.start();
2017-06-02 00:53:50 +00:00
}
var MSGclr = func {
2017-06-22 01:45:56 +00:00
setprop("/ECAM/ecam-checklist-active", 0);
setprop("/ECAM/left-msg", "NONE");
setprop("/ECAM/msg/line1", "");
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-06-02 00:53:50 +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");
}
var ECAMloop = maketimer(1, func {
2017-06-22 01:45:56 +00:00
var noUpdate = getprop("/ECAM/noupdate");
var doNotRevert = getprop("/ECAM/donotrevert");
if (getprop("/FMGC/status/phase") == 0 and getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") == 3) {
setprop("/ECAM/left-msg", "TO-MEMO");
} else if (!doNotRevert) {
setprop("/ECAM/left-msg", "NONE");
}
var leftMSG = getprop("/ECAM/left-msg");
if (leftMSG == "TO-MEMO" and !noUpdate) {
setprop("/ECAM/msg/line1", " AUTO BRK");
setprop("/ECAM/msg/line2", " SIGNS");
setprop("/ECAM/msg/line3", " CABIN");
setprop("/ECAM/msg/line4", " SPLRS");
setprop("/ECAM/msg/line5", " FLAPS");
setprop("/ECAM/msg/line6", "");
setprop("/ECAM/msg/line7", "");
setprop("/ECAM/msg/line8", "");
setprop("/ECAM/msg/line1c", "g");
setprop("/ECAM/msg/line2c", "g");
setprop("/ECAM/msg/line3c", "g");
setprop("/ECAM/msg/line4c", "g");
setprop("/ECAM/msg/line5c", "g");
setprop("/ECAM/msg/line6c", "g");
setprop("/ECAM/msg/line7c", "g");
setprop("/ECAM/msg/line8c", "g");
2017-06-02 00:53:50 +00:00
}
});