Correct acconfig so it always works. Nasty. Rework acconfig?
This commit is contained in:
parent
41084eda14
commit
fdc636b5e7
2 changed files with 22 additions and 15 deletions
|
@ -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);
|
||||
systems.APUController.APU.startCommand(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);
|
||||
systems.APUController.APU.startCommand(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);
|
||||
|
|
|
@ -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,17 +254,20 @@ var APU = {
|
|||
me.bleedTime = pts.Sim.Time.elapsedSec.getValue();
|
||||
},
|
||||
update: func() {
|
||||
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
|
||||
me.autoStop();
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||
if (me.GenericControls.starter.getValue()) {
|
||||
me.GenericControls.starter.setValue(0);
|
||||
}
|
||||
if (me.state != 0) {
|
||||
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();
|
||||
me.resetStuff();
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||
if (me.GenericControls.starter.getValue()) {
|
||||
me.GenericControls.starter.setValue(0);
|
||||
}
|
||||
if (me.state != 0) {
|
||||
me.autoStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue