1
0
Fork 0

Fix apu valve weirdness

This commit is contained in:
legoboyvdlp R 2020-04-17 23:27:01 +01:00
parent 54c6891e4a
commit 6d95b51604

View file

@ -87,7 +87,11 @@ var APU = {
me.inletFlap.open(); me.inletFlap.open();
me.checkOil(); me.checkOil();
me.listenSignals = 1; me.listenSignals = 1;
settimer(func() { me.setState(2)}, 3); settimer(func() {
if (APUNodes.Controls.master.getValue()) {
me.setState(2);
}
}, 3);
settimer(func() { me.checkOil }, 8); settimer(func() { me.checkOil }, 8);
}, },
startCommand: func() { startCommand: func() {
@ -155,7 +159,7 @@ var APU = {
me.signals.fault = 1; me.signals.fault = 1;
} }
if (pts.APU.rpm.getValue() < 7) { if (pts.APU.rpm.getValue() < 7 and !APUNodes.Controls.master.getValue()) {
me.inletFlap.close(); me.inletFlap.close();
me.fuelValveCmd.setValue(0); me.fuelValveCmd.setValue(0);
if (!APUNodes.Controls.master.getValue()) { if (!APUNodes.Controls.master.getValue()) {
@ -238,18 +242,23 @@ var APUController = {
var _masterTime = 0; var _masterTime = 0;
setlistener("controls/apu/master", func() { setlistener("controls/apu/master", func() {
if (APUNodes.Controls.master.getValue() and APUController.APU.state == 0) { if (APUController.APU != nil) {
APUNodes.masterElecThreeMin.setValue(1); if (APUNodes.Controls.master.getValue() and APUController.APU.state == 0) {
checkMasterThreeMinTimer.start(); shutdownTimer.stop();
_masterTime = pts.Sim.Time.elapsedSec.getValue(); APUNodes.masterElecThreeMin.setValue(1);
APUController.APU.powerOn(); checkMasterThreeMinTimer.start();
} elsif (!APUNodes.Controls.master.getValue()) { _masterTime = pts.Sim.Time.elapsedSec.getValue();
APUController.APU.stop(); APUController.APU.powerOn();
} elsif (!APUNodes.Controls.master.getValue()) {
APUController.APU.stop();
}
} }
}, 0, 1); }, 0, 1);
setlistener("controls/pneumatic/switches/bleedapu", func() { setlistener("controls/pneumatic/switches/bleedapu", func() {
APUController.APU.signals.bleedWasUsed = 1; if (APUController.APU != nil) {
APUController.APU.signals.bleedWasUsed = 1;
}
}, 0, 1); }, 0, 1);
var checkMasterThreeMinTimer = maketimer(0.1, func() { var checkMasterThreeMinTimer = maketimer(0.1, func() {