Skip to main content

Class: SensorChannel

InkInput.SensorChannel(type, metricopt, resolution, min, max)

Represent data channel, provided from InputDevice

Constructor

new SensorChannel(type, metricopt, resolution, min, max)

Parameters:
NameTypeAttributesDefaultDescription
typeInkInput.SensorChannel.TypeSensor channel type
metricInkInput.SensorChannel.Metric<optional>default metric for type
resolutionfloatDecimal number giving the number of data item increments per physical unit. DIMENSIONLESS metric resolution is fixed to 1.
minfloatMinimal value of the channel
maxfloatMaximal 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:
NameTypeAttributesDefaultDescription
namestringWhen type is CUSTOM, name should be set explicitly, it describes channel
precisionint<optional>2Delta 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:
NameTypeDescription
typeURISensor channel descriptor
precisionintDelta encoding multiplyer, required for serialization (whole numbers could have 0 as precision)
metricInkInput.SensorChannel.Metric
resolutionfloatDecimal number giving the number of data item increments per physical unit.
minfloatMinimal value of the channel
maxfloatMaximal value of the channel
Returns:

Custom sensor channel

Type

InkInput.SensorChannel

Example
myapp://input/channel/AudioStream

(static) createDefaultInstance(type, inkProvider) → InkInput.SensorChannel

Creates default sensor channel instance

Parameters:
NameTypeDescription
typeInkInput.SensorChannel.Type
inkProviderInkInput.InkInputProvider
Returns:

default instance

Type

InkInput.SensorChannel

Type Definitions

Metric

Enumeration of the metrics used in serialization format

Properties:
NameTypeDescription
LENGTHobjectUnderling SI unit is meter
TIMEobjectUnderling SI unit is second
FORCEobjectUnderling SI unit is newton
ANGLEobjectUnderling SI unit is radian
NORMALIZEDobjectPercentage, expressed as a fraction (1.0 = 100%) relative to max-min
LOGICALobjectBoolean value provided . 1 for true and 0 for false.
DIMENSIONLESSobjectCompliant with SI and means there is no unit. Ratio for example.

Type

Enumeration of the input provider type

Properties:
NameTypeDescription
XURIX coordinate value associated with the sensor point
YURIY coordinate value associated with the sensor point
ZURIZ coordinate value associated with the sensor point
TIMESTAMPURIInput time associated with the sensor point
PRESSUREURIPressure/Force value associated with the sensor point
RADIUS_XURIX radius value associated with the sensor point
RADIUS_YURIY radius value associated with the sensor point
ALTITUDEURIPerpendicular 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.
AZIMUTHURIHorizontal 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.
ROTATIONURIRotation value associated with the sensor point

Home