111 lines
4.0 KiB
C#
111 lines
4.0 KiB
C#
///
|
|
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
|
|
namespace DataStreamInterface
|
|
{
|
|
public interface IDataStreamMeter
|
|
{
|
|
/// <summary>
|
|
/// Get state of the connected data stream meter
|
|
/// </summary>
|
|
/// <param name="state">Current state of the meter</param>
|
|
/// <returns>true when successful</returns>
|
|
bool GetState(out int state, out string parameter);
|
|
|
|
/// <summary>
|
|
/// Set state of the connected data stream meter
|
|
/// </summary>
|
|
/// <param name="state">Required state of the meter</param>
|
|
/// <returns>true when successful</returns>
|
|
bool SetState(int state, string parameter);
|
|
|
|
/// <summary>
|
|
/// Establish connection with a data stream meter
|
|
/// </summary>
|
|
/// <param name="connectionParameters">Connection parameters</param>
|
|
/// <param name="meterId">Meter ID (e.g. serial number)</param>
|
|
/// <returns>true when successful</returns>
|
|
bool OpenConnection(string connectionParameters, out string meterId);
|
|
|
|
/// <summary>
|
|
/// Closes connection with the data stream meter
|
|
/// </summary>
|
|
/// <returns>true when successful</returns>
|
|
bool CloseConnection();
|
|
|
|
/// <summary>
|
|
/// Stars saving measurement results into internal data structures of the component.
|
|
/// Each data frame obtains a unique ID.
|
|
/// The very first data fraim obrains ID = 0.
|
|
/// </summary>
|
|
/// <returns>true when successful</returns>
|
|
bool StartMeasurement();
|
|
|
|
/// <summary>
|
|
/// Stops saving measurement results into internal data structures of the component.
|
|
/// Updates ID of the last date frame received from the meter.
|
|
/// </summary>
|
|
/// <param name="storedFramesCount">Number of stored date frames</param>
|
|
/// <returns>true when successful</returns>
|
|
bool StopMeasurement(out Int64 storedFramesCount);
|
|
|
|
///------------------------------------------------
|
|
/// Units of time, volume and optional quantities
|
|
///------------------------------------------------
|
|
|
|
/// <summary>
|
|
/// Returns time units (s, ms, ...)
|
|
/// </summary>
|
|
Unit GetTimeUnits();
|
|
|
|
/// <summary>
|
|
/// Returns units of volume (ml, l, ...)
|
|
/// </summary>
|
|
Unit GetVolumeUnits();
|
|
|
|
///-----------------------------------------------
|
|
/// Optional quantities: count, units, captions
|
|
///-----------------------------------------------
|
|
|
|
/// <summary>
|
|
/// Returns count of optional quantities in each data frame
|
|
/// </summary>
|
|
/// <returns>Count of optional quantities</returns>
|
|
int GetQuantitiesCount();
|
|
|
|
/// <summary>
|
|
/// Returns units of the specified quantity
|
|
/// </summary>
|
|
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
|
|
Unit GetQuantityUnits(int quantityNr);
|
|
|
|
/// <summary>
|
|
/// Returns caption of the specified quantity
|
|
/// </summary>
|
|
/// <param name="quanityNr">Zero based quantity number 0 .. quantites count-1</param>
|
|
string GetQuantityCaption(int quantityNr);
|
|
|
|
///---------------------------
|
|
/// Datastream data exchange
|
|
///---------------------------
|
|
|
|
/// <summary>
|
|
/// Retuns 'count' data frames starting with data frame with ID = 'id'
|
|
/// </summary>
|
|
/// <param name="id">First frame ID</param>
|
|
/// <param name="count">Frames count</param>
|
|
/// <returns>Selected data frames</returns>
|
|
DataFrame[] GetFrames(Int64 id, int count);
|
|
|
|
/// <summary>
|
|
/// Returns ID of the data frame where time equals or exceeds the specified time.
|
|
/// When time of the first frame (ID=0) is larger then specified time, function returns 0.
|
|
/// </summary>
|
|
/// <param name="time">Time</param>
|
|
/// <returns>ID of the data frame at or after the pecified time</returns>
|
|
Int64 GetID(double time);
|
|
}
|
|
}
|