///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataStreamInterface
{
public interface IDataStreamMeter
{
///
/// Get state of the connected data stream meter
///
/// Current state of the meter
/// true when successful
bool GetState(out int state, out string parameter);
///
/// Set state of the connected data stream meter
///
/// Required state of the meter
/// true when successful
bool SetState(int state, string parameter);
///
/// Establish connection with a data stream meter
///
/// Connection parameters
/// Meter ID (e.g. serial number)
/// true when successful
bool OpenConnection(string connectionParameters, out string meterId);
///
/// Closes connection with the data stream meter
///
/// true when successful
bool CloseConnection();
///
/// 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.
///
/// true when successful
bool StartMeasurement();
///
/// Stops saving measurement results into internal data structures of the component.
/// Updates ID of the last date frame received from the meter.
///
/// ID of the last date frame
/// true when successful
bool StopMeasurement(out UInt64 lastFrameID);
///------------------------------------------------
/// Units of time, volume and optional quantities
///------------------------------------------------
///
/// Returns time units (s, ms, ...)
///
Unit GetTimeUnits();
///
/// Returns units of volume (ml, l, ...)
///
Unit GetVolumeUnits();
///-----------------------------------------------
/// Ooptional quantities: count, units, captions
///-----------------------------------------------
///
/// Returns count of optional quantities in each data frame
///
/// Count of optional quantities
int GetQuantitiesCount();
///
/// Returns units of the specified quantity
///
/// Zero based quantity number 0 .. quantites count-1
Unit GetQuantityUnits(int quanityNr);
///
/// Returns caption of the specified quantity
///
/// Zero based quantity number 0 .. quantites count-1
string GetQuantityCaption(int quanityNr);
///---------------------------
/// Datastream data exchange
///---------------------------
///
/// Retuns 'count' data frames starting with data frame with ID = 'id'
///
/// First frame ID
/// Frames count
/// Selected data frames
DataFrame[] GetFrames(UInt64 id, int count);
///
/// 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.
///
/// Time
/// ID of the data frame at or after the pecified time
UInt64 GetID(double time);
}
}