I could not quite understand how to use the <filter> code. I borrowed a different bit of code and attached it to the end of your "it-autoflight.nas" file. So now all I need to do is call "/it-autoflight/input/vs-abs" rather than "/it-autoflight/input/vs". I am not sure if this is efficient or simply slows down the simulation. The additions I used are shown below:
- Code: Select all
# We need the absolute value of VS so that we can use it in the panel display
# create a new variable named "AbsVS", assign a function body to it
var AbsVS = func {
# create a new variable named "vs_set" and assign the value from the getprop() call to it
var vs_set = getprop("/it-autoflight/input/vs");
# create a new variable named vs_displ and compute the absolute value using the vs_set variable
var vs_displ = abs(vs_set);
# finally, write the result to the property tree using the setprop() call
setprop("/it-autoflight/input/vs-abs", vs_displ);
}
# update the "vs-abs" property whenever "vs" is changed
setlistener("/it-autoflight/input/vs", AbsVS);