Unit Category

Unit categories define groups of related units, such as length, area, or time. Their relation is defined by how all the units convert to/from the base unit of the category. In the case of the unit category “length,” all members are described in relation to the base unit “meter.” Because all units that fall under that category can provide a simple conversion to that base unit, this allows conversion to any other unit under that category.

When creating new unit categories, the metamodel must define the Base SI unit for conversion and have com.engineous.system.unit.UnitCategory as its supername. To define the base unit, define a string parameter whose value is the classpath of the base unit.

All unit categories must ultimately make use of a “UnitCategory” class (most likely “StandardUnitCategory”) as its Runtime class.

Example Unit Category

<MetaModel name="com.engineous.unit.Length" version="2.0.0" 
supername="com.engineous.system.unit.UnitCategory" superversion="2.*.*">
<Requires>
<SystemRelease>2017</SystemRelease>
</Requires>
<DisplayName>Length</DisplayName>
<Description>The distance between two points</Description>
<Runtime 
type="com.engineous.sdk.vars.Unit">com.engineous.sdk.unit.St
andardUnitCategory</Runtime>
<Variables>
<Variable name="base" tag="base" role="property" 
mode="local" structure="scalar" 
type="com.engineous.datatype.String">
<Value>com.engineous.unit.length.metric.Meter</Value>
</Variable>
</Variables>
</MetaModel>