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,7 +242,9 @@ var APUController = {
var _masterTime = 0; var _masterTime = 0;
setlistener("controls/apu/master", func() { setlistener("controls/apu/master", func() {
if (APUController.APU != nil) {
if (APUNodes.Controls.master.getValue() and APUController.APU.state == 0) { if (APUNodes.Controls.master.getValue() and APUController.APU.state == 0) {
shutdownTimer.stop();
APUNodes.masterElecThreeMin.setValue(1); APUNodes.masterElecThreeMin.setValue(1);
checkMasterThreeMinTimer.start(); checkMasterThreeMinTimer.start();
_masterTime = pts.Sim.Time.elapsedSec.getValue(); _masterTime = pts.Sim.Time.elapsedSec.getValue();
@ -246,10 +252,13 @@ setlistener("controls/apu/master", func() {
} elsif (!APUNodes.Controls.master.getValue()) { } elsif (!APUNodes.Controls.master.getValue()) {
APUController.APU.stop(); APUController.APU.stop();
} }
}
}, 0, 1); }, 0, 1);
setlistener("controls/pneumatic/switches/bleedapu", func() { setlistener("controls/pneumatic/switches/bleedapu", func() {
if (APUController.APU != nil) {
APUController.APU.signals.bleedWasUsed = 1; APUController.APU.signals.bleedWasUsed = 1;
}
}, 0, 1); }, 0, 1);
var checkMasterThreeMinTimer = maketimer(0.1, func() { var checkMasterThreeMinTimer = maketimer(0.1, func() {