40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
///
|
|
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using log4net;
|
|
using TBF.Boxes;
|
|
|
|
namespace TBF.Rig.Modbus.WaterAnalyzerUni
|
|
{
|
|
public class ReadConductivityOp : IOperation
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(ReadConductivityOp));
|
|
public override string ToString() { return "ReadConductivityOp(.,.)"; }
|
|
|
|
readonly Analyzer analyzer;
|
|
FloatBox conductivity;
|
|
|
|
public ReadConductivityOp(Analyzer analyzer, ref FloatBox conduct)
|
|
{
|
|
if (analyzer == null) throw new ArgumentNullException("analyzer");
|
|
this.analyzer = analyzer;
|
|
this.conductivity = conduct;
|
|
|
|
log.Debug(this.ToString());
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
conductivity.Val = analyzer.ReadConductivity();
|
|
}
|
|
|
|
public Event Run()
|
|
{
|
|
conductivity.Val = analyzer.ReadConductivity();
|
|
return Event.ConductivityDone;
|
|
}
|
|
|
|
public void Stop() { }
|
|
}
|
|
} |