Click or drag to resize

OutputAdapterBaseProcessMeasurements Method

Serializes measurements to data output stream.

Namespace: GSF.TimeSeries.Adapters
Assembly: GSF.TimeSeries (in GSF.TimeSeries.dll) Version: 2.4.218-beta
Syntax
protected abstract void ProcessMeasurements(
	IMeasurement[] measurements
)
View Source

Parameters

measurements  IMeasurement
 
Remarks

Derived classes must implement this function to process queued measurements. For example, this function would "archive" measurements if output adapter is for a historian.

It is important that consumers "resume" connection cycle if processing fails (e.g., connection to archive is lost). Here is an example:

Example
C#
protected virtual void ProcessMeasurements(IMeasurement[] measurements)
{
    try
    {
        // Process measurements...
        foreach (IMeasurement measurement in measurement)
        {
            ArchiveMeasurement(measurement);
        }
    }
    catch (Exception)
    {                
        // So long as user hasn't requested to stop, restart connection cycle
        if (Enabled)
            Start();
    }
}

See Also