60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
///
|
|
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using log4net;
|
|
|
|
namespace TBF.Rig.Elde
|
|
{
|
|
public class QueryMeasurementEndOp : IOperation
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(QueryMeasurementEndOp));
|
|
public override string ToString() { return string.Format("QueryMeasurementEndOp()"); }
|
|
|
|
/// Set by the constructor
|
|
readonly ControlBoardDev controlBoard;
|
|
|
|
bool done;
|
|
|
|
/// <summary>
|
|
/// Events: MeasurementCompleted
|
|
/// </summary>
|
|
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
|
public QueryMeasurementEndOp(ControlBoardDev controlBoardDev)
|
|
{
|
|
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
|
|
this.controlBoard = controlBoardDev;
|
|
done = false;
|
|
log.Debug(this.ToString());
|
|
}
|
|
|
|
/// <summary> Start this operation </summary>
|
|
public void Start()
|
|
{
|
|
done = false;
|
|
}
|
|
|
|
/// <summary> Run this operation </summary>
|
|
/// <returns>
|
|
/// Event.FlowInDone or Event.FlowOutDone
|
|
/// </returns>
|
|
public Event Run()
|
|
{
|
|
if (done) return Event.MeasurementCompleted;
|
|
|
|
if (0 != (controlBoard.StatusP & StatusP.TestCompleted))
|
|
{
|
|
done = true;
|
|
return Event.MeasurementCompleted;
|
|
}
|
|
|
|
return Event.None;
|
|
}
|
|
|
|
/// <summary> Stop this operation </summary>
|
|
public void Stop()
|
|
{
|
|
}
|
|
}
|
|
}
|