IO references
Structure
In this article we explain the internal structure, of the IOReference string.
This will help you, if you to find the correct modifiers to use in Configuration tab, and when using the JSON editor
IOreference characters and structure
- IOreference strings shall match [a-zA-Z0-9_\.-:/{}] where : and / are used to tokenize and {} is used to nest other IOreferences in designated places. [] is a part of literal values.
- Generally tokenized by colon. If no colon is found, it’s a literal value (or range of).
Literal values
- Literal values: If enclosed in brackets [], it’s a slice with multiple values. Examples: “[red,green,blue]” = 3 values. “blue” = single value
Index 0 = String
- Index 1: Value
Example: "String:{"Outputs": [{"ID": \d1,"Action": \d2}]}" = The way to use complex strings as literals which otherwise would get parsed because of their contents of special characters.
Index 0 = Var
- Index 1: Variable reference
- Index 2-…: Modifiers
Example: "Var:Shift" = Value of variable "Shift"
Example: "Var:Shift:Current:Name" = Label of variable "Shift"
Index 0 = DC
String after “DC:” is split by “/“ and the parts will mean this:
- Index 0: Device Core Key
- Index 1: IOreference to device index (Optionally encapsulated in {})
- Index 2: Parameter name
- Index 3-…: Dimensions
(After the last trailing slash, if “:” is found the following will be used as modifiers)
Example: “DC:bmd-atem/Var:DeviceIndex/program/Var:MERow/:Current”
Example: “DC:dreamchip-cam/Var:DeviceIndex/PlayAtSpeed/{DC:dreamchip-cam/Var:DeviceIndex/CurrentBuffer}”
Index 0 = Const
String after "Const:” is split by “/“ and the parts will mean this:
- Index 0: Constant Set reference (like variables)
- Index 1: Constant Set index (IOreference, (Optionally encapsulated in {}))
- Index 2: Constant Name
(After the last trailing slash, if “:” is found the following will be used as modifiers)
Index 0 = Preset
String after "Preset:” is split by “/“ and the parts will mean this:
- Index 0: Preset reference (like variables)
- Index 1: Command
- Index 2: Preset number (IOreference, (Optionally encapsulated in {}))
- Index 3: Device Index (IOreference, (Optionally encapsulated in {}))
- Index 4-…: Dimensions
(After the last trailing slash, if “:” is found the following will be used as modifiers)
Index 0 = Flag
(TODO)
Index 0 = Behavior
Behavior:LastEvent:Type == [Binary/Pulsed/Analog/Speed]
Behavior:LastEvent:TimeToNow:[Limit] < 500 (milliseconds); Limit is optional, but for performance reasons, please set it to the same value or higher as the one you compare with.
Behavior:LastEvent/Binary:Pressed == [true/false]
Behavior:LastEvent/Binary:Edge != NoEdge [NoEdge, Top, Left, Bottom, Right, Encoder]
Behavior:LastEvent/Pulsed:Direction == [Up/Down]
Behavior:LastEvent/Pulsed:Value == [Encoder return value]
Behavior:LastEvent/Analog:Value == [Absolute component return value]
Behavior:LastEvent/Speed:Value == [Intensity component return value]
(Behavior:LastEvent/x for Pulsed, Speed and Analog was added in Reactor v1.0.5-pre9)
Behavior:Events/[the eventHandlerKey]:TimeToNow:[Limit] < 500 (milliseconds) Last accepted event. Limit is optional, but for performance reasons, please set it to the same value or higher as the one you compare with.
Behavior:Events/[the eventHandlerKey]:SequenceStep == [Sequence step currently executing]
Behavior:IOreference[:modifiers added to IO reference]
for example:
Behavior:IOreference:Name
Behavior:IOreference:Current
Behavior:IOreference:Current:Name
Behavior:Path
Behavior:Name
Behavior:Id
Behavior:Panels - provides all panel IDs this behavior is mapped to.
Behavior:Const:[constant] - Value of constant (one or more values) Behavior:Script - returns "true" if there is an event script defined System:Lock Reactor:ProjectTitle - Current Project title Reactor:Panels:Connected - Number of connected panels Reactor:Devices:Connected - Number of connected devices Reactor:Warnings - Total number of warnings in Reactor String after Panels: is split by “/“ and the parts will mean this: [] - Not adding any modifiers returns the values…(LastEvent/xSub:CurrentStepforPulsed,SpeedandAnalogwasaddedinReactorv1.0.5-pre9)
Behavior:Const:[constant]:Name - Name of constant
Behavior:Const:[constant]:Label - Label of constant value(s) (one or more)
Behavior:Const:[constant]:ASCIIOnly - (see below)
Behavior:Const:[constant]:Index:[index number] - Value of specific index, where Index Number is an integer starting with zero. Negative numbers starting with -1 will point to last element, -2 to second last element etc. Special index value "Last" will be equal to "-1" (last element)
Behavior:Const:[constant]:Index:[index number]:Exists - true or false depending on whether constant exists
Behavior:Const:[constant]:Index:[index number]:Label - returns value label if different from empty string, otherwise it will return the value itself.
Behavior:Const:[constant]:Offset:[int] - Returns the value with [int] added to it. Example: "Behavior:Const:Offset:1" - Increases values with one.
Behavior:Script:IsRunning - returns "true" if there is a script and if script is running.
Behavior:Script:Stop - Trigger action to stop a script if it's running.Index 0 = System
System:IPAddressIndex 0 = Reactor
Reactor:ConfigTitle - Current name of root layer
Reactor:UptimeFormatted - Uptime since Reactor was started
Reactor:Panels:Warnings - Number of panels with warnings
Reactor:Panels:Unconnected - Number of unconnected panels (errors)
Reactor:Panels:LastEvent - Last event as a string, eg. "Down (T)" if a four way buttons top edge was pressed down.
Reactor:Panels:LastEventSource - The HWC source of last event, including panel ID, on form "P[panel id]#[HWC id]", for example "P1#43"
Reactor:Devices:Warnings - Number of devices with warnings
Reactor:Devices:Unconnected - Number of unconnected devices (errors)
Reactor:Devices/[idx]:Name - Name of devices. idx is just an index.
Reactor:Errors - Total number of errors in ReactorIndex 0 = Panels
(Usual source of id is: Behavior:Panels)
General Modifiers
Name - Returns Name of the reference (like a parameter or variable name)
Mutable - Returns “true” if available for change
Assumed - Returns "true" if a parameter is assumed in the core
Exists - Returns “true” if exists
Default - Returns default values of IO reference
Default:Name - Returns names of default values of IO reference
FineSteps - For a DC this returns the recommended fine steps, else returns 1
CoarseSteps - For a DC this returns the recommended fine coarse, else returns 10
Current - Returns values (same as no modifier)
Current:Name - Returns names of values
Current:Normalized - Returns value normalized to value range 0-1000
Current:NormalizedInverted - Returns value normalized to inverted value range 1000-0
Current:Percent - Returns value normalized to value range 0-100
Current:Remap:[low int]:[high int]:[optional integer divisor, default to 1] - Returns value normalized to value range [low int]-[high int] divided by the divisor. Example: "Behavior:IOReference:Current:Remap:-70:70:10" remaps to a range from -7.0 to 7.0
Current:Index - Returns index of current value from option list, starting with zero
Current:Count - Returns number of values in the IOreference array
Current:Join:Token - Returns an IOreference with a single value being a concatenation of all values it had, separated by the Token string, Example: "....:Current:Join:, :" - will join with ", " as the separator string.
Current:Offset:[int] - Returns the value with [int] added to it. Example: "Behavior:IOReference:Current:Offset:1" - Increases values with one.
Current:BufferTimeToNow - Returns milliseconds from buffered value time out to current time.
Label - for constants, returns the label a given constant may have
All - Returns all option values for a parameter
Index:[int/HWC behaviour constant string ref] - Returns option value with index [int] or if its a string, the constant of the HWC Behavior (works only for HWC behaviours then) (starting with zero)
Index:[int/HWC behaviour constant string ref]:Name - Returns name of option value with index [int] (starting with zero)
Index:[int/HWC behaviour constant string ref]:Exists - Returns true if the index exists
Index:Last - Returns last option value
Confirm:[int] - If added to a setting, stepping or mapping values, it will change the value only locally and waiting to be confirmed for [int] milliseconds after which it will fall back. Confirmation happens if a trigger (valueless value setting) happens. (works only for Device Cores)
Wait:[int] - like Confirm, but the change is automatically accepted on the expiry of the time. (works only for Device Cores)
ASCIIOnly - Returns true if only ascii characters are found in string (<127). Works also for Behavior:Const:[ConstantName]:ASCIIOnly
FineSteps - For Device Cores: Step size for fine steps (an integer value)
CoarseSteps - For Device Cores: Step size for coarse steps (an integer value)