Difference between revisions of "Extensions.I18n.LocalizeQuantityToUnitGroup"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''LocalizeQuantityToUnitGroup '''}}[[Category:i18n]]
 
{{DISPLAYTITLE:  '''LocalizeQuantityToUnitGroup '''}}[[Category:i18n]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | LocalizeQuantityToUnitGroup | Transforms a NumericQuantity to a particular group of units | [[Term]] | [[Extensions.I18n|OTX i18n extension]] | [[Quantity related terms]] | [[Core.Actions.Throw.Exception.UnknownUnitException|UnknownUnitException]] <br/> [[Core.Actions.Throw.Exception.InvalidConversionException|InvalidConversionException]] | [[Extensions.Quantities.QuantitiesChk001|Quantities_Chk001]] }}
+
{{ClassificationActivity | LocalizeQuantityToUnitGroup | Creates a version of a Quantity localized to a specific unit group | [[Term]] | [[Extensions.I18n|OTX i18n extension]] | [[Extensions.I18n#Terms|Quantity related terms]] | [[Extensions.Quantities.UnknownUnitException|UnknownUnitException]] <br/> [[Extensions.Quantities.InvalidConversionException|InvalidConversionException]] | [[Extensions.Quantities.QuantitiesChk001|Quantities_Chk001]] }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
QuantityTerm = I18n.LocalizeQuantityToUnitGroup(QuantityTerm, EquivalentUnitGroup);
+
QuantityTerm = I18n.LocalizeQuantityToUnitGroup(QuantityTerm, UnitGroupDefinition);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''LocalizeQuantityToUnitGroup''' term is a ''NumericQuantity'' turn to a particular group of units.
+
The '''LocalizeQuantityToUnitGroup''' term shall create a version of a '''Quantity''' localized to a specific unit group.
  
{{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | A transformed '''NumericQuantity''' in a specified unit group.}}
+
There are two different types of unit groups: country and equivalent unit groups. This term shall create a new '''Quantity''' containing the display unit given by the new group that is equivalent to the display unit of the original '''Quantity'''.
 +
 
 +
{{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | A new '''Quantity''' contains the display unit given by the new group}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Quantity | [[Extensions.Quantities.Quantity|Quantity]] | [[Term]] | - | [1] | The Quantity that is located in the specified unit group.}}
+
{{TableRowPropertie1| Quantity | [[Extensions.Quantities.Quantity|Quantity]] | [[Term]] | - | [1] | This represents the quantity that shall be localized using the given country unit group name.}}
{{TableRowPropertie2| EquivalentUnitGroup | - | [[Reference]] | - | [1] | Reference to the appropriate location in an XML document with the correct specification of the unit in a form of UNIT-SPEC elements of the ISO standard ODX}}
+
{{TableRowPropertie2| EquivalentUnitGroup | [[UnitGroupDefinition]] |-| - | [1] | Represents the UNIT-GROUP definition that shall be used as the target for unit localization.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Quantities.Quantity Quantity1;
+
Quantities.Quantity Quantity1 = 6 [@Unit, "ODX_RS_UNIT_LIB.odx", "A/m²"];
 
Quantities.Quantity Quantity2;
 
Quantities.Quantity Quantity2;
  
Quantity2 = I18n.LocalizeQuantityToUnitGroup(Quantity1, null);
+
/// Flow
 +
 
 +
Quantity2 = I18n.LocalizeQuantityToUnitGroup(Quantity1);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
 
[[Extensions.I18n.LocalizeQuantity|LocalizeQuantity]]
 
[[Extensions.I18n.LocalizeQuantity|LocalizeQuantity]]

Revision as of 03:43, 1 October 2018

Classification

Name LocalizeQuantityToUnitGroup
Short Description Creates a version of a Quantity localized to a specific unit group
Class Term
Extension OTX i18n extension
Group Quantity related terms
Exceptions UnknownUnitException
InvalidConversionException
Checker Rules Quantities_Chk001
Standard Compliant Yes

OTL Syntax

QuantityTerm = I18n.LocalizeQuantityToUnitGroup(QuantityTerm, UnitGroupDefinition);

Description

The LocalizeQuantityToUnitGroup term shall create a version of a Quantity localized to a specific unit group.

There are two different types of unit groups: country and equivalent unit groups. This term shall create a new Quantity containing the display unit given by the new group that is equivalent to the display unit of the original Quantity.

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
Quantity A new Quantity contains the display unit given by the new group

Properties

Name Data Type Class Default Cardinality Description
Quantity Quantity Term - [1] This represents the quantity that shall be localized using the given country unit group name.
EquivalentUnitGroup UnitGroupDefinition - - [1] Represents the UNIT-GROUP definition that shall be used as the target for unit localization.

OTL Examples

Quantities.Quantity Quantity1 = 6 [@Unit, "ODX_RS_UNIT_LIB.odx", "A/m²"];
Quantities.Quantity Quantity2;

/// Flow

Quantity2 = I18n.LocalizeQuantityToUnitGroup(Quantity1);

See also

LocalizeQuantity