Click or drag to resize
OSIsoft, LLC

UOM Class

The unit-of-measure object describes the units of a value.

Inheritance Hierarchy

Namespace:  OSIsoft.AF.UnitsOfMeasure
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.6.195
Syntax
[SerializableAttribute]
public sealed class UOM : AFObject, IComparable<UOM>

The UOM type exposes the following members.

Properties
  NameDescription
Public propertyAbbreviation
This property provides a unique abbreviation for the unit of measure.
Public propertyClass
This read-only property indicates the class of measurement for this unit of measure.
Public propertyDatabase
This read-only property allows access to the UOMDatabase associated with this object.
Public propertyDayBasedTimeIntegralUOM
Returns the UOM that corresponds to the day-based time integral of this UOM or if none is defined.
Public propertyDeltaUOM
The UOM that corresponds to the difference in two quantities in this UOM.
Public propertyDescription
Read/write property that provides a more detailed description of the object.
Public propertyFactor
This read-only property provides the conversion factor to the canonical unit for this unit of measure.
Public propertyID
Read-only property that provides a unique identifier for the object to be used for quick access that is not dependent upon the index.
(Inherited from AFObject.)
Public propertyIdentity
This read-only property contains identity of the object.
(Inherited from AFObject.)
Public propertyIsDeleted
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.)
Public propertyName
Read/write property that identifies the name of the object.
Public propertyOffset
This read-only property provides the conversion offset to the canonical unit for this unit of measure.
Public propertyOrigin
This read-only property indicates the origin of this unit of measure.
Public propertyPISystem
This read-only property allows access to the PISystem associated with this object.
(Inherited from AFObject.)
Public propertyRefFactor
This property provides the conversion factor to the reference unit of measure for this unit of measure.
Public propertyRefFormulaFrom
This property provides the formula to convert from the reference unit of measure to this unit of measure.
Public propertyRefFormulaTo
This property provides the formula to convert to the reference unit of measure from this unit of measure.
Public propertyRefOffset
This property provides the conversion offset to the reference unit of measure for this unit of measure.
Public propertyRefUOM
This property indicates the reference unit of measure for this unit of measure.
Public propertyTimeIntegralUOM
The UOM that corresponds to the time integral of this UOM.
Public propertyUniqueID
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.)
Top
Methods
  NameDescription
Public methodCompareTo(Object)
Compares this instance with a specified Object.
(Inherited from AFObject.)
Public methodCompareTo(AFObject)
Compares this instance with a specified AFObject.
(Inherited from AFObject.)
Public methodConvert
This method converts the specified value from the specified unit of measure (UOM) to the UOM represented by this object.
Public methodEquals(Object)
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.)
Public methodEquals(AFObject)
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.)
Public methodStatic memberFindUOMs
Performs a non-paged text search within the UOMDatabase to retrieve a collection of UOM objects which have a field that match the specified query string.
Public methodGetGroupMapping
Gets the mapped UOM defined by a UOMGroup for the current UOM.
Public methodGetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from AFObject.)
Public methodGetPath
Returns the full path to the object, using just the names.
(Inherited from AFObject.)
Public methodGetPath(AFObject)
Returns the path to the object relative from another object.
(Inherited from AFObject.)
Public methodGetPath(AFEncodeType, AFObject)
Returns the path to the object relative from another object, using the name and/or id as specified by encodeType.
(Inherited from AFObject.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodPersist
This method returns the persistence string for the object.
(Inherited from AFObject.)
Public methodToString
Returns a String that represents the current object.
(Inherited from AFObject.)
Public methodUpdate
This method updates the conversion factors for this unit of measure (UOM).
Public methodCode exampleUpdateFormula
This method updates the conversion formulas for this unit of measure (UOM).
Top
Remarks
The unit-of-measure (UOM) object describes the units of a value. The UOM also contains information needed to convert one unit to another unit.
Examples
// This example will create several UOMs of the same UOM class
// and then demonstrate how to perform conversions between them.

// Get the Database
PISystems myPISystems = new PISystems();
UOMDatabase myDB = myPISystems.DefaultPISystem.UOMDatabase;

// Set the UOM Class
UOMClass LengthUOMClass = myDB.UOMClasses.Add("QALength", "QAmeter", "QAm");

// Create UOMs
UOM Meter = myDB.UOMs["QAmeter"];
UOM Inch = myDB.UOMs.Add("QAinch", "QAin", Meter, 0.0254, 0);
UOM Foot = myDB.UOMs.Add("QAfoot", "QAft", Inch, 12, 0);
UOM Yard = myDB.UOMs.Add("QAyard", "QAyd", Inch, 3 * 12, 0);
UOM Mile = myDB.UOMs.Add("QAmile", "QAmi", Foot, 5280, 0);

// Display Information each UOM
foreach (UOM CurUom in myDB.UOMClasses["QALength"].UOMs)
{
    Console.WriteLine("Name of UOM = {0}", CurUom.Name);
    Console.WriteLine("Abbreviation = {0}", CurUom.Abbreviation);
}

// Convert 18 Inches to Feet
Console.WriteLine("18 Inches converted to Feet = {0}", Foot.Convert(18, Inch));

// Update the Formula for the Yard UOM
Yard.Update(Foot, 3.0, 0);

// Convert 18 Inches to Yards
Console.WriteLine("18 Inches converted to Yards = {0}", Yard.Convert(18, Inch));
Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence