MainSeq, ITestMethod and all test methods changed, transitions are done in MainSeq (DoTransitions()), no outerLoopCounter, ver. 2.17.757

This commit is contained in:
Milan Hanajik
2017-12-03 18:44:57 +03:00
parent b9b7fc95b4
commit c5453fff5b
46 changed files with 410 additions and 654 deletions
@@ -27,7 +27,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
/// Event.OpArgumentError . Target flow is out of range
/// Event.Error . . . . . . Unspecified error
/// </returns>
public IList<Event> Execute(Config.Entities.Test test, bool outerLoopMode, int outerLoopCounter, PMaxTestParams testParams)
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, PMaxTestParams testParams)
{
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
@@ -37,18 +37,6 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.JustStarted));
// Transition or SetRoute - Start
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.TransitionBefore));
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, 1);
@@ -292,27 +280,19 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
///
/// Quit this sequence
///
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
/// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1,
(retVal == Event.Done) ? Config.Entities.Progress.Completed : Config.Entities.Progress.Aborted));
if (retVal == Event.UiCmdStop || retVal == Event.Error || retVal == Event.OpArgumentError || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
}
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retList = new List<Event>(1);
@@ -15,6 +15,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
public override string ToString() { return string.Format("TestMethods.PMaxTest({0})", Cfg.ToString(1)); }
public bool CanTest(MetersKind meters) { return true; }
public bool DoTransitions() { return true; }
readonly TestMethodCfg testMethodCfg;
@@ -29,9 +30,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
log.Debug(this.ToString());
}
public IList<Event> Execute(Test test, bool outerLoopMode, int outerLoopCounter)
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new PMaxTestSeq()).Execute(test, outerLoopMode, outerLoopCounter, testMethodCfg.TestParams);
return (new PMaxTestSeq()).Execute(test, repetNr, testMethodCfg.TestParams);
}
}
}