Difference between revisions of "Extensions.Quantities.CreateQuantity"
Jump to navigation
Jump to search
(Created page with "Category:Quantities == Classification == {{ClassificationActivity | CreateQuantity | Constructor for a '''Quantity''' | Term | OTX Quantities extension...") |
|||
Line 3: | Line 3: | ||
{{ClassificationActivity | CreateQuantity | Constructor for a '''Quantity''' | [[Term]] | [[Quantities|OTX Quantities extension]] | [[Quantity and Unit related terms]] | [[InvalidConversionException]] | - }} | {{ClassificationActivity | CreateQuantity | Constructor for a '''Quantity''' | [[Term]] | [[Quantities|OTX Quantities extension]] | [[Quantity and Unit related terms]] | [[InvalidConversionException]] | - }} | ||
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | QuantityTerm = Quantities.CreateQuantity(NumericTerm, UnitTerm, NumericTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 20: | Line 20: | ||
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | Quantity | + | Quantities.Quantity Quantity1; |
+ | |||
+ | Quantity1 = Quantity.CreateQuantity(1, [@Unit, "ODX_RS_UNIT_LIB.odx", "%/ms"], 0); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:46, 10 February 2015
Contents
Classification
Name | CreateQuantity |
Short Description | Constructor for a Quantity |
Class | Term |
Extension | OTX Quantities extension |
Group | Quantity and Unit related terms |
Exceptions | InvalidConversionException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
QuantityTerm = Quantities.CreateQuantity(NumericTerm, UnitTerm, NumericTerm);
Description
The CreateQuantity term is the constructor for a Quantity. It provides a reference to a definition of the unit that is associated with the Quantity. The reference of the unit refers to the SHORT-NAME of an unit UNIT-SPEC document definition within an ODX.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Quantity | Created Quantity. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Numeral | - | Term | - | [1] | Represents the numeric value from which the NumericQuantity should be created. |
DisplayUnit | - | Reference | - | [1] | Represents the display unit of the to-be-created Quantity. |
OTL Examples
Quantities.Quantity Quantity1;
Quantity1 = Quantity.CreateQuantity(1, [@Unit, "ODX_RS_UNIT_LIB.odx", "%/ms"], 0);