Initial commit almost identical to SVN-repo rev.340
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user