* Melchior FRANZ -- Monday 15 October 2007:
> <persistent> ... This is by default 1, which means that the listener
> function is called whenever the property was just written
> to (= traditional behavior). Writing the same value repeatedly
> will trigger as well. If the argument is set to 0, then the
> function will only be called when a new value is written.
Here's a real-life example, the one that made me implement this new
feature:
setlistener("/gear/launchbar/state", func {
if (cmdarg().getValue() == "Engaged")
setprop("/sim/messages/copilot", "Engaged!");
}, 1, 0);
YASim writes once per frame the string "Disengaged" to property
/gear/launchbar/state. When an aircraft on deck of the aircraft
carrier locks into the catapult, this changes to "Engaged", which
is then written again in every frame, until the aircraft leaves
the catapult. Because the locking in is a bit difficult -- one has
to target the sensitive area quite exactly --, it was desirable to
get some quick feedback: a screen message that's also spoken by
the Festival speech synthesis. With the args 1 and 0, this is done
initially (for the unlikely case that we are locked in from the
beginning), and then only when the node changes from an arbitrary
value to "Engaged".
m.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel