Repettition nr. > 1 can be selected in the main sequence.

This commit is contained in:
Milan Hanajik 2017-10-19 09:19:31 +02:00
parent a8dd8d98cb
commit 38d7562bb3
5 changed files with 20 additions and 9 deletions

View File

@ -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;

View File

@ -414,8 +414,9 @@ namespace TBF.BenchControl
/// </summary>
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
/// <returns>The selected test or null</returns>
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;
}

View File

@ -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)

View File

@ -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

View File

@ -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)