Widgets KNOB - thica/ORCA-Remote GitHub Wiki

KNOB

The knob widget provides the function of a turnable button. If you turn the button by mouse or by touch, an action is triggered The knob widget provides two modi:

  • Endless turn: You can turn the knob in both directions as much as you like
  • Limited turn: You can turn the the knob within defined boundaries. Each position is aligned to a specific level
The following attributes are additional attributes to common widget attributes.
Attribute Description
type fixed: needs to be "KNOB". Capital letters!
picturenormal The picture to show. It is advised to use a round picture. If you use a marker, it should point to the upper , center position.
leftboundaryangle If you want to have a KNOB with limited turn, you have to provide the angle/degree of the left and right limit. "o" (Null) is top center / North, -90 would be West, 90 would be East
rightboundaryangle The angle/degree of the right limit
mindatavalue For limited turn KNOBs, this is the value, which is assigned to the Knob, when it reaches the leftboundaryangle. Data values are float values, so you can use small numbers as well.
maxdatavalue For limited turn KNOBs, this is the value, which is assigned to the Knob, when it reaches the rightboundaryangle.
destvar This is the PREFIX for the variable, which holds the status of the KNOB. The KNOB widgets sets/updates the following variables, when it get turned:
  • [PREFIX]_value: For limited turn KNOBs: The value assigned to the KNOB position within the data range.
  • [PREFIX]_degree: The angle/degree position of the KNOB. This will a negative value, if the KNOB is turned to the left from the null position. For endless turn KNOBs, this value extends for 360 / -360 after a full turn.
  • [PREFIX]_absdegree: The absolute angle/degree position of the KNOB. This is between 0 and 359 degree. After a full rotation, it begins with o again.
  • [PREFIX]_direction: The direction of the last turn: will be "left" or "right"
roundpos The position in digits, the [PREFIX]_value should be rounded. Examples: If the [PREFIX]_value is 10.623:
  • "0" will round to 11
  • "1" will round to 10.6
discardmoves if you set this attribute to "1", you just get a notification, when the user finishes moving the widget. If not set, you get (a lot of) notifications, while the user is moving the widget on the screen. Can be usefull, if you would like to avoid an interface being swamped by commands.

If you want to set the position of the KNOB (The Knob Picture) , meaningful for limited turn KNOBs only, you have to set [PREFIX]_value and the call the updatewidget action.

⚠️ **GitHub.com Fallback** ⚠️