Skip to main content

Class: UiKnobUtils

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:8

A utility class for working with G3X Touch bezel rotary knobs.

Constructors​

Constructor​

new UiKnobUtils(): UiKnobUtils

Returns​

UiKnobUtils

Properties​

ALL_KNOB_IDS​

readonly static ALL_KNOB_IDS: readonly [SingleOuter, SingleInner, SingleInnerPush, LeftOuter, LeftInner, LeftInnerPush, RightOuter, RightInner, RightInnerPush]

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:10

An array of all bezel rotary knob IDs.


INNER_KNOB_IDS​

readonly static INNER_KNOB_IDS: readonly [SingleInner, SingleInnerPush, LeftInner, LeftInnerPush, RightInner, RightInnerPush]

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:30

An array of inner bezel rotary knob IDs.


KNOB_ID_TO_KNOB_GROUP​

readonly static KNOB_ID_TO_KNOB_GROUP: UiKnobIdGroupMap

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:57

Mappings from G3X Touch bezel rotary knob IDs to the groups to which they belong.


OUTER_KNOB_IDS​

readonly static OUTER_KNOB_IDS: readonly [SingleOuter, LeftOuter, RightOuter]

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:23

An array of outer bezel rotary knob IDs.


PUSH_KNOB_IDS​

readonly static PUSH_KNOB_IDS: readonly [SingleInnerPush, LeftInnerPush, RightInnerPush]

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:50

An array of IDs of bezel rotary knobs that can be pushed.


TURN_KNOB_IDS​

readonly static TURN_KNOB_IDS: readonly [SingleOuter, SingleInner, LeftOuter, LeftInner, RightOuter, RightInner]

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:40

An array of IDs of bezel rotary knobs that can be turned.

Methods​

isInnerKnobId()​

static isInnerKnobId(knobId): knobId is UiInnerKnobId

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:83

Checks if a bezel rotary knob ID belongs to an inner knob.

Parameters​

ParameterTypeDescription
knobIdUiKnobIdThe bezel rotary knob ID to check.

Returns​

knobId is UiInnerKnobId

Whether the specified bezel rotary ID belongs to an inner knob.


isOuterKnobId()​

static isOuterKnobId(knobId): knobId is UiOuterKnobId

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:74

Checks if a bezel rotary knob ID belongs to an outer knob.

Parameters​

ParameterTypeDescription
knobIdUiKnobIdThe bezel rotary knob ID to check.

Returns​

knobId is UiOuterKnobId

Whether the specified bezel rotary ID belongs to an outer knob.


isPushKnobId()​

static isPushKnobId(knobId): knobId is UiPushKnobId

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:101

Checks if a bezel rotary knob ID belongs to a knob that can be pushed.

Parameters​

ParameterTypeDescription
knobIdUiKnobIdThe bezel rotary knob ID to check.

Returns​

knobId is UiPushKnobId

Whether the specified bezel rotary ID belongs to a knob that can be pushed.


isTurnKnobId()​

static isTurnKnobId(knobId): knobId is UiTurnKnobId

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:92

Checks if a bezel rotary knob ID belongs to a knob that can be turned.

Parameters​

ParameterTypeDescription
knobIdUiKnobIdThe bezel rotary knob ID to check.

Returns​

knobId is UiTurnKnobId

Whether the specified bezel rotary ID belongs to a knob that can be turned.


reconcileRequestedLabelStates()​

static reconcileRequestedLabelStates(knobIds, pipeTo, paused, ...requestedStates): Subscription

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiKnobUtils.ts:116

Reconciles one or more requested knob label states and pipes the result into a MutableSubscribableMap of knob label states.

Parameters​

ParameterTypeDescription
knobIdsreadonly UiKnobId[]The IDs of the knobs for which to reconcile label states.
pipeToMutableSubscribableMap<UiKnobId, string>The map to which to pipe the reconciled requested label states.
pausedbooleanWhether to initialize the label state pipe as paused.
...requestedStatesSubscribable<UiKnobRequestedLabelState>[]The requested knob label states to reconcile. Requested states that appear earlier in the array have a higher priority. In other words, for each knob, the reconciled state will be selected from one of the requested states if and only if no requested state with a lower index has requested a label for the same knob.

Returns​

Subscription

A Subscription representing the created reconciled knob label state pipe.