diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs
index 0784a2e52..753162e01 100644
--- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs
+++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs
@@ -678,7 +678,8 @@ namespace TBF.BenchControl.Sequences
}
else if (selection == Selection.RestOfCycle)
{
- Test slctdTest = TBF.BenchControl.StateMachine.GetTest(selection);
+ int repetNr;
+ Test slctdTest = TBF.BenchControl.StateMachine.GetTest(selection, out repetNr);
if (slctdTest == null)
{
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
@@ -766,7 +767,7 @@ namespace TBF.BenchControl.Sequences
}
}
- e = testMethodSequence.Execute(test, outerLoopMode, outerLoopCounter);
+ e = testMethodSequence.Execute(test, outerLoopMode, (outerLoopMode ? outerLoopCounter: repetNr));
if (e.Contains(Event.ConfigurationError))
{
@@ -820,7 +821,8 @@ namespace TBF.BenchControl.Sequences
}
else /// if (selection == Selection.Test)
{
- Test test = TBF.BenchControl.StateMachine.GetTest(selection);
+ int repetNr;
+ Test test = TBF.BenchControl.StateMachine.GetTest(selection, out repetNr);
if (test == null)
{
UiBridge.Bridge.OnError(this, string.Format("No test specified"));
@@ -861,7 +863,7 @@ namespace TBF.BenchControl.Sequences
}
}
- e = testMethodSequence.Execute(test, false, 0);
+ e = testMethodSequence.Execute(test, false, repetNr);
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.OpArgumentError)) goto config_error;
diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs
index d08cc52ed..874fa46f8 100644
--- a/TestBenchFramework/BenchControl/StateMachine.cs
+++ b/TestBenchFramework/BenchControl/StateMachine.cs
@@ -414,8 +414,9 @@ namespace TBF.BenchControl
///
/// Selection.Q1, .Q2, .Q3 or .Test
/// The selected test or null
- public static Config.Entities.Test GetTest(Sequences.MainSeq.Selection selection)
+ public static Config.Entities.Test GetTest(Sequences.MainSeq.Selection selection, out int repetNr)
{
+ repetNr = 1;
if ((selection == Sequences.MainSeq.Selection.Q1) && (Tests.Count >= 1))
{
return Tests[0];
@@ -432,9 +433,17 @@ namespace TBF.BenchControl
{
foreach (var test in Tests)
{
- if (Utils.TestTitle(test, 1).Equals(UiBridge.Bridge.SelectedTestName)) return test;
+ for (int i = 1; i <= test.Repeats; i++)
+ {
+ if (Utils.TestTitle(test, i).Equals(UiBridge.Bridge.SelectedTestName))
+ {
+ repetNr = i;
+ return test;
+ }
+ }
}
}
+
return null;
}
diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs
index 8a66e9ca9..a71d7fd23 100644
--- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs
+++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs
@@ -51,7 +51,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
- int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr=1
+ int repetitionNr = Math.Max(1, outerLoopCounter); /// First test: repetitionNr = 1
if (test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor)
diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs
index 76776773c..5e54f12eb 100644
--- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs
+++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs
@@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
- int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr=1
+ int repetitionNr = Math.Max(1, outerLoopCounter); /// First test: repetitionNr = 1
//====================================
// Transition or SetRoute - Start
diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
index 10f0b5ba5..b29b6b222 100644
--- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
+++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
@@ -118,7 +118,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse;
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
- int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr = 1
+ int repetitionNr = Math.Max(1, outerLoopCounter); /// First test: repetitionNr = 1
if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)