Difference between revisions of "Extensions.Quantities.Addition"
Jump to navigation
Jump to search
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{DISPLAYTITLE:'''Addition '''}}[[Category:Quantities]] | + | {{DISPLAYTITLE:'''Quantity Addition '''}}[[Category:Quantities]] |
== Classification == | == Classification == | ||
− | {{ClassificationActivity | Addition | Sum of all numerical quantities | [[Operations]] | [[Extensions.Quantities|OTX Quantities extension]] | [[Overloading semantics]] | [[Extensions.Quantities.InvalidConversionException|InvalidConversionException]] | - }} | + | {{ClassificationActivity | Addition | Sum of all numerical quantities | [[Operations]] | [[Extensions.Quantities|OTX Quantities extension]] | [[Extensions.Quantities#Terms|Overloading semantics]] | [[Extensions.Quantities.InvalidConversionException|InvalidConversionException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | QuantityTerm | + | QuantityVariable = QuantityTerm + NumericTerm; |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
This is a term which, as a result the sum of all numerical quantities (NumericQuantity returns) with respect to their units. | This is a term which, as a result the sum of all numerical quantities (NumericQuantity returns) with respect to their units. | ||
+ | |||
+ | * When '''Quantity''' values are added, the physical dimensions of the display unit of all '''Quantity''' operands will be identical. | ||
+ | |||
+ | * If scalar operands exist, they will be interpreted as normalized values according to the physical dimension of the '''Quantity''' operands. This allows e.g. the addition of 2 km + 1 m + 11 which will result in a '''Quantity''' of 2012 m. | ||
+ | |||
+ | * The display unit of the resulting '''Quantity''' will be set to the SI base unit corresponding to the '''Quantity''''s physical dimension. Furthermore, the display precision of the resulting '''Quantity''' will be the maximum of the display precisions of the operands. | ||
{{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | Sum of all numerical quantities}} | {{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | Sum of all numerical quantities}} | ||
Line 16: | Line 22: | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| | + | {{TableRowPropertie1| QuantityTerm | [[Extensions.Quantities.Quantity|Quantity]]| [[Term]] | - | [1..*] | Quantity values are added}} |
− | {{ | + | {{TableRowPropertie2| NumericTerm | [[Numeric]]| [[Term]] | - | [0..*] | Numeric values are added}} |
|} | |} | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | Quantities.Quantity | + | /// Local Declarations |
+ | |||
+ | Quantities.Quantity Quantity; | ||
+ | |||
+ | /// Flow | ||
− | + | // The assignment below will have the returned value: 2011 m (2011 [@Unit, "BL_DataLibraMIB.odx", "m"]) | |
+ | Quantity = (2 [@Unit, "BL_DataLibraMIB.odx", "km"] + 1 [@Unit, "BL_DataLibraMIB.odx", "m"]) + 11; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
+ | [[Extensions.Quantities.Conversions|Conversions]] <br/> | ||
+ | <!--[[Extensions.Quantities.Addition|Addition]] <br/>--> | ||
[[Extensions.Quantities.Subtraction|Subtraction]] <br/> | [[Extensions.Quantities.Subtraction|Subtraction]] <br/> | ||
[[Extensions.Quantities.Multiplication|Multiplication]] <br/> | [[Extensions.Quantities.Multiplication|Multiplication]] <br/> | ||
− | [[Extensions.Quantities.Division|Division]] | + | [[Extensions.Quantities.Division|Division]] <br/> |
+ | [[Extensions.Quantities.Modulo|Modulo]] <br/> | ||
+ | [[Extensions.Quantities.AbsoluteValue|Absolute Value]] <br/> | ||
+ | [[Extensions.Quantities.Negation|Negation]] <br/> | ||
+ | [[Extensions.Quantities.RelationalOperations|Relational Operations]] <br/> | ||
+ | [[Extensions.Quantities.OtherOperations|Other Operations]] |
Latest revision as of 03:13, 13 September 2019
Contents
Classification
Name | Addition |
Short Description | Sum of all numerical quantities |
Class | Operations |
Extension | OTX Quantities extension |
Group | Overloading semantics |
Exceptions | InvalidConversionException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
QuantityVariable = QuantityTerm + NumericTerm;
Description
This is a term which, as a result the sum of all numerical quantities (NumericQuantity returns) with respect to their units.
- When Quantity values are added, the physical dimensions of the display unit of all Quantity operands will be identical.
- If scalar operands exist, they will be interpreted as normalized values according to the physical dimension of the Quantity operands. This allows e.g. the addition of 2 km + 1 m + 11 which will result in a Quantity of 2012 m.
- The display unit of the resulting Quantity will be set to the SI base unit corresponding to the Quantity's physical dimension. Furthermore, the display precision of the resulting Quantity will be the maximum of the display precisions of the operands.
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 | Sum of all numerical quantities |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
QuantityTerm | Quantity | Term | - | [1..*] | Quantity values are added |
NumericTerm | Numeric | Term | - | [0..*] | Numeric values are added |
OTL Examples
/// Local Declarations
Quantities.Quantity Quantity;
/// Flow
// The assignment below will have the returned value: 2011 m (2011 [@Unit, "BL_DataLibraMIB.odx", "m"])
Quantity = (2 [@Unit, "BL_DataLibraMIB.odx", "km"] + 1 [@Unit, "BL_DataLibraMIB.odx", "m"]) + 11;
See also
Conversions
Subtraction
Multiplication
Division
Modulo
Absolute Value
Negation
Relational Operations
Other Operations