IrisControlsAPI Overview
Contents
Message Delimiter
The accent grave character `
(ASCII 0x60, 96) is used to signal the start of an IrisControls message. A newline or carriage return character \n \r
(ASCII 0x0A, 10 and ASCII 0x0D, 13) signal the message end.
Fractions (floats)
The API only transmits 2's compliment integers in its messages. To transmit fractional data, elements may have a scaling factor assigned to them (default is 1). Data sent from the API is divided by the scaling factor when being interpreted. As a user interacts with data n the gui, it will be first multiplied by the scaling factor prior to sending to the device.
For example, for a device to transmit 1.865, it could assign a scaling factor of 1000 and transmit 1865.
As another example, say a slider had a scaling factor of 100 and was assigned bounds of 0 and 100; the user would be presented with a slider that moves between 0 and 1. If the user moved the slider to a value of 0.5, IrisControls would update the device with a value of 50.
Scaling factors are not required to be powers of 10.
Plotting
Two kinds of 2D plotting are possible: realtime or static.
Realtime Plotting
Any element containing data updates (sliders, display values, etc) can be attached to a realtime plot. Multiple data sources can be attributed to a single plot and selectively show or hidden.
Static Plotting
A finished plot can be transmitted from the device to the GUI by streaming the x and y coordinates of each data point for a given series on the plot.
API Messages
Name | Syntax | Picture | ||
---|---|---|---|---|
arg | type | argument description | ||
noarg template | gendescription | |||
`a | ||||
1arg template | gendescription | |||
`a | arg1 | u32 | arg1description | |
2arg template | gendescription | |||
`a | arg1 | u32 | arg1description | |
arg3 | s32 | arg3description | ||
3arg template | gendescription | |||
`a | arg1 | u32 | arg1description | |
arg2 | s32 | arg2description | ||
arg3 | s32 | arg3description | ||
New Single Forward Slider | Creates a new single-sided slider at a specified location which increases from left to right | |||
`g uid name min max init | uid | u16 | the unique identity of the element. Must be unique from previously created elements. | |
name | string | display name of the element. Must not contain whitespaces; underscores are converted to whitespace. | ||
min | s32 | minimum slider value | ||
max | s32 | maximum slider value | ||
init | s32 | initial slider value | ||
Set Scaling | Sets a scaling denominator for the element. Values sent to IrisControls from the API are divided by this value before showing on the GUI. Values read by the GUI due to user interaction are multiplied by this value prior to transmitting to the device. | |||
`v uid scale | uid | u16 | the unique identity of the element. Must be unique from previously created elements. | |
scale | s32 | the scale factor for the GUI element | ||
Show Element | Displays the element, assuming it is located in a valid location and no other elements in that location are being shown | |||
`s uid scale | uid | u16 | the unique identity of the element. Must be unique from previously created elements. | |
Hide Element | Hides the element, and allows other elements to be shown it this element's location. | |||
`h uid scale | uid | u16 | the unique identity of the element. Must be unique from previously created elements. |