Added sidestick priority latching
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
b402fbee46
commit
0dd88aaf2c
1 changed files with 3 additions and 1 deletions
|
@ -35,6 +35,7 @@ var locArm = props.globals.getNode("/it-autoflight/output/loc-armed", 1);
|
||||||
var apprArm = props.globals.getNode("/it-autoflight/output/appr-armed", 1);
|
var apprArm = props.globals.getNode("/it-autoflight/output/appr-armed", 1);
|
||||||
var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL");
|
var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL");
|
||||||
var SidestickPriorityPressedLast = 0;
|
var SidestickPriorityPressedLast = 0;
|
||||||
|
var priorityTimer = 0;
|
||||||
|
|
||||||
var FCU = {
|
var FCU = {
|
||||||
elecSupply: "",
|
elecSupply: "",
|
||||||
|
@ -185,11 +186,12 @@ var FCUController = {
|
||||||
setprop("/sim/sound/priority-right", 0);
|
setprop("/sim/sound/priority-right", 0);
|
||||||
}, 1.5);
|
}, 1.5);
|
||||||
}
|
}
|
||||||
|
priorityTimer = pts.Sim.Time.elapsedSec.getValue();
|
||||||
} else {
|
} else {
|
||||||
# Only release, if this side has pressed the button last
|
# Only release, if this side has pressed the button last
|
||||||
# to avoide the first pressed side getting activated again
|
# to avoide the first pressed side getting activated again
|
||||||
# when released.
|
# when released.
|
||||||
if (SidestickPriorityPressedLast == side) {
|
if (SidestickPriorityPressedLast == side and priorityTimer + 40 >= pts.Sim.Time.elapsedSec.getValue()) {
|
||||||
setprop("/fdm/jsbsim/fbw/sidestick/active[0]", 1);
|
setprop("/fdm/jsbsim/fbw/sidestick/active[0]", 1);
|
||||||
setprop("/fdm/jsbsim/fbw/sidestick/active[1]", 1);
|
setprop("/fdm/jsbsim/fbw/sidestick/active[1]", 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue