Difference between revisions of "Extensions.Quantities.GetDisplayUnit"

From emotive
Jump to navigation Jump to search
 
Line 9: Line 9:
  
 
== Description ==
 
== Description ==
The '''GetDisplayUnitName''' term shall extract the display unit out of a '''Quantity''' value (e.g. "mp/h", "km/h", "h", "sec" etc.).
+
The '''GetDisplayUnitName''' term will extract the display unit out of a '''Quantity''' value (e.g. "mp/h", "km/h", "h", "sec" etc.).
  
 
{{TermReturnValue| [[Extensions.Quantities.Unit|Unit]] | The display unit of a '''Quantity''' value}}
 
{{TermReturnValue| [[Extensions.Quantities.Unit|Unit]] | The display unit of a '''Quantity''' value}}
Line 16: Line 16:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie2| Quantity | [[Extensions.Quantities.Quantity|Quantity]] | [[Term]] | - | [1] | Represents the '''Quantity''' from which the display unit should be extracted.}}
+
{{TableRowPropertie2| Quantity | [[Extensions.Quantities.Quantity|Quantity]] | [[Term]] | - | [1] | Represents the '''Quantity''' from which the display unit will be extracted.}}
 
|}
 
|}
  

Latest revision as of 03:11, 13 September 2019

Classification

Name GetDisplayUnit
Short Description Gets the display unit of a Quantity value
Class Term
Extension OTX Quantities extension
Group Quantity and Unit related terms
Exceptions UnknownUnitException
Checker Rules -
Standard Compliant Yes

OTL Syntax

UnitTerm Quantities.GetDisplayUnit(QuantityTerm quantity);

Description

The GetDisplayUnitName term will extract the display unit out of a Quantity value (e.g. "mp/h", "km/h", "h", "sec" etc.).

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Unit The display unit of a Quantity value

Properties

Name Data Type Class Default Cardinality Description
Quantity Quantity Term - [1] Represents the Quantity from which the display unit will be extracted.

OTL Examples

/// Local Declarations

Quantities.Quantity Quantity = 12.44 [@Unit, "BL_DataLibraMIB.odx", "km/h"];
Quantities.Unit Unit1;

/// Flow

Unit1 = Quantities.GetDisplayUnit(Quantity);

See also

CreateQuantity
GetDisplayValue
GetBaseUnit