/// /// Copyright (c) 2020 Sensus Slovensko a.s. /// using System; using log4net; using TBF.Boxes; namespace TBF.BenchControl.Modbus.WaterAnalyzer { public class ReadConductivityOp : IOperation { private static readonly ILog log = LogManager.GetLogger(typeof(ReadConductivityOp)); public override string ToString() { return string.Format("ReadLevelOp(.,.)"); } /// Set by the constructor readonly Analyzer analyzer; /// Measured value FloatBox conductivity; /// [uS/cm] electrical conductivity of water /// /// Events: LevelDone or Error /// /// Water level meter reference /// Reference to the measured level variable, value is in mm /// Event to be returned by Run() when completed OK public ReadConductivityOp(Analyzer analyzer, ref FloatBox conduct) { if (analyzer == null) throw new ArgumentNullException("analyzer"); this.analyzer = analyzer; this.conductivity = conduct; log.Debug(this.ToString()); } /// Start this operation public void Start() { conductivity.Val = analyzer.ReadConductivity(); } /// Run this operation /// /// Event.ConductivityDone /// public Event Run() { conductivity.Val = analyzer.ReadConductivity(); return Event.ConductivityDone; } /// Stop this operation public void Stop() { } } }