Click or drag to resize

Quantity Class

A data quantity is a combination of an ID and an EUM item and unit.

The data item type is one of the EUM types

For AD components, they will usually have the same datatype but different ID's.

It is not allowed to edit an IQuantity. Create a new one, if required.

Inheritance Hierarchy

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
[SerializableAttribute]
public class Quantity : IQuantity, IEquatable<IQuantity>

The Quantity type exposes the following members.

Constructors
  NameDescription
Public methodQuantity
Default constructor, creates and undefined quantity. COM requires empty constructor. Afterwards use Create(eumItem, String, String) to create the quantity.
Public methodQuantity(eumItem, String)
Construct data quantity from eumItem and description
Public methodQuantity(eumQuantity, String)
Construct data quantity from eumItem and description
Public methodQuantity(String, String, eumItem)
Construct data quantity from eumItem and description
Public methodQuantity(String, String, eumItem, eumUnit)
Construct data quantity from eumItem and description
Top
Properties
  NameDescription
Public propertyDescription
Quantity description
Public propertyEumQuantity
EumQuantity (item type and unit)
Public propertyId
ID of the quantity. The ID is unique for a specific type of quantity within MIKE 1D. Two quantities with different Ids are not equal to each other.
Public propertyTimeValueType
Type of value in time stored by the quantity.
Public propertyStatic memberUndefined
Return a wuantity based on eumItem.eumIItemUndefined
Top
Methods
  NameDescription
Public methodStatic memberAppendNum
Append the number in the id and description string of the quantity.
Public methodStatic memberAppendZoneNum
Create zone quantity

This is used by the NAM model to create snow zone quantities.

Append the number in the id (if larger than one) and prepend "Zone X" to description of quantity.

If the description already contains "Zone", it is replaced by "Zone X"

Public methodStatic memberComparerDescription
Provides a equality comparer that also includes the Description in the comparison
Public methodStatic memberComparerGroup
Provides a equality comparer that groups quantities of the same type.

Quantities like SnowCover, SnowCover_2, SnowCover_3 are in this context grouped under one.

Public methodStatic memberCreate(PredefinedQuantity)
Create a Quantity based on one of the PredefinedQuantity
Public methodStatic memberCreate(PredefinedQuantity, eumUnit)
Create a Quantity based on one of the PredefinedQuantity
Public methodStatic memberCreate(PredefinedQuantity, String)
Create a Quantity based on one of the PredefinedQuantity
Public methodCreate(eumItem, String, String)
Create a new Quantity. Not static for COM support.
Public methodStatic memberCreateVariable
Create a quantity for control module variable
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Overrides ObjectEquals(Object).)
Public methodEquals(IQuantity)
Indicates whether the current object is equal to another object of the same type.
Public methodStatic memberEquals(IQuantity, IQuantity)
Equals method on BaseId, which is the Id with commas and spaces removed.
Public methodStatic memberEqualsBaseId
Equals method on BaseId, which is the Id with commas and spaces removed.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Public methodStatic memberGetHashCode(IQuantity)
Serves as a hash function for this type. Uses the Id of the quantity as specified, but not the description.
Public methodStatic memberGetHashCodeBaseId
Serves as a hash function based on Base Id.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGuessUnitFromString
Try guess an eum unit from a string.

For this to work, be sure to use a string matching the Description ("Desc") of an eumUnit.

If the string does not exactly any unit, a set of common abbreviations are tried.

If no success, eumUUnitUndefined is returned.

Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberPrependNum
Prepend the number in the id string of the quantity.
Public methodStatic memberToBaseId
Converting a Quantity Id to its base form, without commas and spaces
Public methodToString
Return eumItemType and description as a string
(Overrides ObjectToString.)
Top
See Also