TestProgressControls changes in progress.
This commit is contained in:
parent
e0af6a5c20
commit
2d42ae95f8
@ -56,6 +56,9 @@ namespace Config.Entities
|
||||
public virtual string RelTransAfter { get; set; }
|
||||
public virtual string TransitionAfter { get; set; }
|
||||
|
||||
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
|
||||
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
|
||||
|
||||
public virtual IList<ComponentTest> MoreParams { get; set; }
|
||||
|
||||
public virtual Procedure Procedure { get; set; }
|
||||
|
||||
@ -66,24 +66,36 @@ namespace TBF
|
||||
|
||||
void ResetProgressBars(Config.Entities.Procedure procedure)
|
||||
{
|
||||
foreach (var test in procedure.Tests)
|
||||
{
|
||||
var component = TbfComponents.FindComponent(test.Method);
|
||||
if (component != null)
|
||||
{
|
||||
test.IsOuterLoopStart = component is TBF.BenchControl.TestMethods.OuterLoop.Start.Component;
|
||||
test.IsOuterLoopEnd = component is TBF.BenchControl.TestMethods.OuterLoop.End.Component;
|
||||
}
|
||||
}
|
||||
|
||||
parent.SuspendLayout();
|
||||
|
||||
currentProgress = null;
|
||||
parent.Controls.Clear();
|
||||
progresses = new List<UiControls.TestProgressCtrl>();
|
||||
bool isOuterLoopMode = false;
|
||||
int outerLoopRepeats = 0;
|
||||
|
||||
|
||||
int i = 0;
|
||||
while (i < procedure.Tests.Count)
|
||||
{
|
||||
Config.Entities.Test test = procedure.Tests[i++];
|
||||
TBF.BenchControl.Generic.IComponent testMethod = TbfComponents.FindComponent(test.Method);
|
||||
if (testMethod is TBF.BenchControl.TestMethods.OuterLoop.Start.Component)
|
||||
|
||||
if (!isOuterLoopMode && test.IsOuterLoopStart)
|
||||
{
|
||||
isOuterLoopMode = true;
|
||||
outerLoopRepeats = (i < procedure.Tests.Count) ? procedure.Tests[i].Repeats : 1;
|
||||
continue;
|
||||
}
|
||||
if (testMethod is TBF.BenchControl.TestMethods.OuterLoop.End.Component)
|
||||
else if (isOuterLoopMode && test.IsOuterLoopEnd)
|
||||
{
|
||||
isOuterLoopMode = false;
|
||||
continue;
|
||||
@ -95,34 +107,40 @@ namespace TBF
|
||||
{
|
||||
if (isOuterLoopMode)
|
||||
{
|
||||
//int j = i - 1;
|
||||
//while (j < procedure.Tests.Count)
|
||||
//{
|
||||
// Config.Entities.Test test2 = procedure.Tests[j++];
|
||||
// TBF.BenchControl.Generic.IComponent tm2 = TbfComponents.FindComponent(test2.Method);
|
||||
// if (tm2 is TBF.BenchControl.TestMethods.OuterLoop.End.Component)
|
||||
// {
|
||||
// if (r == repeats) newI = j;
|
||||
// break;
|
||||
// }
|
||||
int j = i - 1;
|
||||
while (j < procedure.Tests.Count)
|
||||
{
|
||||
Config.Entities.Test test2 = procedure.Tests[j++];
|
||||
|
||||
// UiControls.TestProgressCtrl prgrs =
|
||||
// new UiControls.TestProgressCtrl(test2.Id, Results.Utils.GetTestName(test2.Name, test2.Repeats, r), test2.Part, Utils.TestTitle(test2, r), r, test2.Repeats);
|
||||
// progresses.Add(prgrs);
|
||||
// parent.Controls.Add(prgrs);
|
||||
//}
|
||||
if (test2.IsOuterLoopEnd)
|
||||
{
|
||||
if (r == repeats) newI = j;
|
||||
break;
|
||||
}
|
||||
|
||||
string test2Name = Results.Utils.GetTestName(test2.Name, test2.Repeats, r);
|
||||
UiControls.TestProgressCtrl progress =
|
||||
new UiControls.TestProgressCtrl(test2.Id, test2Name, test2.Part, Utils.TestTitle(test2, r), r, test2.Repeats);
|
||||
progresses.Add(progress);
|
||||
parent.Controls.Add(progress);
|
||||
Console.WriteLine(test2Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UiControls.TestProgressCtrl prgrs =
|
||||
new UiControls.TestProgressCtrl(test.Id, Results.Utils.GetTestName(test.Name, test.Repeats, r), test.Part, Utils.TestTitle(test, r), r, test.Repeats);
|
||||
progresses.Add(prgrs);
|
||||
parent.Controls.Add(prgrs);
|
||||
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, r);
|
||||
UiControls.TestProgressCtrl progress =
|
||||
new UiControls.TestProgressCtrl(test.Id, testName, test.Part, Utils.TestTitle(test, r), r, test.Repeats);
|
||||
progresses.Add(progress);
|
||||
parent.Controls.Add(progress);
|
||||
Console.WriteLine(testName);
|
||||
}
|
||||
}
|
||||
|
||||
i = newI;
|
||||
}
|
||||
|
||||
parent.ResumeLayout();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user