C# Class GSF.TimeSeries.Transport.TSSC.TsscEncoder

An encoder for the TSSC protocol.
Exibir arquivo Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
FinishBlock ( ) : int

Finishes the current block and returns position after the last byte written.

Reset ( ) : void

Resets the TSSC Encoder to the initial state.

TSSC is a stateful encoder that requires a state of the previous data to be maintained. Therefore, if the state ever becomes corrupt (out of order, dropped, corrupted, or duplicated) the state must be reset on both ends.

SetBuffer ( byte data, int startingPosition, int length ) : void

Sets the internal buffer to write data to.

TryAddMeasurement ( ushort id, long timestamp, uint quality, float value ) : bool

Adds the supplied measurement to the stream. If the stream is full, this method returns false.

TsscEncoder ( ) : System

Creates a encoder for the TSSC protocol.

Private Methods

Method Description
BitStreamEnd ( ) : void
BitStreamFlush ( ) : void
ClearBitStream ( ) : void

Resets the stream so it can be reused. All measurements must be registered again.

WriteBits ( int code, int len ) : void
WritePointIdChange ( ushort id ) : void
WriteQualityChange ( uint quality, TsscPointMetadata point ) : void
WriteTimestampChange ( long timestamp ) : void

Method Details

FinishBlock() public method

Finishes the current block and returns position after the last byte written.
public FinishBlock ( ) : int
return int

Reset() public method

Resets the TSSC Encoder to the initial state.
TSSC is a stateful encoder that requires a state of the previous data to be maintained. Therefore, if the state ever becomes corrupt (out of order, dropped, corrupted, or duplicated) the state must be reset on both ends.
public Reset ( ) : void
return void

SetBuffer() public method

Sets the internal buffer to write data to.
public SetBuffer ( byte data, int startingPosition, int length ) : void
data byte
startingPosition int
length int
return void

TryAddMeasurement() public method

Adds the supplied measurement to the stream. If the stream is full, this method returns false.
public TryAddMeasurement ( ushort id, long timestamp, uint quality, float value ) : bool
id ushort the id
timestamp long the timestamp in ticks
quality uint the quality
value float the value
return bool

TsscEncoder() public method

Creates a encoder for the TSSC protocol.
public TsscEncoder ( ) : System
return System