Unit Editor
Units used in TPT are listed in the Unit Editor. The Unit Editor contains units that are part of the International System of Units (kg, m, s, A, K, mol, cd), TPT specific units (µs, ms, min, h, d) and the unit radian. These units cannot be customized. In addition, new units can be created based on the units that are part of the International System of Units.
Units can be used in calculations. To enable this function, see Units.
The following icons can be used to add, delete or duplicate units. You can rearrange units in the list and import or export them from or to an XML file, see Figure "Components of the Unit Editor".
creates a new unit | |
duplicates the selected unit | |
deletes the selected unit | |
exports units to XML file |
|
imports units from XML file | |
moves the selected unit up | |
moves the selected unit down |
Search units
To search units in the list depending on their names, enter a term in the search text field. To activate the use of regular expressions for search, select the Regular Expressions checkbox. For example, the term ^M.*(g|y)$ will search a unit name that begins with an M and ends with an g or an y. The search is not case-sensitive.
Create or customize units
Units that are part of the International System of Units (kg, m, s, A, K, mol, cd) and also TPT specific units (us, usec, ms, msec, min, h, d) cannot be changed or deleted. These predefined units are displayed in green.
Name
Choose a name for the unit. The name must be unique within the TPT project and differ from the symbol names of the other units listed in the Unit Editor.
Symbol
The symbol must be unique within the TPT project and differ from the names of the other units listed in the Unit Editor. It is composed of alphanumeric characters (A-Z, a-z, 0-9). You can use underscores "_".
The symbol must not start
- with a number
- with "E" or "e" followed by a number
- with "L" or "l"
- with "j"
Factor
Units may have a constant factor:
<unit name> = <factor> * <base unit dependency>
For example, min = 60 * 1 s. Factors can also be specified as a fraction of two integers, and powers. For powers the bases 10, 2 or Pi can be used, see Figure "Components of the Unit Editor".
For the values of the decimal and binary prefixes, click Import the factor coefficients.
Prefix type | Name | Prefix | Value |
---|---|---|---|
decimal prefix | pico nano micro milli centi deci deca hecto kilo mega giga |
p n u m c d da h k M G |
10^-12 10^-9 10^-6 10^-3 10^-2 10^-1 10^1 10^2 10^3 10^6 10^9 |
binary prefix | kibi mebi gibi tebi |
Ki Mi Gi Ti |
2^10 2^20 2^30 2^40 |
Offset
Units may have a constant offset:
<unit name> = <base unit dependency> + <offset>
For example, celsius = 1 K + 273.15
Base unit dependency
Every unit depends on one of the base units: kg, m, s, A, K, mol, cd.
Click to add further base units to the Base unit dependency line, for example, rad, bit or %, see Figure "Components of the Unit Editor". All other user defined base units can be used. Type 0 as exponent to remove them from the line.
When importing interfaces, see Declarations - Import Interface, into TPT, units can also be imported. Units, which are unknown to TPT (no unit with the same name or symbol exists), are added automatically into the Unit Editor by TPT. They are marked with the term (base unit). The Base unit dependency of these units must be entered manually, see Figure "Units imported into TPT project".
Representation
The formula of the unit specification of the unit is displayed, see Figure "Components of the Unit Editor".