From 497364fbfdcc5f022ebf5c6ca5da7e657747294f Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sun, 8 Nov 2020 17:39:27 +0000 Subject: [PATCH] Bugfix APU that would fail to start due to not being synced with JSBSim perfectly --- Models/Instruments/OHpanel/OHpanel.xml | 2 +- Nasal/Systems/APU.nas | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 25e3fafc..1bea790e 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -5773,7 +5773,7 @@ nasal diff --git a/Nasal/Systems/APU.nas b/Nasal/Systems/APU.nas index 07fe75c7..8f57a2df 100644 --- a/Nasal/Systems/APU.nas +++ b/Nasal/Systems/APU.nas @@ -87,19 +87,25 @@ var APU = { powerOn: func() { # just in case 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 me.setState(1); me.fuelValveCmd.setValue(1); me.inletFlap.open(); - me.checkOil(); me.listenSignals = 1; settimer(func() { if (APUNodes.Controls.master.getValue() and !getprop("/systems/acconfig/autoconfig-running")) { me.setState(2); } }, 3); - settimer(func() { me.checkOil }, 8); + settimer(func() { me.checkOil() }, 8); }, startCommand: func(fast = 0) { if (me.listenSignals and (me.state == 1 or me.state == 2)) {