(1) UI.Procedures.ProcedureParamsMixedCtrl, (2) Modbus.Novus added, (3) cleanup
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.Rig.Modbus.Novus
|
||||
{
|
||||
public class SetTemperatureOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(SetTemperatureOp));
|
||||
public override string ToString() { return string.Format("SetTemperatureOp({0},{1})", temperatureSetpoint, eventDone); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly Novus easytherm;
|
||||
readonly Event eventDone;
|
||||
float temperatureSetpoint;
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureInDone, PressureOutDone or Error
|
||||
/// </summary>
|
||||
/// <param name="easytherm">Pressure meter reference</param>
|
||||
/// <param name="pressure">Reference to the measured pressure variable, value is in bar</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public SetTemperatureOp(Novus easytherm, float temperatureSetpoint, Event eventDone)
|
||||
{
|
||||
if (easytherm == null) throw new ArgumentNullException("easytherm");
|
||||
this.easytherm = easytherm;
|
||||
this.temperatureSetpoint = temperatureSetpoint;
|
||||
this.eventDone = eventDone;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
public SetTemperatureOp(Novus easytherm, float temperatureSetpoint)
|
||||
: this(easytherm, temperatureSetpoint, Event.SetOutputsDone)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
easytherm.SetTemperatureSetpoint(temperatureSetpoint);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
return eventDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user