From 0dd88aaf2c114a96d8b8af2380a9a91b39d9c83a Mon Sep 17 00:00:00 2001 From: fly Date: Fri, 30 Apr 2021 16:05:37 +0000 Subject: [PATCH] Added sidestick priority latching Signed-off-by: fly --- Nasal/FMGC/FCU.nas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Nasal/FMGC/FCU.nas b/Nasal/FMGC/FCU.nas index 6727f995..94cb508d 100644 --- a/Nasal/FMGC/FCU.nas +++ b/Nasal/FMGC/FCU.nas @@ -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 FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL"); var SidestickPriorityPressedLast = 0; +var priorityTimer = 0; var FCU = { elecSupply: "", @@ -185,11 +186,12 @@ var FCUController = { setprop("/sim/sound/priority-right", 0); }, 1.5); } + priorityTimer = pts.Sim.Time.elapsedSec.getValue(); } else { # Only release, if this side has pressed the button last # to avoide the first pressed side getting activated again # 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[1]", 1); }