C# Class PhasorProtocolAdapters.PhasorDataConcentratorBase

Inheritance: GSF.TimeSeries.Adapters.ActionAdapterBase
Mostrar archivo Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
GetHashCode ( ) : int

Returns the hash code for this instance.

Initialize ( ) : void

Initializes PhasorDataConcentratorBase.

QueueMeasurementsForProcessing ( IEnumerable measurements ) : void

Queues a collection of measurements for processing.

ResetLatencyCounters ( ) : void

Resets counters related to latency calculations.

Start ( ) : void

Starts the PhasorDataConcentratorBase, if it is not already running.

Stop ( ) : void

Stops the PhasorDataConcentratorBase.

Protected Methods

Method Description
AssignMeasurementToFrame ( IFrame frame, IMeasurement measurement ) : void

Assign IMeasurement to its IFrame.

In simple concentration scenarios all you need to do is assign a measurement to its frame based on time. In the case of a phasor data concentrator you need to assign a measurement to its particular location in its IDataFrame - so this method overrides the default behavior in order to accomplish this task.

CacheConfigurationFrame ( IConfigurationFrame configurationFrame, string name ) : void

Serialize configuration frame to cache folder for later use (if needed).

Derived concentrators can call this method to manually serialize their protocol specific configuration frames. Note that after initial call to CreateNewConfigurationFrame this method will be call automatically.

CreateNewConfigurationFrame ( GSF.PhasorProtocols.Anonymous.ConfigurationFrame baseConfigurationFrame ) : IConfigurationFrame

Creates a new protocol specific IConfigurationFrame based on provided protocol independent baseConfigurationFrame.

Derived classes should notify consumers of change in configuration if system is active when new configuration frame is created if outgoing protocol allows such a notification.

DeviceCommandHandler ( System.Guid clientID, string connectionID, byte commandBuffer, int length ) : void

Handles incoming commands from devices connected over the command channel.

This method should be overridden by derived classes in order to handle incoming commands, specifically handling requests for configuration frames.

Dispose ( bool disposing ) : void

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

GetConnectionID ( IServer server, System.Guid clientID ) : string

Gets connection ID (i.e., IP:Port) for specified clientID.

PhasorDataConcentratorBase ( ) : System

Creates a new PhasorDataConcentratorBase.

PublishFrame ( IFrame frame, int index ) : void

Publish IFrame of time-aligned collection of IMeasurement values that arrived within the concentrator's defined ConcentratorBase.LagTime.

Private Methods

Method Description
DeviceCommandHandlerProc ( object state ) : void
EstablishPublicationChannel ( ) : void
GeneratePhasorLabel ( string phasorLabel, char phase, PhasorType type ) : string
LookupHostName ( object state ) : void
ReinitializeSocketLayer ( object state ) : void
ResetLifetimeCounters ( ) : void
ResetMeasurementsPerSecondCounters ( ) : void
StartDataChannel ( ) : void
StopDataChannel ( ) : void
UpdateConfiguration ( ) : void
UpdateMeasurementsPerSecond ( int measurementCount ) : void
m_commandChannelRestartTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void
m_commandChannel_ClientConnected ( object sender, EventArgs e ) : void
m_commandChannel_ClientConnectingException ( object sender, EventArgs e ) : void
m_commandChannel_ClientDisconnected ( object sender, EventArgs e ) : void
m_commandChannel_ReceiveClientDataComplete ( object sender, EventArgs e ) : void
m_commandChannel_SendClientDataException ( object sender, Exception>.EventArgs e ) : void
m_commandChannel_ServerStarted ( object sender, EventArgs e ) : void
m_commandChannel_ServerStopped ( object sender, EventArgs e ) : void
m_dataChannel_ClientConnectingException ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveClientDataComplete ( object sender, EventArgs e ) : void
m_dataChannel_SendClientDataException ( object sender, Exception>.EventArgs e ) : void
m_dataChannel_ServerStarted ( object sender, EventArgs e ) : void
m_dataChannel_ServerStopped ( object sender, EventArgs e ) : void

Method Details

AssignMeasurementToFrame() protected method

Assign IMeasurement to its IFrame.
In simple concentration scenarios all you need to do is assign a measurement to its frame based on time. In the case of a phasor data concentrator you need to assign a measurement to its particular location in its IDataFrame - so this method overrides the default behavior in order to accomplish this task.
protected AssignMeasurementToFrame ( IFrame frame, IMeasurement measurement ) : void
frame IFrame to assign to.
measurement IMeasurement to assign to .
return void

CacheConfigurationFrame() protected method

Serialize configuration frame to cache folder for later use (if needed).
Derived concentrators can call this method to manually serialize their protocol specific configuration frames. Note that after initial call to CreateNewConfigurationFrame this method will be call automatically.
protected CacheConfigurationFrame ( IConfigurationFrame configurationFrame, string name ) : void
configurationFrame IConfigurationFrame New to cache.
name string Name to use when caching the .
return void

CreateNewConfigurationFrame() protected abstract method

Creates a new protocol specific IConfigurationFrame based on provided protocol independent baseConfigurationFrame.
Derived classes should notify consumers of change in configuration if system is active when new configuration frame is created if outgoing protocol allows such a notification.
protected abstract CreateNewConfigurationFrame ( GSF.PhasorProtocols.Anonymous.ConfigurationFrame baseConfigurationFrame ) : IConfigurationFrame
baseConfigurationFrame GSF.PhasorProtocols.Anonymous.ConfigurationFrame Protocol independent .
return IConfigurationFrame

DeviceCommandHandler() protected method

Handles incoming commands from devices connected over the command channel.
This method should be overridden by derived classes in order to handle incoming commands, specifically handling requests for configuration frames.
protected DeviceCommandHandler ( System.Guid clientID, string connectionID, byte commandBuffer, int length ) : void
clientID System.Guid Guid of client that sent the command.
connectionID string Remote client connection identification (i.e., IP:Port).
commandBuffer byte Data buffer received from connected client device.
length int Valid length of data within the buffer.
return void

Dispose() protected method

Releases the unmanaged resources used by the PhasorDataConcentratorBase 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

GetConnectionID() protected method

Gets connection ID (i.e., IP:Port) for specified clientID.
protected GetConnectionID ( IServer server, System.Guid clientID ) : string
server IServer Server connection of associated .
clientID System.Guid Guid of client for ID lookup.
return string

GetHashCode() public method

Returns the hash code for this instance.
public GetHashCode ( ) : int
return int

Initialize() public method

Initializes PhasorDataConcentratorBase.
public Initialize ( ) : void
return void

PhasorDataConcentratorBase() protected method

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

PublishFrame() protected method

Publish IFrame of time-aligned collection of IMeasurement values that arrived within the concentrator's defined ConcentratorBase.LagTime.
protected PublishFrame ( IFrame frame, int index ) : void
frame IFrame of measurements with the same timestamp that arrived within that are ready for processing.
index int Index of within a second ranging from zero to - 1.
return void

QueueMeasurementsForProcessing() public method

Queues a collection of measurements for processing.
public QueueMeasurementsForProcessing ( IEnumerable measurements ) : void
measurements IEnumerable Collection of measurements to queue for processing.
return void

ResetLatencyCounters() public method

Resets counters related to latency calculations.
public ResetLatencyCounters ( ) : void
return void

Start() public method

Starts the PhasorDataConcentratorBase, if it is not already running.
public Start ( ) : void
return void

Stop() public method

Stops the PhasorDataConcentratorBase.
public Stop ( ) : void
return void