Endurance : Switching test : Progress bar update and statistics added.

This commit is contained in:
Milan Hanajik 2016-12-10 07:33:44 +01:00
parent 5e4da449ad
commit 20c7b07cb9
3 changed files with 76 additions and 12 deletions

View File

@ -121,6 +121,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
if (test.Part <= 3) /// 0 = measurement
/// 1 = measurement through line 1
/// 2 = measurement through line 2
@ -398,6 +399,14 @@ namespace TBF.BenchControl.TestMethods.Endurance
/// Endurance test : switching mode
///
//------------------------------------------------
Bridge.OnActivity(this, Strings.Endurance_cycle_execution);
//------------------------------------------------
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
ClearAllStatistics();
///
/// Update CyclePar[] array
///
@ -420,15 +429,9 @@ namespace TBF.BenchControl.TestMethods.Endurance
cyclePar[2 * stepsCount + 1] = 0;
cyclePar[2 * stepsCount + 2] = 0;
cyclePar[0] = duration / 10;
uint[] originalCyclePar = cBrd.CyclePar;
cBrd.CyclePar = cyclePar;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Endurance_cycle_execution);
//------------------------------------------------
///
cBrd.CyclePar = cyclePar;
///
State.Create("Endurance : Cycle parameters upload")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
@ -446,11 +449,17 @@ namespace TBF.BenchControl.TestMethods.Endurance
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
}
while (!e.Contains(Event.CommandCompleted));
bool stopInProgress = false;
bool stopInProgress = false;
///
State.Create("Endurance : Cycle execution")
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp((int)test.TstTime, Event.TimerExpired))
@ -473,11 +482,34 @@ namespace TBF.BenchControl.TestMethods.Endurance
stopInProgress = true;
break;
}
//------------------------------------------------
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
if (remainingTime > 60)
{
Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", Strings.Test_in_progress, remainingTime / 60, "min", remainingTime % 60, Strings.sec));
}
else
{
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
}
//------------------------------------------------
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (!e.Contains(Event.TimerExpired) && !e.Contains(Event.Next));
State.Create("Endurance : Extra delay to be sure the last endurance cycle completed")
//------------------------------------------------
Bridge.OnActivity(this, Strings.Last_cycle_wait_please);
//------------------------------------------------
State.Create("Endurance : Extra delay to be sure the last endurance cycle completed")
.AddOperation(checkUiOp)
.AddOperation(new Operations.TimerOp((int)(duration / 1000) + 1, Event.TimerExpired))
.AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp))
@ -497,7 +529,15 @@ namespace TBF.BenchControl.TestMethods.Endurance
{
stopInProgress = true;
}
}
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
UpdateAllStatistics();
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
}
while (!e.Contains(Event.TimerExpired) && !e.Contains(Event.Next));

View File

@ -1761,6 +1761,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Last cycle, wait please..
/// </summary>
internal static string Last_cycle_wait_please {
get {
return ResourceManager.GetString("Last_cycle_wait_please", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Less.
/// </summary>
@ -4401,6 +4410,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Wait please.
/// </summary>
internal static string Wait_please {
get {
return ResourceManager.GetString("Wait_please", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Warning.
/// </summary>

View File

@ -1606,4 +1606,10 @@
<data name="Endurance_cycle_execution" xml:space="preserve">
<value>Endurance cycle execution</value>
</data>
<data name="Last_cycle_wait_please" xml:space="preserve">
<value>Last cycle, wait please.</value>
</data>
<data name="Wait_please" xml:space="preserve">
<value>Wait please</value>
</data>
</root>