/// /// Copyright (c) 2017 Sensus Metering Systems /// using System; using log4net; using TBF.Boxes; namespace TBF.BenchControl.Modbus.Easytherm { public class SetRequiredTemperatureOp : IOperation { private static readonly ILog log = LogManager.GetLogger(typeof(SetRequiredTemperatureOp)); public override string ToString() { return string.Format("SetRequiredTemperatureOp({0})", eventDone); } /// Set by the constructor readonly Easytherm easytherm; readonly Event eventDone; /// /// Events: PressureInDone, PressureOutDone or Error /// /// Pressure meter reference /// Reference to the measured pressure variable, value is in bar /// Event to be returned by Run() when completed OK public SetRequiredTemperatureOp(Easytherm easytherm, Event eventDone) { if (easytherm == null) throw new ArgumentNullException("easytherm"); this.easytherm = easytherm; this.eventDone = eventDone; log.Debug(this.ToString()); } public SetRequiredTemperatureOp(Easytherm easytherm) : this(easytherm, Event.ConditionMet) { } /// Start this operation public void Start() { easytherm.SetTemperatureSetpoint(); } /// Run this operation public Event Run() { return eventDone; } /// Stop this operation public void Stop() { } } }