UNIT
Unit definitions allow additional units to be specified by this ECU definition file that are not in the list of predefined units (See Units and Quantities).
| Field Name | Definition |
|---|---|
| UNIT | This is entered as is and defines the values as a unit definition. |
| Name | Defines the name of the unit. If blank, this is the same as the unit ID’s unit name. |
| Unit ID | Defines the unit ID of this unit. e.g. afr:AFR Ammonia for Air Fuel Ratio This MUST include the quantity ID of the unit and the unit identifier. |
| Display Unit | The display unit. If blank, this is the same as the unit IDs unit name |
| Aliases | Semicolon separated list of aliases used for lookups. E.g. km/h might have an alias ‘kph’. |
| M | Defines the default scalar. Defaults to 1. This value indicates the linear conversion from the relative unit to convert from a value in the relative unit to this one. For example, if defining kilograms relative to grams, then the scaling factor would be 0.001. |
| C | Defines the default offset. Defaults to 0. As with ‘M’ this is the offset from the relative unit being derived from. |
| Relative To | Unit ID of the unit that this unit is derived from. If not given, the scaling is relative to the reference ‘unity scaled’ (root) unit for the given quantity. A quantity must always have a ‘root’ unit. The quantity does not need to be provided here – derived units may only belong to the same quantity as the unit they are relative to. If the quantity is given it will be checked. |
Example:
1// [UNITQUANTITY,CPU Power,cpu_power][DESCRIPTION,CPU Processing Power]
2// [UNIT,FLOPS,cpu_power:flops,FLOPS,,,,][DESCRIPTION,Floating Point Ops / Second]
3// [UNIT,Kilo FLOPS,cpu_power:kflops,KFLOPS,kiloflops,0.001,0,cpu_power:flops]
4// [UNIT,Mega FLOPS,cpu_power:mflops,MFLOPS,megaflops,0.001,0,cpu_power:kflops]
5// [UNIT,Giga FLOPS,cpu_power:gflops,GFLOPS,gigaflops,0.001,0,cpu_power:mflops]
6// [UNIT,Tera FLOPS,cpu_power:tflops,TFLOPS,teraflops,0.001,0,cpu_power:gflops]
7// [UNIT,Peta FLOPS,cpu_power:pflops,PFLOPS,petaflops,0.001,0,cpu_power:tflops]
8// [UNIT,Exa FLOPS,cpu_power:eflops,EFLOPS,exaflops,0.001,0,cpu_power:pflops]