Add support for `ICommonRegReader` interface, enhance `ISmartReader` functionality, and update water meter state handling logic across multiple classes.
177 lines
4.6 KiB
C#
177 lines
4.6 KiB
C#
using System.IO;
|
|
using Common;
|
|
using Config.Entities;
|
|
using log4net;
|
|
using TBF.Rig.Generic;
|
|
using TBF.Rig.GenericDevices;
|
|
using TBF.Rig.RegisterReaders.CommonRR;
|
|
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
|
|
|
|
namespace TBF.Rig.RegisterReaders.PoseidonReader.implementations
|
|
{
|
|
public enum CommunicationInterface
|
|
{
|
|
Nfc,
|
|
Touched,
|
|
}
|
|
public class PoseidonReader : ComponentBase, IDevice, IRegReaderDatastream, ISessionDataMngmnt, IOperation, ISmartReader
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(PoseidonReader));
|
|
|
|
public PoseidonReader()
|
|
{
|
|
_pulsesPerLtr = 0;
|
|
_ltrsPerPulse = 0;
|
|
_wmPulses = 0;
|
|
_wmRefPulses = 0;
|
|
_wmVolume = 0;
|
|
_beginWmState = 0;
|
|
_endWmState = 0;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format("{0}({1})", ClassName, Cfg.ToString(-1));
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
|
|
}
|
|
|
|
public void RunDeviceBefore()
|
|
{
|
|
|
|
}
|
|
|
|
public void RunDeviceAfter()
|
|
{
|
|
|
|
}
|
|
|
|
public void StopDevice()
|
|
{
|
|
|
|
}
|
|
|
|
public void StopDevice2()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public bool Disabled { get; set; }
|
|
public RegisterReaderType RegisterReaderType { get; }
|
|
public string SerialNr { get; set; }
|
|
public int Position { get; }
|
|
public string CommInterface { get; }
|
|
public int RfidComPortNr { get; }
|
|
public bool CommFailed { get; set; }
|
|
public void ResetNfcInterface(bool? nfc_on = null)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public string ReadOptoData()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void SetNfcInterface()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void SetRfidInterface()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void StopDataStreamProcessing()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void StartDataStreamProcessing()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void SetCommunicationInterface(string commInterface)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void WriteBinary(BinaryWriter writer)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void ReadBinary(BinaryReader reader)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
private double _pulsesPerLtr ;
|
|
private double _ltrsPerPulse ;
|
|
private int _wmPulses ;
|
|
private int _wmRefPulses ;
|
|
private double _wmVolume ;
|
|
private double _beginWmState ;
|
|
private double _endWmState ;
|
|
|
|
|
|
public double PulsesPerLtr { get => _pulsesPerLtr; }
|
|
public double LtrsPerPulse { get => _ltrsPerPulse; }
|
|
public int WMPulses { get => _wmPulses; }
|
|
public int WMRefPulses { get =>_wmRefPulses; }
|
|
public double WMVolume { get =>_wmVolume; }
|
|
public double BeginWMState { get => _beginWmState; set => _beginWmState = value; }
|
|
public double EndWMState { get => _endWmState; set => _endWmState = value; }
|
|
|
|
public IOperation ReadDatastreamOp()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void TestIsGoingToStartSoon(Test test, int repetitionNr)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public bool NoSamples { get; }
|
|
public double VolumeLtrStart { get; }
|
|
public double VolumeLtrEnd { get; }
|
|
public double TimestampSecStart { get; }
|
|
public double TimestampSecEnd { get; }
|
|
public void StartSession()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void SaveMark(object mark)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void EndSession()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public Event Run()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void Stop()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
} |