Measurement Units and Measurable Quantities

The Measurement Units absolute model (users.%.models.measurementUnits) is part of the Iotellect Monitoring MES Core module and is responsible for handling the units of measurement used in the system.

Variables

The Measurement Units model includes two variables: Measurement Units (measurementUnits) and Quantities (measurementUnitClass).

Quantities

The Quantities (measurementUnitClass) variable stores information about quantities measured in the system, such as mass, volume, temperature, etc.

Field

Type

Description

key

String

Unique key of the measurable quantity.

value

String

Value/name of the measurable quantity.

defaultMeasurementUnit

String

Base unit of measurement, i.e. the default unit of measurement for the given quantity.

Measurement Units

The Measurement Units (measurementUnits) variable stores information about the units of measurement used in the system and the standard rules for converting between them (for example, 1 tonne = 1000 kilograms).

Field

Type

Description

key

String

Unique key of the unit of measurement.

value

String

Value/name of the unit of measurement.

class

String

Quantity that can be measured using this unit of measurement.

forwardConversionRule

String

Custom expression that defines the forward conversion rule, i.e. conversion from the given unit of measurement to the base unit of the quantity it measures. Environment variable: {value} — the value in the given unit of measurement.

reverseConversionRule

String

Custom expression that defines the reverse conversion rule, i.e. conversion from the base unit of measurement to the given unit. Environment variable: {value} — the value in the base unit of measurement.

Functions

The main function of the Measurement Units model is unit conversion. The other functions either support this functionality or serve as setters and getters for the variables.

Convert Function

The function uses standard conversion rules to convert a value from one unit of measurement to another within the same measurable quantity.

Example:

  • Given: the measurable quantity is mass. The base unit of measurement is kilogram.

  • Convert: 2 tonnes to centners.

  • Conversion:
    2 tonnes → (forward conversion rule: 1 t = 1000 kg) → 2000 kilograms → (reverse conversion rule: 1 kg = 0.01 centner) → 20 centners.

Function Name:

convert

Permissions:

Accessible at Observer permission level

Input Records:

1

Input Format:

Name

Type

Description

value

Double

Value in the source unit of measurement.

sourceUnit

String

Source unit of measurement.

targetUnit

String

Target unit of measurement.

Output Records:

1

Output Format:

Double или NULL

Was this page helpful?