System: Fix APU Bleed delay bug, and staying on after acconfig panel load, fixes #51

This commit is contained in:
Joshua Davidson 2018-11-11 20:24:19 -05:00
parent 85231ca1a3
commit c8245c7a41
3 changed files with 9 additions and 4 deletions

View file

@ -68,21 +68,23 @@ setlistener("/controls/APU/master", func {
} else if (getprop("/controls/APU/master") == 1) {
apuBleedChk.stop();
setprop("/systems/apu/bleed-counting", 0);
setprop("/systems/apu/bleed-used", 0);
}
});
var apu_stop = func {
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") != 1) {
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") != 1 and getprop("/systems/acconfig/autoconfig-running") != 1) {
setprop("/systems/apu/bleed-counting", 1);
setprop("/systems/apu/bleed-time", getprop("/sim/time/elapsed-sec"));
}
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1) {
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1 and getprop("/systems/acconfig/autoconfig-running") != 1) {
apuBleedChk.start();
} else {
apuBleedChk.stop();
interpolate("/systems/apu/rpm", 0, 30);
interpolate("/systems/apu/egt", 42, 40);
setprop("/systems/apu/bleed-counting", 0);
setprop("/systems/apu/bleed-used", 0);
}
}
@ -93,6 +95,7 @@ var apuBleedChk = maketimer(0.1, func {
interpolate("/systems/apu/rpm", 0, 30);
interpolate("/systems/apu/egt", 42, 40);
setprop("/systems/apu/bleed-counting", 0);
setprop("/systems/apu/bleed-used", 0);
}
}
});

View file

@ -198,7 +198,9 @@ var PNEU = {
# Air Sources/PSI
if (rpmapu >= 94.9 and bleedapu_sw and !bleedapu_fail) {
setprop("/systems/pneumatic/bleedapu", 34);
if (getprop("/controls/APU/master") == 1) {
setprop("/systems/apu/bleed-used", 1);
}
} else {
setprop("/systems/pneumatic/bleedapu", 0);
}

View file

@ -1 +1 @@
4700
4701