Class: SensorChannel
InkInput.SensorChannel(type, metricopt, resolution, min, max)
Represent data channel, provided from InputDevice
Constructor
new SensorChannel(type, metricopt, resolution, min, max)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | InkInput.SensorChannel.Type | Sensor channel type | ||
metric | InkInput.SensorChannel.Metric | <optional> | default metric for type | |
resolution | float | Decimal number giving the number of data item increments per physical unit. DIMENSIONLESS metric resolution is fixed to 1. | ||
min | float | Minimal value of the channel | ||
max | float | Maximal value of the channele.g. if the physical unit is in m and device units resolution is 100000, then the value 150 would be 0.0015 m |
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name | string | When type is CUSTOM, name should be set explicitly, it describes channel | ||
precision | int | <optional> | 2 | Delta encoding multiplyer |
TIMESTAMP type defaults to 0 CUSTOM type requires to be set explicitly |
Extends
Methods
(static) createCustomChannel(type, precision, metric, resolution, min, max) → InkInput.SensorChannel
Handy method to define custom channels
Parameters:
Name | Type | Description |
---|---|---|
type | URI | Sensor channel descriptor |
precision | int | Delta encoding multiplyer, required for serialization (whole numbers could have 0 as precision) |
metric | InkInput.SensorChannel.Metric | |
resolution | float | Decimal number giving the number of data item increments per physical unit. |
min | float | Minimal value of the channel |
max | float | Maximal value of the channel |
Returns:
Custom sensor channel
Type
Example
myapp://input/channel/AudioStream
(static) createDefaultInstance(type, inkProvider) → InkInput.SensorChannel
Creates default sensor channel instance
Parameters:
Name | Type | Description |
---|---|---|
type | InkInput.SensorChannel.Type | |
inkProvider | InkInput.InkInputProvider |
Returns:
default instance
Type
Type Definitions
Metric
Enumeration of the metrics used in serialization format
Properties:
Name | Type | Description |
---|---|---|
LENGTH | object | Underling SI unit is meter |
TIME | object | Underling SI unit is second |
FORCE | object | Underling SI unit is newton |
ANGLE | object | Underling SI unit is radian |
NORMALIZED | object | Percentage, expressed as a fraction (1.0 = 100%) relative to max-min |
LOGICAL | object | Boolean value provided . 1 for true and 0 for false. |
DIMENSIONLESS | object | Compliant with SI and means there is no unit. Ratio for example. |
Type
Enumeration of the input provider type
Properties:
Name | Type | Description |
---|---|---|
X | URI | X coordinate value associated with the sensor point |
Y | URI | Y coordinate value associated with the sensor point |
Z | URI | Z coordinate value associated with the sensor point |
TIMESTAMP | URI | Input time associated with the sensor point |
PRESSURE | URI | Pressure/Force value associated with the sensor point |
RADIUS_X | URI | X radius value associated with the sensor point |
RADIUS_Y | URI | Y radius value associated with the sensor point |
ALTITUDE | URI | Perpendicular line segment from a vertex of a geometric figure (triangle) to the opposite side (tablet surface).This information is available in sensor point when input device provides tilt. |
AZIMUTH | URI | Horizontal direction expressed as the angular distance between the direction of a fixed point (such as the observer's heading) and the direction of the object.This information is available in sensor point when input device provides tilt. |
ROTATION | URI | Rotation value associated with the sensor point |