Units

Units are the actual quantity associated with a parameter that define how a value is converted from another unit to the given unit. Almost all units can be converted by using a single multiplicative value; thus, no Java coding is required. The definition will reside entirely within the metamodel. Anything more complex (log, sin, etc.) requires Java coding.

When creating the new Unit, it must have a Category as its supername. If it is a standard unit that does not need any additional Java code, the runtime is com.engineous.sdk.unit.StandardUnit with parameters that contain the values of the symbol, the conversion factor, and a series of comma separated tags. If custom Java code is used, the runtime class must implement the interface “UnitProper,” which requires that only the symbol and tags be defined.

Example Unit (no custom code)

<MetaModel name="com.engineous.unit.length.Metric 
supername="com.engineous.unit.Length" superversion="2.*.*" 
version="3.0.0">
<Requires>
<SystemRelease>5.6+</SystemRelease>
</Requires>
<DisplayName>meter</DisplayName>
<Description>Base unit of length</Description>
<Runtime 
type="com.engineous.sdk.vars.Unit">com.engineous.sdk.unit.St
andardUnit</Runtime>
<Variables>
<Variable mode="local" name="symbol" role="property" 
structure="scalar" tag="symbol" 
type="com.engineous.datatype.String">
<Value>m</Value>
</Variable>
<Variable mode="local" name="conversion" role="property" 
structure="scalar" tag="conversion"> 
type="com.engineous.datatype.Real">
<Value>1</Value>
</Variable>
<Variable mode="local" name="tags" role="property" 
structure="scalar" tag="tags"> 
type="com.engineous.datatype.String">
<Value>SI</Value>
</Variable>
</Variables>
</MetaModel>

Example Unit (custom code)

<MetaModel 
name="com.engineous.unit.thermodynamic_temperature.celsius.Celsius" 
version="2.0.0" 
supername="com.engineous.unit.thermodynamic_temperature.ThermodynamicTem
perature" superversion="2.*.*">
<Requires>
<SystemRelease>2017</SystemRelease>
</Requires>
<DisplayName>Celsius</DisplayName>
<Description></Description>
<Runtime 
type="com.engineous.sdk.vars.Unit">com.engineous.unit.thermo
dynamic_temperature.celsius.StandardCelsiusUnit</Runtime>
<Variables>
<Variable name="abbreviation" tag="abbreviation" 
role="property" mode="local" structure="scalar" 
type="com.engineous.datatype.String">
<Value>C</Value>
</Variable>
Variable mode="local" name="tags" role="property" 
structure="scalar" tag="tags" 
type="com.engineous.datatype.String">
<Value>Non SI</Value>
</Variable>
</Variables>
</MetaModel>