Selector object


Selector

A selector provides an easy method of selecting a part of a numerical data vector. Its control window consists of two sliders which specify window width and start. The selector has two input variables for scale and data. The output variables "Scala" and "Data" contain the selected data range. The float outputs "Relative start" and "Relative width" contain the positions of the two sliders as relative values in the range from 0.0 to 1.0. The outputs "absolute start" and "absolute width" contain the relative scrollbar positions multiplied with the length of input vectors. The selector object manages internal data buffers for scala and data vectors, which are updated every time it is called with connected "Data" and / or "Scala" inputs. When it creates a new thread upon a scroll bar change, it automatically returns the selected data using the memorized data values.

Via the input variable "Relative start" and "Relative width" the slider position and selection range can be set from outside. This can be used for entering the selection range manually or for selecting more than two vectors together: For this to work you can combine multiple selector objects. The first one is the one with a user interface where the user can change the scroll bars. Connect the output variables "Relative with" and "Relative start" to the relative inputs of other "slave" selector objects, which need not to have an associated control window. These slave selector objects now work synchronously to the first one and can be used for selecting more data vectors.
Fig. 1: Using the selector
The selector only has 2 properties: "Execute on change" specifies whether a new thread should be created on value change and "Animated" specifies whether a thread should be created during dragging the sliders. Like a normal scrollbar object if setting animated to "Yes" it may be a good idea to put a
thread blocker object behind a selector.

Figure 1 shows an example of combining a selector object with a graphic display. The original and the selected curve are displayed in a single plot. The selected part should have a higher curve number so that it is drawn on top of the original curve.


The Vimms User Manual