<< 点击显示目录 >> 主页 mappView帮助助手 > mapp View帮助信息 > Widgets > Numeric > Joystick > Concept |
This section contains additional information about the concept of widget Joystick.
This widget can only be used for input. The user can move the slider thumb in all directions within the circle. The slider thumb can be moved between the x-axis and the y-axis, for example. If the slider thumb is released, the slider thumb automatically jumps back to the center.
The widget has 2 properties (xValue, yValue) that can be bound to the process variables or the output widgets. These properties range from -1 to 1 and can be used in the application as a factor, for example to define the movement of an axis.
Example: Movements on the x-axes and y-axes
Step 1: Place the widgets.
Widget "Joystick" and two BasicSlider widgets will be added to the piece of content.
To see how the values change, NumericOutput widgets are placed on the piece of content.
Step 2: Data binding
One numeric OPC UA variable is bound to xValue and one is bound to yValue on widget "Joystick". Writing should only be done from the widget side; for this reason, "Init read/write" is used as the binding mode.
One numeric OPC UA variable (xValueBasicSlider, yValueBasicSlider) that is added to xValue or YValue in the application is bound to "value" on each of the BasicSlider widgets. "Read-only" is used as the binding mode.
Results:
Widget "Joystick" can look like this when bound to the HMI application:
If the slider thumb is not moved or released, the values are xValue=0 and yValue=0. |
If the slider thumb is dragged to the top right, the BasicSlider widgets are moved by xValue= 0.5 and yValue= 0.5. |
If the slider thumb is not released, a change will be made again depending on the setting. The BasicSlider widgets are moved again by xValue= 0.5 and yValue= 0.5. |
The slider thumb can also be dragged into the negative area. The BasicSlider widgets are moved by xValue= -0.1 and yValue= -0.3. |
If the finger remains on the slider thumb, this setting will cause a change every second: