MainSeq, ITestMethod and all test methods changed, transitions are done in MainSeq (DoTransitions()), no outerLoopCounter, ver. 2.17.757
This commit is contained in:
+3
-2
@@ -18,6 +18,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Compound
|
||||
}
|
||||
|
||||
public bool CanTest(MetersKind meters) { return meters == MetersKind.Combined; }
|
||||
public bool DoTransitions() { return true; }
|
||||
|
||||
readonly TestMethodCfg testMethodCfg;
|
||||
|
||||
@@ -32,9 +33,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Compound
|
||||
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 FlyingStartMassCollectionSeq()).Execute(test, outerLoopMode, outerLoopCounter, testMethodCfg.TestParams, null, DebugLevel);
|
||||
return (new FlyingStartMassCollectionSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams, null, DebugLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+41
-68
@@ -26,7 +26,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
/// 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,
|
||||
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||
Compound.CombinedTestParams compoundTestParams,
|
||||
HeatMeters.TestParams heatMetersTestParams,
|
||||
Config.Entities.DebugMode debugLevel)
|
||||
@@ -47,8 +47,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
///
|
||||
/// Test method simulation
|
||||
///
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 } );
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.JustStarted));
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.FlowSetting));
|
||||
|
||||
if (compoundTestParams != null)
|
||||
@@ -67,14 +65,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
else if (test.Name.ToLower().Contains("q2")) errorPctBase = 0.5f;
|
||||
else if (test.Name.ToLower().Contains("q1")) errorPctBase = -5.1f;
|
||||
|
||||
if (outerLoopMode)
|
||||
{
|
||||
MakeSimulated(test.Name, test.Repeats, outerLoopCounter, 0, errorPctBase + outerLoopCounter * 0.1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i <= test.Repeats; i++) MakeSimulated(test.Name, test.Repeats, i, 0, i * 0.1f);
|
||||
}
|
||||
MakeSimulated(test.Name, test.Repeats, repetitionNr, 0, errorPctBase + repetitionNr * 0.1f);
|
||||
}
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Config.Entities.Progress.Completed));
|
||||
@@ -94,9 +85,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name));
|
||||
//------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
State.Create(string.Format("{0}({1}) : Simulation", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
@@ -118,9 +109,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
|
||||
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
|
||||
|
||||
int repetitionNr = Math.Max(1, outerLoopCounter); /// First test: repetitionNr = 1
|
||||
|
||||
|
||||
if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
@@ -128,24 +116,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
goto stopTestWOTransitionAfter;
|
||||
}
|
||||
|
||||
|
||||
//====================================
|
||||
// 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; }
|
||||
}
|
||||
|
||||
//====================================
|
||||
loop:
|
||||
/// Start the test, initialize test results
|
||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||
TestStartTime = DateTime.Now;
|
||||
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, 0, Convert.ToInt32(test.TstTime) + 15, 0, 0 }); /// start, transition, flow detection, flow setting, aborted, test, transition, end
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted));
|
||||
|
||||
|
||||
//------------------------------------------------
|
||||
@@ -679,19 +655,30 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
|
||||
test_completed:
|
||||
|
||||
///
|
||||
/// Water is stopped immediately after the test and before the 2nd mass measurement in case;
|
||||
/// - no 'transition sequence after test' is used
|
||||
/// - this is the last (or the only) test repetition or test is a part of an 'outer loop'
|
||||
///
|
||||
if (transitionAfter == null && (outerLoopMode || repetitionNr == test.Repeats))
|
||||
{
|
||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||
{
|
||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
}
|
||||
///
|
||||
/// (Berlin:) Water is stopped immediately after the test and before the 2nd mass measurement in case:
|
||||
/// - no 'transition sequence after test' is used
|
||||
/// - this is the last (or the only) test repetition or test is a part of an 'outer loop'
|
||||
///
|
||||
if (isLastRepetition && transitionAfter == null)
|
||||
{
|
||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff();
|
||||
|
||||
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(new MettlerToledo.KeepReadingMassesOp())
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||
if (TestAndLogUiCmdStop(e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||
@@ -1082,41 +1069,27 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
/// Append the results to the CSV-file
|
||||
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||
|
||||
if (!outerLoopMode && (++repetitionNr <= test.Repeats))
|
||||
{
|
||||
goto loop;
|
||||
}
|
||||
|
||||
stopTest:
|
||||
|
||||
///----------------------///
|
||||
/// 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; }
|
||||
}
|
||||
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)) goto stopTest;
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
}
|
||||
|
||||
stopTestWOTransitionAfter:
|
||||
|
||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr,
|
||||
(retVal == Event.Done) ? Config.Entities.Progress.Completed : Config.Entities.Progress.Aborted));
|
||||
|
||||
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
||||
IList<Event> retList = new List<Event>(1);
|
||||
retList.Add(retVal);
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.HeatMeters
|
||||
}
|
||||
|
||||
public bool CanTest(MetersKind meters) { return meters == MetersKind.HeatMeter; }
|
||||
public bool DoTransitions() { return true; }
|
||||
|
||||
readonly TestMethodCfg testMethodCfg;
|
||||
|
||||
@@ -31,9 +32,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.HeatMeters
|
||||
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 FlyingStartMassCollectionSeq()).Execute(test, outerLoopMode, outerLoopCounter, null, testMethodCfg.TestParams, DebugLevel);
|
||||
return (new FlyingStartMassCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, testMethodCfg.TestParams, DebugLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -17,6 +17,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Single
|
||||
}
|
||||
|
||||
public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; }
|
||||
public bool DoTransitions() { return true; }
|
||||
|
||||
public Component()
|
||||
{
|
||||
@@ -28,9 +29,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Single
|
||||
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 FlyingStartMassCollectionSeq()).Execute(test, outerLoopMode, outerLoopCounter, null, null, DebugLevel);
|
||||
return (new FlyingStartMassCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, null, DebugLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user