1
0
Fork 0

Correct acconfig so it always works. Nasty. Rework acconfig?

This commit is contained in:
legoboyvdlp R 2020-04-19 20:20:52 +01:00
parent 41084eda14
commit fdc636b5e7
2 changed files with 22 additions and 15 deletions

View file

@ -344,13 +344,15 @@ var beforestart = func {
setprop("controls/flight/elevator-trim", 0);
libraries.systemsInit();
failResetOld();
setprop("controls/apu/master", 0);
# Now the Startup!
props.globals.getNode("controls/electrical/switches/bat-1").setValue(1);
props.globals.getNode("controls/electrical/switches/bat-2").setValue(1);
setprop("controls/apu/master", 1);
settimer(func() {
systems.APUController.APU.powerOn(); # guarantee it always works
systems.APUController.APU.startCommand(1);
}, 0.1);
var apu_rpm_chk = setlistener("/engines/engine[2]/n1", func {
if (getprop("engines/engine[2]/n1") >= 98) {
removelistener(apu_rpm_chk);
@ -434,13 +436,15 @@ var taxi = func {
setprop("controls/flight/elevator-trim", 0);
libraries.systemsInit();
failResetOld();
setprop("controls/apu/master", 0);
# Now the Startup!
props.globals.getNode("controls/electrical/switches/bat-1").setValue(1);
props.globals.getNode("controls/electrical/switches/bat-2").setValue(1);
setprop("controls/apu/master", 1);
settimer(func() {
systems.APUController.APU.powerOn(); # guarantee it always works
systems.APUController.APU.startCommand(1);
}, 0.1);
var apu_rpm_chk = setlistener("/engines/engine[2]/n1", func {
if (getprop("engines/engine[2]/n1") >= 98) {
removelistener(apu_rpm_chk);

View file

@ -29,6 +29,7 @@ var APU = {
bleedTime: 0,
cooldownEndTime: 0,
fastStart: 0,
_count: 0,
warnings: {
lowOilLevel: 0,
},
@ -101,7 +102,6 @@ var APU = {
settimer(func() { me.checkOil }, 8);
},
startCommand: func(fast = 0) {
if (me.listenSignals and (me.state == 1 or me.state == 2)) {
me.signals.startInProgress.setValue(1);
me.setState(3);
@ -254,6 +254,9 @@ var APU = {
me.bleedTime = pts.Sim.Time.elapsedSec.getValue();
},
update: func() {
me._count += 1;
if (me._count == 5) {
me._count = 0;
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
me.autoStop();
}
@ -264,7 +267,7 @@ var APU = {
}
if (me.state != 0) {
me.autoStop();
me.resetStuff();
}
}
}
},