Class DisplayUnitOfMeasure
- Namespace
- Geotab.Checkmate.ObjectModel.Engine.DisplayDiagnostic
- Assembly
- Geotab.Checkmate.ObjectModel.dll
public class DisplayUnitOfMeasure : NameEntityWithVersion, IEntity, IComparable, IIdentifiable, IVersion
- Inheritance
-
DisplayUnitOfMeasure
- Implements
- Inherited Members
Constructors
DisplayUnitOfMeasure()
Initializes a new instance of the DisplayUnitOfMeasure class.
public DisplayUnitOfMeasure()
DisplayUnitOfMeasure(Id, long?, Id, double, double, bool, string?)
Initializes a new instance of the DisplayUnitOfMeasure class.
public DisplayUnitOfMeasure(Id identity, long? version, Id baseId, double factor, double offset, bool inversion, string? name)
Parameters
identity
IdThe identifier.
version
long?The version.
baseId
IdThe identifier for the base unit of measure.
factor
doubleThe conversion factor from base UnitOfMeasure to DisplayUnitOfMeasure.
offset
doubleThe conversion offset from base UnitOfMeasure to DisplayUnitOfMeasure.
inversion
boolIndicates whether there is an inversion relation from base UnitOfMeasure to DisplayUnitOfMeasure.
name
stringThe description of the unit of measure.
Properties
BaseId
Gets or sets the Identifier of the base unit of measure.
public Id BaseId { get; set; }
Property Value
FactorFromBase
Gets or sets the conversion factor from base units to the current unit.
public double FactorFromBase { get; set; }
Property Value
InversionOperation
Gets or sets a value indicating whether gets or sets whether or not an inversion operation is performed on unit conversion.
public bool InversionOperation { get; set; }
Property Value
OffsetFromBase
Gets or sets the offset to convert from base unit to current unit.
public double OffsetFromBase { get; set; }
Property Value
Methods
Clone()
Creates a new object that is a copy of the current instance.
public override IEntity Clone()
Returns
- IEntity
A new object that is a copy of this instance.
Convert(double)
Converts number from representation in base unit of measure to display unit of measure.
public double Convert(double original)
Parameters
original
doubleThe original value to be converted.
Returns
- double
The converted display unit.
Exceptions
- ArgumentException
Division by zero is not allowed for inversion operations.
Convert(int)
Converts number from representation in base unit of measure to display unit of measure.
public int Convert(int original)
Parameters
original
intThe original value to be converted.
Returns
- int
The converted display unit.
Exceptions
- ArgumentException
Inversion operations not allowed for integer values.
InverseConvert(double)
Converts number from representation in display unit of measure to base unit of measure.
public double InverseConvert(double original)
Parameters
original
doubleThe original value to be converted.
Returns
- double
The value in base unit.
Exceptions
- ArgumentException
Inversion operations not allowed for zero original value.
InverseConvert(int)
Converts number from representation in display unit of measure to base unit of measure.
public int InverseConvert(int original)
Parameters
original
intThe original value to be converted.
Returns
- int
The value in base unit.
Exceptions
- ArgumentException
Inversion operations not allowed for integer values.
IsSystemEntity()
Denotes whether an instance is user created or system supported.
public override bool IsSystemEntity()
Returns
- bool
true for all display units of measure.