Bugfix APU that would fail to start due to not being synced with JSBSim perfectly
This commit is contained in:
parent
a59364f64f
commit
497364fbfd
2 changed files with 10 additions and 4 deletions
|
@ -5773,7 +5773,7 @@
|
||||||
</condition>
|
</condition>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
if (getprop("controls/apu/master") == 1) {
|
if (systems.APUNodes.Controls.master.getBoolValue()) {
|
||||||
systems.APUController.APU.startCommand();
|
systems.APUController.APU.startCommand();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -87,19 +87,25 @@ var APU = {
|
||||||
powerOn: func() {
|
powerOn: func() {
|
||||||
# just in case
|
# just in case
|
||||||
me.resetStuff();
|
me.resetStuff();
|
||||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) { return; }
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
|
settimer(func() {
|
||||||
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
|
me.resetStuff();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}, 0.2);
|
||||||
|
}
|
||||||
# apu able to receive emergency stop or start signals
|
# apu able to receive emergency stop or start signals
|
||||||
me.setState(1);
|
me.setState(1);
|
||||||
me.fuelValveCmd.setValue(1);
|
me.fuelValveCmd.setValue(1);
|
||||||
me.inletFlap.open();
|
me.inletFlap.open();
|
||||||
me.checkOil();
|
|
||||||
me.listenSignals = 1;
|
me.listenSignals = 1;
|
||||||
settimer(func() {
|
settimer(func() {
|
||||||
if (APUNodes.Controls.master.getValue() and !getprop("/systems/acconfig/autoconfig-running")) {
|
if (APUNodes.Controls.master.getValue() and !getprop("/systems/acconfig/autoconfig-running")) {
|
||||||
me.setState(2);
|
me.setState(2);
|
||||||
}
|
}
|
||||||
}, 3);
|
}, 3);
|
||||||
settimer(func() { me.checkOil }, 8);
|
settimer(func() { me.checkOil() }, 8);
|
||||||
},
|
},
|
||||||
startCommand: func(fast = 0) {
|
startCommand: func(fast = 0) {
|
||||||
if (me.listenSignals and (me.state == 1 or me.state == 2)) {
|
if (me.listenSignals and (me.state == 1 or me.state == 2)) {
|
||||||
|
|
Loading…
Reference in a new issue