C# 클래스 GSF.PhasorProtocols.MultiProtocolFrameParser

Protocol independent frame parser.
This class takes all protocol frame parsing implementations and reduces them to a single simple-to-use class exposing all data through abstract interfaces (e.g., IConfigurationFrame, IDataFrame, etc.) - this way new protocol implementations can be added without adversely affecting consuming code. Additionally, this class implements a variety of transport options (e.g., TCP, UDP, Serial, etc.) and hides the complexities of this connectivity and internally pushes all data received from the selected transport protocol to the selected phasor parsing protocol.
상속: IFrameParser
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Releases all the resources used by the MultiProtocolFrameParser object.

MultiProtocolFrameParser ( ) : System

Creates a new MultiProtocolFrameParser using the default settings.

ResetTotalBytesReceived ( ) : void

Resets the value for the TotalBytesReceived statistic.

SendDeviceCommand ( DeviceCommand command ) : WaitHandle

Sends the specified DeviceCommand to the remote device.

Command will only be sent if DeviceSupportsCommands is true and MultiProtocolFrameParser.

Start ( ) : void

Starts the MultiProtocolFrameParser.

Stop ( ) : void

Stops the MultiProtocolFrameParser.

TryInitializeFrameParser ( ) : bool

Attempts to initialize the protocol specific frame parser.

Starting the multi-protocol frame parser will automatically initialize the frame parsers so calling this method then will be unnecessary, however, if you are using this class just to edit custom connection parameters then initializing the will be necessary.

Write ( byte buffer, int offset, int count ) : void

Writes data directly to the frame parsing engine buffer.

This method is public to allow consumer to "manually send extra data" to the parsing engine to be parsed, if desired.

비공개 메소드들

메소드 설명
ClientConnectedHandler ( ) : void
DeriveCommandSupport ( ) : bool

Derives a flag based on settings that determines if the current connection supports device commands.

Dispose ( bool disposing ) : void

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

IFrameParser ( SourceChannel source, byte buffer, int offset, int count ) : void
InitializeCommandChannel ( string connectionString ) : void

Initialize command channel.

InitializeDataChannel ( string>.Dictionary settings ) : void

Initialize data channel.

InitializeFrameParser ( string>.Dictionary settings ) : void

Initialize frame parser.

InitializeUdpDataChannel ( string>.Dictionary settings ) : void
MaintainCapturedFrameReplayTiming ( IFrame sourceFrame ) : void
OnConnectionException ( Exception ex, int connectionAttempts ) : void

Raises the ConnectionException event.

OnExceededParsingExceptionThreshold ( ) : void

Raises the ExceededParsingExceptionThreshold event.

OnParsingException ( Exception ex ) : void

Raises the ParsingException event.

OnParsingException ( Exception innerException, string message ) : void

Raises the ParsingException event.

Parse ( SourceChannel source, byte buffer, int offset, int count ) : void

Writes a sequence of bytes onto the IBinaryImageParser stream for parsing.

ReadNextFileBuffer ( ) : void
StartDataParsingSequence ( ) : void
m_commandChannel_ConnectionAttempt ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionEstablished ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionException ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionTerminated ( object sender, EventArgs e ) : void
m_commandChannel_ReceiveData ( object sender, EventArgs e ) : void
m_commandChannel_ReceiveDataException ( object sender, EventArgs e ) : void
m_commandChannel_SendDataException ( object sender, EventArgs e ) : void
m_commandChannel_UnhandledUserException ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionAttempt ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionEstablished ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionException ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionTerminated ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveData ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveDataException ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveDataFrom ( object sender, EventArgs e ) : void
m_dataChannel_SendDataException ( object sender, EventArgs e ) : void
m_dataChannel_UnhandledUserException ( object sender, EventArgs e ) : void
m_frameParser_BufferParsed ( object sender, EventArgs e ) : void
m_frameParser_ConfigurationChanged ( object sender, EventArgs e ) : void
m_frameParser_ParsingException ( object sender, EventArgs e ) : void
m_frameParser_ReceivedCommandFrame ( object sender, EventArgs e ) : void
m_frameParser_ReceivedConfigurationFrame ( object sender, EventArgs e ) : void
m_frameParser_ReceivedDataFrame ( object sender, EventArgs e ) : void
m_frameParser_ReceivedFrameBufferImage ( object sender, EventArgs e ) : void
m_frameParser_ReceivedFrameImage ( object sender, int>.EventArgs e ) : void
m_frameParser_ReceivedHeaderFrame ( object sender, EventArgs e ) : void
m_frameParser_ReceivedUndeterminedFrame ( object sender, EventArgs e ) : void
m_rateCalcTimer_Elapsed ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_ClientConnected ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_ClientConnectingException ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_ClientDisconnected ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_ReceiveClientData ( object sender, int>.EventArgs e ) : void
m_serverBasedDataChannel_ReceiveClientDataException ( object sender, Exception>.EventArgs e ) : void
m_serverBasedDataChannel_SendClientDataException ( object sender, Exception>.EventArgs e ) : void
m_serverBasedDataChannel_ServerStarted ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_ServerStopped ( object sender, EventArgs e ) : void
m_serverBasedDataChannel_UnhandledUserException ( object sender, EventArgs e ) : void

메소드 상세

Dispose() 공개 메소드

Releases all the resources used by the MultiProtocolFrameParser object.
public Dispose ( ) : void
리턴 void

MultiProtocolFrameParser() 공개 메소드

Creates a new MultiProtocolFrameParser using the default settings.
public MultiProtocolFrameParser ( ) : System
리턴 System

ResetTotalBytesReceived() 공개 메소드

Resets the value for the TotalBytesReceived statistic.
public ResetTotalBytesReceived ( ) : void
리턴 void

SendDeviceCommand() 공개 메소드

Sends the specified DeviceCommand to the remote device.
Command will only be sent if DeviceSupportsCommands is true and MultiProtocolFrameParser.
public SendDeviceCommand ( DeviceCommand command ) : WaitHandle
command DeviceCommand to send to the remote device.
리턴 System.Threading.WaitHandle

Start() 공개 메소드

Starts the MultiProtocolFrameParser.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stops the MultiProtocolFrameParser.
public Stop ( ) : void
리턴 void

TryInitializeFrameParser() 공개 메소드

Attempts to initialize the protocol specific frame parser.
Starting the multi-protocol frame parser will automatically initialize the frame parsers so calling this method then will be unnecessary, however, if you are using this class just to edit custom connection parameters then initializing the will be necessary.
public TryInitializeFrameParser ( ) : bool
리턴 bool

Write() 공개 메소드

Writes data directly to the frame parsing engine buffer.
This method is public to allow consumer to "manually send extra data" to the parsing engine to be parsed, if desired.
public Write ( byte buffer, int offset, int count ) : void
buffer byte Buffer containing data to be parsed.
offset int Offset into buffer where data begins.
count int Length of data in buffer to be parsed.
리턴 void