AP&C API Reference
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Apac.Monitoring.Measurement Class Reference

This class represents a basic measurement in the system, in the abstract. Subclasses are required to define the type Value property. This will give rise to specific measurement types such as UnsignedNumericMeasurement, BinaryMeasurement, etc. More...

Inheritance diagram for Apac.Monitoring.Measurement:
Apac.Monitoring.ITimeStamped Apac.Monitoring.MeasurementAvg Apac.Monitoring.WeightedMeasurementAvg

Public Member Functions

 Measurement (DateTime timestamp, ManagedElement element)
 
 Measurement (DateTime timestamp, ManagedElement element, decimal compiledValue, string fullSource)
 
void AddReading (Reading reading)
 Adds a reading. More...
 
void AddSourceMeasurement (Measurement sourceMeasurement)
 Adds a source measurement. More...
 
Reading GetReadingByName (string tagName)
 Gets the reading with tagName . More...
 
Measurement FindSourceMeasurementByTag (string tag)
 Finds a source measurement by tag. More...
 
virtual decimal GetAggregateSourceValue ()
 Provides an easy way for subclasses to define the aggregate source value, in the event that there are multiple readings. This value may not be meaningful for all measurements. More...
 
void Abort ()
 Aborts the measurement. More...
 
bool IsAborted ()
 Determines if the measurement has been aborted. More...
 
override string ToString ()
 Returns a System.String that represents this instance. More...
 
virtual void GetObjectData (SerializationInfo info, StreamingContext context)
 Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object. More...
 
int CompareTo (object obj)
 Compares the current instance with another object of the same type. More...
 

Static Public Attributes

static readonly string TimestampFormat = "yyyymmddThhMMss.ffffffzzz"
 

Protected Member Functions

 Measurement (SerializationInfo info, StreamingContext context)
 Creates a measurement and sets its timestamp to 'now'. More...
 
virtual int OnCompareTo (object obj)
 Called when [compare to]. More...
 

Properties

ManagedElement Element [get]
 
Reading[] Readings [get]
 Gives subclasses access to the list of readings. More...
 
Measurement[] SourceMeasurements [get]
 Gives subclasses access to the list of source measurements. More...
 
int ReadingCount [get]
 Gets the reading count. More...
 
int SourceMeasurementCount [get]
 Gets the source measurement count. More...
 
uint? ElementId [get]
 Gets the identifier of the element to which this measurement applied. More...
 
virtual decimal CompiledValue [get, set]
 Gets or sets the compiled value. More...
 
DateTime Timestamp [get, set]
 
string TimestampISO [get]
 Gets the timestamp in ISO string format. More...
 
int Bucket [get]
 Gets the bucket to which the measurement belongs. More...
 
int Offset [get]
 Gets the time offset (in seconds) into the bucket to which this measurement belongs. More...
 
string FullSource [get]
 Gets the name source for this measurement instance. More...
 
string UnitLabel [get, set]
 Gets or sets a value indicating whether this instance is aggregate. More...
 
object Tag [get, set]
 Aggregates the specified compiled addition to the current compiled value and flags this instance as aggregated (IsAggregate == true). More...
 
- Properties inherited from Apac.Monitoring.ITimeStamped
DateTime Timestamp [get]
 Gets the timestamp. More...
 
int Bucket [get]
 Gets the bucket, which is a five minute period. There are 12 buckets in an hour and 288 buckets in a day. More...
 
int Offset [get]
 Gets the offset into the bucket in seconds. More...
 

Detailed Description

This class represents a basic measurement in the system, in the abstract. Subclasses are required to define the type Value property. This will give rise to specific measurement types such as UnsignedNumericMeasurement, BinaryMeasurement, etc.

Template Parameters
ValueTypeThe type of the alue type.

Constructor & Destructor Documentation

◆ Measurement()

Apac.Monitoring.Measurement.Measurement ( SerializationInfo  info,
StreamingContext  context 
)
inlineprotected

Creates a measurement and sets its timestamp to 'now'.

Parameters
elementIdThe identifier for the element to which this measurement applies.
valueThe reading for the measurement.
sourceThe source component that gathered the measurement.
sensoridThe identifier for the sensor from which the reading came.

Creates a measurement and sets its timestamp as supplied.

Parameters
elementIdThe identifier for the element to which this measurement applies.
valueThe reading for the measurement.
timestampThe date and time the measurement was taken.
sourceThe source component that gathered the measurement.
sensoridThe identifier for the sensor from which the reading came.

Creates a measurement and sets its timestamp and compiled value as supplied.

Parameters
elementIdThe identifier for the element to which this measurement applies.
valueThe reading for the measurement.
compiledValueThe compiled or computed value for the measurement.
timestampThe date and time the measurement was taken.
sourceThe source component that gathered the measurement.
sensoridThe identifier for the sensor from which the reading came.

Member Function Documentation

◆ Abort()

void Apac.Monitoring.Measurement.Abort ( )
inline

Aborts the measurement.

◆ AddReading()

void Apac.Monitoring.Measurement.AddReading ( Reading  reading)
inline

Adds a reading.

Parameters
readingThe reading.

◆ AddSourceMeasurement()

void Apac.Monitoring.Measurement.AddSourceMeasurement ( Measurement  sourceMeasurement)
inline

Adds a source measurement.

Parameters
sourceMeasurementThe source measurement.

◆ CompareTo()

int Apac.Monitoring.Measurement.CompareTo ( object  obj)
inline

Compares the current instance with another object of the same type.

Parameters
objAn object to compare with this instance.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj.
Exceptions
T:System.ArgumentExceptionobj is not the same type as this instance.

◆ FindSourceMeasurementByTag()

Measurement Apac.Monitoring.Measurement.FindSourceMeasurementByTag ( string  tag)
inline

Finds a source measurement by tag.

Parameters
tagThe tag.
Returns
Returns the requested measurement, or null if it cannot be found.

◆ GetAggregateSourceValue()

virtual decimal Apac.Monitoring.Measurement.GetAggregateSourceValue ( )
inlinevirtual

Provides an easy way for subclasses to define the aggregate source value, in the event that there are multiple readings. This value may not be meaningful for all measurements.

Returns

◆ GetObjectData()

virtual void Apac.Monitoring.Measurement.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlinevirtual

Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.

Parameters
infoThe T:System.Runtime.Serialization.SerializationInfo to populate with data.
contextThe destination (see T:System.Runtime.Serialization.StreamingContext) for this serialization.
Exceptions
T:System.Security.SecurityExceptionThe caller does not have the required permission.

Reimplemented in Apac.Monitoring.MeasurementAvg.

◆ GetReadingByName()

Reading Apac.Monitoring.Measurement.GetReadingByName ( string  tagName)
inline

Gets the reading with tagName .

Parameters
tagNameName of the tag given to the reading.
Returns
The desired reading, or null.

◆ IsAborted()

bool Apac.Monitoring.Measurement.IsAborted ( )
inline

Determines if the measurement has been aborted.

Returns

◆ OnCompareTo()

virtual int Apac.Monitoring.Measurement.OnCompareTo ( object  obj)
inlineprotectedvirtual

Called when [compare to].

Parameters
objThe obj.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj.

◆ ToString()

override string Apac.Monitoring.Measurement.ToString ( )
inline

Returns a System.String that represents this instance.

Returns
A System.String that represents this instance.

Property Documentation

◆ Bucket

int Apac.Monitoring.Measurement.Bucket
get

Gets the bucket to which the measurement belongs.

◆ CompiledValue

virtual decimal Apac.Monitoring.Measurement.CompiledValue
getset

Gets or sets the compiled value.

The compiled value.

◆ ElementId

uint? Apac.Monitoring.Measurement.ElementId
get

Gets the identifier of the element to which this measurement applied.

◆ FullSource

string Apac.Monitoring.Measurement.FullSource
get

Gets the name source for this measurement instance.

The source.

Gets the identifier of the sensor that generated the source value for this instance.

The sensor id.

Gets the full name of the measurement's source.

The full source.

◆ Offset

int Apac.Monitoring.Measurement.Offset
get

Gets the time offset (in seconds) into the bucket to which this measurement belongs.

◆ ReadingCount

int Apac.Monitoring.Measurement.ReadingCount
get

Gets the reading count.

The reading count.

◆ Readings

Reading [] Apac.Monitoring.Measurement.Readings
get

Gives subclasses access to the list of readings.

◆ SourceMeasurementCount

int Apac.Monitoring.Measurement.SourceMeasurementCount
get

Gets the source measurement count.

The reading count.

◆ SourceMeasurements

Measurement [] Apac.Monitoring.Measurement.SourceMeasurements
get

Gives subclasses access to the list of source measurements.

◆ Tag

object Apac.Monitoring.Measurement.Tag
getset

Aggregates the specified compiled addition to the current compiled value and flags this instance as aggregated (IsAggregate == true).

Parameters
compiledAdditionThe compiled value to be added.

Gets or sets the tag for the measurement. This is often used to mark a measurment as a specific input to a formula.

◆ TimestampISO

string Apac.Monitoring.Measurement.TimestampISO
get

Gets the timestamp in ISO string format.

The timestamp ISO.

◆ UnitLabel

string Apac.Monitoring.Measurement.UnitLabel
getset

Gets or sets a value indicating whether this instance is aggregate.

true if this instance is aggregate; otherwise, false.


The documentation for this class was generated from the following file: