///
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.Rig.Dummy.RegValve
{
public class ChangeRegValvePositionOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ChangeRegValvePositionOp));
public override string ToString()
{
return string.Format("ChangeRegValvePositionOp({0},{1}s)", regulValve.Name, timePulseSec.ToString("F2"));
}
/// Set by the constructor
readonly RegValve regulValve;
readonly double 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 ChangeRegValvePositionOp(RegValve regulValve, double timePulseSec)
{
this.regulValve = regulValve as RegValve;
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()
{
}
}
}