OTX Reference
|
|
A physical unit which is defined in a UNIT-SPEC. More...
Public Attributes | |
UnitLiteral | init |
Cardinality [0..1] This optional element describes the initialization value from which the Unit shall be created More... | |
A physical unit which is defined in a UNIT-SPEC.
A Unit represents a physical unit which is defined in a UNIT-SPEC. A Unit can be associated to a physical value when creating a Quantity, but it can also be used stand-alone, e.g. when comparing the display Unit of a Quantity to another Unit object.
Literal
The syntax for Literals for complex data types will be used, UnitLiteral be used to create a Unit object based on a unit definition contained in UNIT-SPEC document.
Conversion terms
The following table shows the rules for conversion to another data type:
Conversion | Result | Sample |
---|---|---|
ToBoolean | Undefined (should not be used) | |
ToInteger | Undefined (should not be used) | |
ToFloat | Undefined (should not be used) | |
ToString | Returns the DISPLAY-NAME of the corresponding unit definition. | String s = ToString([@Unit, "BL_DataLibraMIB.odx", "km"]); // Returns "km" |
ToByteField | Undefined (should not be used) |
Sample
UnitLiteral OpenTestSystem.Otx.Extensions.Quantities.DataTypes.Unit.init |
Cardinality [0..1]
This optional element describes the initialization value from which the Unit shall be created