C# Class GSF.TimeSeries.Adapters.ActionAdapterBase

Represents the base class for action adapters.
This base class acts as a measurement concentrator which time aligns all incoming measurements for proper processing. Derived classes are expected to override ConcentratorBase.PublishFrame to handle time aligned measurements and call OnNewMeasurements for any new measurements that may get created.
Inheritance: ConcentratorBase, IActionAdapter
显示文件 Open project: GridProtectionAlliance/gsf

Private Properties

Property Type Description
ExamineQueueState void
GenHashCode void
OnStatusMessage void
ResetStatistics void
SetInitializedState void
SetTemporalConstraint void
Start void
Stop void

Public Methods

Method Description
GetHashCode ( ) : int

Serves as a hash function for the current ActionAdapterBase.

GetShortStatus ( int maxLength ) : string

Gets a short one-line status of this ActionAdapterBase.

Initialize ( ) : void

Initializes ActionAdapterBase.

QueueMeasurementsForProcessing ( IEnumerable measurements ) : void

Queues a collection of measurements for processing. Measurements are automatically filtered to the defined IAdapter.InputMeasurementKeys.

Measurements are filtered against the defined InputMeasurementKeys.

Protected Methods

Method Description
ActionAdapterBase ( ) : System

Creates a new ActionAdapterBase.

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the ActionAdapterBase object and optionally releases the managed resources.

OnConfigurationChanged ( ) : void

Raises ConfigurationChanged event.

OnInputMeasurementKeysUpdated ( ) : void

Raises InputMeasurementKeysUpdated event.

OnNewMeasurements ( ICollection measurements ) : void

Raises the NewMeasurements event.

OnOutputMeasurementsUpdated ( ) : void

Raises OutputMeasurementsUpdated event.

OnStatusMessage ( MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None ) : void

Raises the StatusMessage event and sends this data to the Logger.

should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.

TryGetMinimumNeededMeasurements ( IFrame frame, IMeasurement &measurements ) : bool

Attempts to retrieve the minimum needed number of measurements from the frame (as specified by MinimumMeasurementsToUse)

Remember this function will *only* return the minimum needed number of measurements, no more. If you want to use all available measurements in your adapter you should just use Frame.Measurements.Values directly.

Note that the measurements array parameter will be created if the reference is null, otherwise if caller creates array it must be sized to MinimumMeasurementsToUse

Private Methods

Method Description
ExamineQueueState ( ) : void
GenHashCode ( ) : void
OnStatusMessage ( string status ) : void
ResetStatistics ( ) : void
SetInitializedState ( bool initialized ) : void
SetTemporalConstraint ( string startTime, string stopTime, string constraintParameters ) : void
Start ( ) : void
Stop ( ) : void

Method Details

ActionAdapterBase() protected method

Creates a new ActionAdapterBase.
protected ActionAdapterBase ( ) : System
return System

Dispose() protected method

Releases the unmanaged resources used by the ActionAdapterBase object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

GetHashCode() public method

Serves as a hash function for the current ActionAdapterBase.
public GetHashCode ( ) : int
return int

GetShortStatus() public method

Gets a short one-line status of this ActionAdapterBase.
public GetShortStatus ( int maxLength ) : string
maxLength int Maximum number of available characters for display.
return string

Initialize() public method

Initializes ActionAdapterBase.
public Initialize ( ) : void
return void

OnConfigurationChanged() protected method

Raises ConfigurationChanged event.
protected OnConfigurationChanged ( ) : void
return void

OnInputMeasurementKeysUpdated() protected method

Raises InputMeasurementKeysUpdated event.
protected OnInputMeasurementKeysUpdated ( ) : void
return void

OnNewMeasurements() protected method

Raises the NewMeasurements event.
protected OnNewMeasurements ( ICollection measurements ) : void
measurements ICollection
return void

OnOutputMeasurementsUpdated() protected method

Raises OutputMeasurementsUpdated event.
protected OnOutputMeasurementsUpdated ( ) : void
return void

OnStatusMessage() protected method

Raises the StatusMessage event and sends this data to the Logger.
should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
protected OnStatusMessage ( MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
status string New status message.
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
return void

QueueMeasurementsForProcessing() public method

Queues a collection of measurements for processing. Measurements are automatically filtered to the defined IAdapter.InputMeasurementKeys.
Measurements are filtered against the defined InputMeasurementKeys.
public QueueMeasurementsForProcessing ( IEnumerable measurements ) : void
measurements IEnumerable Collection of measurements to queue for processing.
return void

TryGetMinimumNeededMeasurements() protected method

Attempts to retrieve the minimum needed number of measurements from the frame (as specified by MinimumMeasurementsToUse)

Remember this function will *only* return the minimum needed number of measurements, no more. If you want to use all available measurements in your adapter you should just use Frame.Measurements.Values directly.

Note that the measurements array parameter will be created if the reference is null, otherwise if caller creates array it must be sized to MinimumMeasurementsToUse

protected TryGetMinimumNeededMeasurements ( IFrame frame, IMeasurement &measurements ) : bool
frame IFrame Source frame for the measurements
measurements IMeasurement Return array of measurements
return bool