|
def | __init__ (self, unitType=UnitType.UNCLASSIFIED, name=None, symbol=None, description=None) |
|
def | __hash__ (self) |
|
def | __eq__ (self, other) |
|
def | __lt__ (self, other) |
|
def | __gt__ (self, other) |
|
def | __ne__ (self, other) |
|
def | __str__ (self) |
|
def | setBaseSymbol (self, symbol) |
|
def | setPowerProduct (self, uom1, exponent1, uom2, exponent2) |
|
def | setProductUnits (self, multiplier, multiplicand) |
| Set the multiplier and multiplicand. More...
|
|
def | setQuotientUnits (self, dividend, divisor) |
| Set the dividend and divisor. More...
|
|
def | getMeasurementType (self) |
| Get the measurement type. More...
|
|
def | getReducer (self) |
|
def | getBaseUnitsOfMeasure (self) |
| Get the most reduced units of measure. More...
|
|
def | isTerminal (self) |
| Check to see if this unit of measure has a conversion to another unit of measure other than itself. More...
|
|
def | setBridgeConversion (self, scalingFactor, abscissaUnit, offset) |
|
def | setConversion (self, scalingFactor, abscissaUnit, offset=0.0) |
| Define a conversion with the specified scaling factor, abscissa unit of measure and scaling factor. More...
|
|
def | getPowerExponent (self) |
| Get the exponent of a power unit. More...
|
|
def | getDividend (self) |
| Get the dividend unit of measure. More...
|
|
def | getDivisor (self) |
| Get the divisor unit of measure. More...
|
|
def | getMultiplier (self) |
| Get the multiplier. More...
|
|
def | getMultiplicand (self) |
| Get the multiplicand. More...
|
|
def | setPowerUnit (self, base, exponent) |
| Set the base unit of measure and exponent. More...
|
|
def | clonePower (self, uom) |
|
def | classify (self) |
| If the unit of measure is unclassified, from its base unit map find a matching unit type. More...
|
|
def | getBaseSymbol (self) |
| Get the unit of measure symbol in the fundamental units for that system. More...
|
|
def | traversePath (self) |
|
def | checkOffset (self, other) |
|
def | clearCache (self) |
|
def | clonePowerProduct (self, uom1, uom2) |
|
def | multiplyOrDivide (self, other, invert) |
|
def | convertScalarToScalar (self, targetUOM) |
|
def | getBridgeFactor (self, uom) |
|
def | divide (self, divisor) |
| Divide two units of measure to create a third one. More...
|
|
def | getBaseUOM (self) |
|
def | convertUnit (self, targetUOM) |
|
def | getConversionFactor (self, targetUOM) |
| Get the factor to convert to the unit of measure. More...
|
|
def | getPowerBase (self) |
| Get the base unit of measure for the power. More...
|
|
def | invert (self) |
| Invert a unit of measure to create a new one. More...
|
|
def | multiply (self, multiplicand) |
| Multiply two units of measure to create a third one. More...
|
|
The UnitOfMeasure class represents a unit of measure.
A UnitOfMeasure can have a linear conversion (y = ax + b) to another unit of measure in the same internationally recognized measurement system of International Customary, SI, US or British Imperial. Or, the unit of measure can have a conversion to another custom unit of measure. It is owned by the unified MeasurementSystem defined by this project.
A unit of measure is categorized by scalar (simple unit), quotient (divisor and dividend units), product (multiplier and multiplicand units) or power (unit with an integral exponent). More than one representation of a unit of measure is possible. For example, a unit of "per second" could be a quotient of "1/s" (e.g. an inverted second) or a power of s^-1.
A unit of measure also has an enumerated UnitType (for example LENGTH or MASS) and a unique Unit discriminator (for example METRE).
A basic unit (a.k.a fundamental unit in the SI system) can have a bridge conversion to another basic unit in another recognized measurement system. This conversion is defined unidirectionally. For example, an International Customary foot is 0.3048 SI metres. The conversion from metre to foot is just the inverse of this relationship.
A unit of measure has a base symbol, for example 'm' for metre. A base symbol is one that consists only of the symbols for the base units of measure. In the SI system, the base units are well-defined. The derived units such as Newton all have base symbols expressed in the fundamental units of length (metre), mass (kilogram), time (second), temperature (Kelvin), plane angle (radian), electric charge (Coulomb) and luminous intensity (candela). In the US and British systems, base units are not defined. Caliper uses foot for length, pound mass for mass and Rankine for temperature. This base symbol is used in unit of measure conversions to uniquely identify the target unit.
The SI system has defined prefixes (e.g. "centi") for 1/100th of another unit (e.g. metre). Instead of defining all the possible unit of measure combinations, the MeasurementSystem is able to create units by specifying the Prefix and target unit of measure. Similarly, computer science has defined prefixes for bytes (e.g. "mega").