Finish thrust lock, fix sounds

This commit is contained in:
legoboyvdlp R 2019-03-19 18:19:50 +00:00
parent 66976ff081
commit 3ea6a4c3ce
5 changed files with 47 additions and 41 deletions

View file

@ -5029,10 +5029,6 @@
if (getprop("/it-autoflight/output/athr-warning") == 1) {
setprop("/it-autoflight/output/athr-warning", 0);
}
# if (getprop("/sim/sound/warnings/chime") == 1) {
# setprop("/sim/sound/warnings/chime", 0);
#}
</script>
</binding>
</action>

View file

@ -68,14 +68,17 @@ var warning = {
me.noRepeat = 1;
},
sound: func() {
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
warning.cycleSound(me.aural);
me.noRepeat2 = 1;
},
cycleSound: func(type) {
aural[type].setBoolValue(0);
aural[type].setBoolValue(1);
}
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
me.noRepeat2 = 1;
if (aural[me.aural].getBoolValue()) {
aural[me.aural].setBoolValue(0);
settimer(func() {
aural[me.aural].setBoolValue(1);
}, 0.15);
} else {
aural[me.aural].setBoolValue(1);
}
},
};
var memo = {
@ -267,7 +270,7 @@ setlistener("/systems/electrical/bus/dc-ess", func {
}
}, 0, 0);
var ECAMloopTimer = maketimer(0.2, func {
var ECAMloopTimer = maketimer(0.15, func {
ECAM_controller.loop();
});

View file

@ -19,7 +19,6 @@ var wowNode = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
# local variables
var phaseVar = nil;
var dualFailFACActive = 1;
var flash = 0;
var messages_priority_3 = func {
phaseVar = phaseNode.getValue();
@ -229,12 +228,6 @@ var messages_priority_3 = func {
ECAM_controller.warningReset(athr_lock_1);
}
if (getprop("/systems/thrust/thr-locked-alert") == 1) {
flash = 1;
} else {
flash = 0;
}
if ((athr_offw.clearFlag == 0) and athrWarn.getValue() == 2 and phaseVar != 4 and phaseVar != 8 and phaseVar != 10) {
athr_offw.active = 1;
athr_offw_1.active = 1;

View file

@ -643,10 +643,22 @@ var lockThr = func() {
var checkLockThr = func() {
if (getprop("/systems/thrust/thr-lock-time") + 5 > getprop("/sim/time/elapsed-sec")) { return; }
if (getprop("/systems/thrust/thr-locked") == 0) {
if (fmgc.Output.athr.getBoolValue()) {
lockTimer.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-locked") == 0) {
lockTimer.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
state1 = getprop("/systems/thrust/state1");
@ -662,13 +674,32 @@ var checkLockThr = func() {
}
var checkLockThr2 = func() {
if (fmgc.Output.athr.getBoolValue()) {
lockTimer2.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-locked") == 0) {
lockTimer2.stop();
setprop("/systems/thrust/thr-locked", 0);
setprop("/systems/thrust/thr-locked-alert", 0);
setprop("/systems/thrust/thr-lock-time", 0);
setprop("/systems/thrust/thr-locked-flash", 0);
return;
}
if (getprop("/systems/thrust/thr-lock-time") + 5 < getprop("/sim/time/elapsed-sec")) {
setprop("/systems/thrust/thr-locked-flash", 0);
settimer(func() {
setprop("/systems/thrust/thr-locked-flash", 1);
setprop("/systems/thrust/thr-lock-time", getprop("/sim/time/elapsed-sec"));
ecam.athr_lock.noRepeat = 0;
}, 0.15);
ecam.athr_lock.noRepeat2 = 0;
}, 0.2);
}
state1 = getprop("/systems/thrust/state1");
@ -682,5 +713,5 @@ var checkLockThr2 = func() {
}
var lockTimer = maketimer(0.02, checkLockThr);
var lockTimer2 = maketimer(0.02, checkLockThr2);
var lockTimer = maketimer(0.1, checkLockThr);
var lockTimer2 = maketimer(0.1, checkLockThr2);

View file

@ -870,23 +870,6 @@
</volume>
</apoff>
<apoff>
<name>athroff</name>
<path>Aircraft/IDG-A32X/Sounds/Cockpit/chime.wav</path>
<condition>
<and>
<equals>
<property>/it-autoflight/output/athr</property>
<value>0</value>
</equals>
<property>/it-autoflight/sound/athrsound</property>
</and>
</condition>
<volume>
<factor>40.0</factor>
</volume>
</apoff>
<gear>
<name>gear0</name>
<mode>in-transit</mode>