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