Class: Scalar
InkInput.Scalar
Units convertor
Members
Units
Supported conversion units
Properties:
Name | Type | Description |
---|---|---|
METER | InkInput.Scalar.LENGTH | Length conversion multiplyers |
CENTIMETER | InkInput.Scalar.LENGTH | Length conversion multiplyers |
MILLIMETER | InkInput.Scalar.LENGTH | Length conversion multiplyers |
MICROMETER | InkInput.Scalar.LENGTH | Length conversion multiplyers |
INCH | InkInput.Scalar.LENGTH | Length conversion multiplyers |
DP | InkInput.Scalar.LENGTH | Length conversion multiplyers |
PICA | InkInput.Scalar.LENGTH | Length conversion multiplyers |
POINT | InkInput.Scalar.LENGTH | Length conversion multiplyers |
DIP | InkInput.Scalar.LENGTH | Length conversion multiplyers |
DPI | InkInput.Scalar.LENGTH | Length conversion multiplyers |
SECOND | InkInput.Scalar.TIME | Time conversion multiplyers |
MILLISECOND | InkInput.Scalar.TIME | Time conversion multiplyers |
MICROSECOND | InkInput.Scalar.TIME | Time conversion multiplyers |
NANOSECOND | InkInput.Scalar.TIME | Time conversion multiplyers |
RADIAN | InkInput.Scalar.ANGLE | Angle conversion multiplyers |
DEGREE | InkInput.Scalar.ANGLE | Angle conversion multiplyers |
NEWTON | InkInput.Scalar.FORCE | Force conversion multiplyers |
Methods
(static) convert(channelMetric, channelResolution, channelValue, valueUnit) → {float}
Converts value from one unit to another, based on sensor channel metric and resolution
Parameters:
Name | Type | Description |
---|---|---|
channelMetric | InkInput.SensorChannel.Metric | Metric configured for sensor channel |
channelResolution | float | Resolution configured for sensor channel |
channelValue | float | Channel value |
valueUnit | InkInput.Scalar.Unit | Desired unit for conversion |
Returns:
Value converted in desired unit
Type
float
(static) convertValue(value, sourceUnit, targetUnit) → {float}
Converts value from one unit to another
Parameters:
Name | Type | Description |
---|---|---|
value | float | |
sourceUnit | InkInput.Scalar.Unit | Value unit |
targetUnit | InkInput.Scalar.Unit | Result unit |
Returns:
Value converted in desired unit
Type
float
(static) getChannelResolution(unit, pointSizeopt) → {float}
Calculates resolution based on channel metric and provided unit.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
unit | InkInput.Scalar.Unit | Input unit specified from HW device | ||
pointSize | int | <optional> | 1 | Size specified from HW device. For example device could work in μm and provided point size to be 6μm. |
Returns:
Resolution based on provided metric and unit
Type
float
(static) getMetricUnits(metric) → {Array.<InkInput.Scalar.Unit>}
Provides supported units for metric
Parameters:
Name | Type | Description |
---|---|---|
metric | InkInput.SensorChannel.Metric | Device metric |
Returns:
Supported units
Type
Array.<InkInput.Scalar.Unit>
(static) getUnit(metric) → InkInput.Scalar.Unit
Provides defaults unit based on metric
Parameters:
Name | Type | Description |
---|---|---|
metric | InkInput.SensorChannel.Metric |
Returns:
Device Device unit
Type
(static) getUnitMetric(unit) → InkInput.SensorChannel.Metric
Provides metric for desired unit
Parameters:
Name | Type | Description |
---|---|---|
unit | InkInput.Scalar.Unit | Device unit |
Returns:
Device metric
Type
Type Definitions
ANGLE
Angle conversion coeficients
Properties:
Name | Type | Description |
---|---|---|
RADIAN | float | |
DEGREE | float |
FORCE
Force conversion coeficients
Properties:
Name | Type | Description |
---|---|---|
NEWTON | float |
LENGTH
Length conversion coeficients
Properties:
Name | Type | Description |
---|---|---|
METER | float | |
CENTIMETER | float | |
MILLIMETER | float | |
MICROMETER | float | |
INCH | float | |
DP | float | |
PICA | float | |
POINT | float | |
DIP | float | |
DPI | float |
TIME
Time conversion coeficients
Properties:
Name | Type | Description |
---|---|---|
SECOND | float | |
MILLISECOND | float | |
MICROSECOND | float | |
NANOSECOND | float |
Unit
Enumeration of the units used for InkInput
Properties:
Name | Type | Description |
---|---|---|
METER | object | Length metric unit |
CENTIMETER | object | Length metric unit |
MILLIMETER | object | Length metric unit |
MICROMETER | object | Length metric unit |
INCH | object | Length metric unit |
DP | object | Length metric unit |
PICA | object | Length metric unit |
POINT | object | Length metric unit |
DIP | object | Length metric unit |
DPI | object | Length metric unit |
SECOND | object | Time metric unit |
MILLISECOND | object | Time metric unit |
MICROSECOND | object | Time metric unit |
NANOSECOND | object | Time metric unit |
RADIAN | object | Angle metric unit |
DEGREE | object | Angle metric unit |
NEWTON | object | Force metric unit |
NORMALIZED | object | Percentage, value between 0 and 1 |
LOGICAL | object | Boolean unit |