System: Master Warning light now flashes

This commit is contained in:
Joshua Davidson 2019-01-12 12:04:55 -05:00
parent af70bf84bf
commit b2971ede44
4 changed files with 34 additions and 15 deletions

View file

@ -5238,7 +5238,7 @@
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <equals>
<property>ECAM/warnings/master-warning-light</property> <property>ECAM/warnings/master-warning-flash</property>
<value>1</value> <value>1</value>
</equals> </equals>
</or> </or>

View file

@ -1,9 +1,6 @@
# A3XX Electronic Centralised Aircraft Monitoring System # A3XX Electronic Centralised Aircraft Monitoring System
# Jonathan Redpath (legoboyvdlp)
############################################## # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
var num_lines = 6; var num_lines = 6;
var msg = nil; var msg = nil;
@ -11,9 +8,12 @@ var spacer = nil;
var line = nil; var line = nil;
var right_line = nil; var right_line = nil;
var wow = getprop("/gear/gear[1]/wow"); var wow = getprop("/gear/gear[1]/wow");
var light = 0;
var flash = 0;
setprop("/ECAM/show-left-msg", 1); setprop("/ECAM/show-left-msg", 1);
setprop("/ECAM/show-right-msg", 1); setprop("/ECAM/show-right-msg", 1);
setprop("/ECAM/warnings/master-warning-light", 0); setprop("/ECAM/warnings/master-warning-light", 0);
setprop("/ECAM/warnings/master-warning-flash", 0);
setprop("/ECAM/warnings/master-caution-light", 0); setprop("/ECAM/warnings/master-caution-light", 0);
setprop("/ECAM/warnings/overflow", 0); setprop("/ECAM/warnings/overflow", 0);
setprop("/ECAM/warnings/overflow-left", 0); setprop("/ECAM/warnings/overflow-left", 0);
@ -221,8 +221,8 @@ var ECAM_controller = {
}, },
}; };
setlistener("/systems/electrical/bus/ac-ess", func { setlistener("/systems/electrical/bus/dc-ess", func {
if (getprop("/systems/electrical/bus/ac-ess") < 110) { if (getprop("/systems/electrical/bus/dc-ess") < 25) {
ECAM_controller.reset(); ECAM_controller.reset();
} }
}, 0, 0); }, 0, 0);
@ -230,3 +230,28 @@ setlistener("/systems/electrical/bus/ac-ess", func {
var ECAMloopTimer = maketimer(0.2, func { var ECAMloopTimer = maketimer(0.2, func {
ECAM_controller.loop(); ECAM_controller.loop();
}); });
# Flash Master Warning Light
var warnTimer = maketimer(0.2, func {
flash = getprop("/ECAM/warnings/master-warning-flash");
light = getprop("/ECAM/warnings/master-warning-light");
if (!light) {
warnTimer.stop();
setprop("/ECAM/warnings/master-warning-flash", 0);
} else if (flash != 1) {
setprop("/ECAM/warnings/master-warning-flash", 1);
} else {
setprop("/ECAM/warnings/master-warning-flash", 0);
}
});
setlistener("/ECAM/warnings/master-warning-light", func {
light = getprop("/ECAM/warnings/master-warning-light");
if (light == 1) {
setprop("/ECAM/warnings/master-warning-flash", 0);
warnTimer.start();
} else {
warnTimer.stop();
setprop("/ECAM/warnings/master-warning-flash", 0);
}
}, 0, 0);

View file

@ -1,9 +1,6 @@
# A3XX Electronic Centralised Aircraft Monitoring System # A3XX Electronic Centralised Aircraft Monitoring System
# Jonathan Redpath (legoboyvdlp)
############################################## # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
var messages_priority_3 = func { var messages_priority_3 = func {
if ((getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/ECAM/warning-phase") <= 3 and getprop("/ECAM/warning-phase") >= 5)) and ((((getprop("/engines/engine[0]/n1-actual") < 75.0 and getprop("/engines/engine[1]/n1-actual") < 75.0)) or ((getprop("/engines/engine[0]/n1-actual") < 77.0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) or (getprop("/engines/engine[1]/n1-actual") < 77.0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0))) or getprop("/controls/flight/flap-pos") > 1)) { if ((getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/ECAM/warning-phase") <= 3 and getprop("/ECAM/warning-phase") >= 5)) and ((((getprop("/engines/engine[0]/n1-actual") < 75.0 and getprop("/engines/engine[1]/n1-actual") < 75.0)) or ((getprop("/engines/engine[0]/n1-actual") < 77.0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) or (getprop("/engines/engine[1]/n1-actual") < 77.0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0))) or getprop("/controls/flight/flap-pos") > 1)) {

View file

@ -1,9 +1,6 @@
# A3XX Electronic Centralised Aircraft Monitoring System # A3XX Electronic Centralised Aircraft Monitoring System
# Jonathan Redpath (legoboyvdlp)
############################################## # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
# messages stored in vectors # messages stored in vectors