///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using log4net;
namespace TBF.BenchControl.Dummy.RegulValve
{
public class ChangeRegulValvePositionOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ChangeRegulValvePositionOp));
public override string ToString()
{
return string.Format("ChangeRegulValvePositionOp({0},{1}s)", regulValve.Name, timePulseSec.ToString("F2"));
}
/// Set by the constructor
readonly RegulValve regulValve;
readonly float timePulseSec;
///
/// Set required water flow.
/// Events: FlowSet, FlowTimeOut
///
/// Control board device
/// Regulation valve component
/// Lower limit of the position to be achieved
/// Upper limit of the position to be achieved
/// Timeout in sec. for setting the flow
/// Only Elde.Valve flow are used, other flow on the lists are ignored
public ChangeRegulValvePositionOp(RegulValve regulValve, float timePulseSec)
{
this.regulValve = regulValve as RegulValve;
if (this.regulValve == null) throw new ArgumentNullException("regValve is null or not Elde");
this.timePulseSec = timePulseSec;
log.Debug(this.ToString());
}
/// Start this operation
public void Start()
{
}
/// Run this operation
///
/// Event.SetFlowDone
///
public Event Run()
{
return Event.PositionReached;
}
/// Stop this operation
public void Stop()
{
}
}
}