1
0
Fork 0

Add timer to elec to wait a short time before tripping autopilot if there is a failure, to account for transient failures

This commit is contained in:
legoboyvdlp R 2020-01-01 21:49:44 +00:00
parent d44a794859
commit ba51c852f5
2 changed files with 25 additions and 10 deletions

View file

@ -349,6 +349,7 @@ var ECAM_controller = {
warning.active = 0;
warning.noRepeat = 0;
warning.noRepeat2 = 0;
# don't set .wasActive to 0, warnlight / sound funcs do that
},
};

View file

@ -13,6 +13,8 @@ var dc2 = 0;
# Main class
var ELEC = {
_timer1On: 0,
_timer2On: 0,
Bus: {
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
@ -227,20 +229,32 @@ var ELEC = {
# Autopilot Disconnection routines
if (me.Bus.dcEssShed.getValue() < 25) {
if (getprop("/it-autoflight/output/ap1") == 1) {
fcu.apOff("hard", 1);
if (fcu.FCUController.activeFMGC.getValue() == 1) {
fcu.athrOff("hard");
}
if (getprop("/it-autoflight/output/ap1") == 1 and !me._timer1On) {
me._timer1On = 1;
settimer(func() {
if (me.Bus.dcEssShed.getValue() < 25) {
fcu.apOff("hard", 1);
if (fcu.FCUController.activeFMGC.getValue() == 1) {
fcu.athrOff("hard");
}
}
me._timer1On = 0;
}, 0.1);
}
}
if (me.Bus.dc2.getValue() < 25) {
if (getprop("/it-autoflight/output/ap2") == 1) {
fcu.apOff("hard", 2);
if (fcu.FCUController.activeFMGC.getValue() == 2) {
fcu.athrOff("hard");
}
if (getprop("/it-autoflight/output/ap2") == 1 and !me._timer2On) {
me._timer2On = 1;
settimer(func() {
if (me.Bus.dc2.getValue() < 25) {
fcu.apOff("hard", 2);
if (fcu.FCUController.activeFMGC.getValue() == 2) {
fcu.athrOff("hard");
}
}
me._timer2On = 0;
}, 0.1);
}
}
},