58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
///
|
|
/// Copyright (c) 2017 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using log4net;
|
|
using TBF.Boxes;
|
|
|
|
namespace TBF.BenchControl.Modbus.Easytherm
|
|
{
|
|
public class ReadTemperatureOp : IOperation
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(SetTemperatureOp));
|
|
public override string ToString() { return string.Format("SetOutputsOp(.,{0},{1})", outValue, eventDone); }
|
|
|
|
/// Set by the constructor
|
|
readonly Easytherm easytherm;
|
|
readonly Event eventDone;
|
|
ushort outValue;
|
|
|
|
/// <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 ReadTemperatureOp(Easytherm easytherm, Event eventDone)
|
|
{
|
|
if (easytherm == null) throw new ArgumentNullException("easytherm");
|
|
this.easytherm = easytherm;
|
|
//this.outValue = outValue;
|
|
this.eventDone = eventDone;
|
|
|
|
log.Debug(this.ToString());
|
|
}
|
|
public ReadTemperatureOp(Easytherm easytherm)
|
|
: this(easytherm, Event.Done)
|
|
{
|
|
}
|
|
|
|
/// <summary>Start this operation</summary>
|
|
public void Start()
|
|
{
|
|
easytherm.GetSomething(0, 1);
|
|
}
|
|
|
|
/// <summary>Run this operation</summary>
|
|
public Event Run()
|
|
{
|
|
return eventDone;
|
|
}
|
|
|
|
/// <summary>Stop this operation</summary>
|
|
public void Stop()
|
|
{
|
|
}
|
|
}
|
|
}
|