Skip to main content

Class: Scalar

InkInput.Scalar

Units convertor

Members

Units

Supported conversion units

Properties:
NameTypeDescription
METERInkInput.Scalar.LENGTHLength conversion multiplyers
CENTIMETERInkInput.Scalar.LENGTHLength conversion multiplyers
MILLIMETERInkInput.Scalar.LENGTHLength conversion multiplyers
MICROMETERInkInput.Scalar.LENGTHLength conversion multiplyers
INCHInkInput.Scalar.LENGTHLength conversion multiplyers
DPInkInput.Scalar.LENGTHLength conversion multiplyers
PICAInkInput.Scalar.LENGTHLength conversion multiplyers
POINTInkInput.Scalar.LENGTHLength conversion multiplyers
DIPInkInput.Scalar.LENGTHLength conversion multiplyers
DPIInkInput.Scalar.LENGTHLength conversion multiplyers
SECONDInkInput.Scalar.TIMETime conversion multiplyers
MILLISECONDInkInput.Scalar.TIMETime conversion multiplyers
MICROSECONDInkInput.Scalar.TIMETime conversion multiplyers
NANOSECONDInkInput.Scalar.TIMETime conversion multiplyers
RADIANInkInput.Scalar.ANGLEAngle conversion multiplyers
DEGREEInkInput.Scalar.ANGLEAngle conversion multiplyers
NEWTONInkInput.Scalar.FORCEForce 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:
NameTypeDescription
channelMetricInkInput.SensorChannel.MetricMetric configured for sensor channel
channelResolutionfloatResolution configured for sensor channel
channelValuefloatChannel value
valueUnitInkInput.Scalar.UnitDesired 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:
NameTypeDescription
valuefloat
sourceUnitInkInput.Scalar.UnitValue unit
targetUnitInkInput.Scalar.UnitResult unit
Returns:

Value converted in desired unit

Type

float

(static) getChannelResolution(unit, pointSizeopt) → {float}

Calculates resolution based on channel metric and provided unit.

Parameters:
NameTypeAttributesDefaultDescription
unitInkInput.Scalar.UnitInput unit specified from HW device
pointSizeint<optional>1Size 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:
NameTypeDescription
metricInkInput.SensorChannel.MetricDevice metric
Returns:

Supported units

Type

Array.<InkInput.Scalar.Unit>

(static) getUnit(metric) → InkInput.Scalar.Unit

Provides defaults unit based on metric

Parameters:
NameTypeDescription
metricInkInput.SensorChannel.Metric
Returns:

Device Device unit

Type

InkInput.Scalar.Unit

(static) getUnitMetric(unit) → InkInput.SensorChannel.Metric

Provides metric for desired unit

Parameters:
NameTypeDescription
unitInkInput.Scalar.UnitDevice unit
Returns:

Device metric

Type

InkInput.SensorChannel.Metric

Type Definitions

ANGLE

Angle conversion coeficients

Properties:
NameTypeDescription
RADIANfloat
DEGREEfloat

FORCE

Force conversion coeficients

Properties:
NameTypeDescription
NEWTONfloat

LENGTH

Length conversion coeficients

Properties:
NameTypeDescription
METERfloat
CENTIMETERfloat
MILLIMETERfloat
MICROMETERfloat
INCHfloat
DPfloat
PICAfloat
POINTfloat
DIPfloat
DPIfloat

TIME

Time conversion coeficients

Properties:
NameTypeDescription
SECONDfloat
MILLISECONDfloat
MICROSECONDfloat
NANOSECONDfloat

Unit

Enumeration of the units used for InkInput

Properties:
NameTypeDescription
METERobjectLength metric unit
CENTIMETERobjectLength metric unit
MILLIMETERobjectLength metric unit
MICROMETERobjectLength metric unit
INCHobjectLength metric unit
DPobjectLength metric unit
PICAobjectLength metric unit
POINTobjectLength metric unit
DIPobjectLength metric unit
DPIobjectLength metric unit
SECONDobjectTime metric unit
MILLISECONDobjectTime metric unit
MICROSECONDobjectTime metric unit
NANOSECONDobjectTime metric unit
RADIANobjectAngle metric unit
DEGREEobjectAngle metric unit
NEWTONobjectForce metric unit
NORMALIZEDobjectPercentage, value between 0 and 1
LOGICALobjectBoolean unit

Home