Progress bar fixed for Pressure and Leak test.

This commit is contained in:
Milan Hanajik
2016-05-19 12:43:45 +02:00
parent 3d844390e7
commit 7c7f330a0b
2 changed files with 30 additions and 10 deletions
@@ -37,15 +37,19 @@ namespace TBF.BenchControl.TestMethods.LeakTest
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.JustStarted));
// Transition or SetRoute - Start
// 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; }
}
/// Start the test, initialize test results
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.TransitionBefore));
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, 1);
@@ -71,7 +75,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest
//------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
//------------------------------------------------
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.FlowSetting));
//------------------------------------------------
float pumpPower = test.PumpPower;
int startTime = StateMachine.Time;
@@ -131,7 +136,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
//------------------------------------------------
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Test));
//------------------------------------------------
State.Create("LeakTest : Maximum water pressure set")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
@@ -383,7 +389,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest
stopTest:
///
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.TransitionAfter));
///
/// Quit this sequence
///
State.Create("LeakTest : Stopping diverter, gate, etc.")
@@ -405,7 +413,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
/// Create a list with one item 'retVal' (default is Event.Done) and return it
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Completed));
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retList = new List<Event>(1);
retList.Add(retVal);
return retList;
@@ -37,6 +37,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
TestProgressEventArgs.SetEstimatedTimes(new int[] { 1, 1, 1, 30, Convert.ToInt32(test.TstTime) + 15, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.JustStarted));
// Transition or SetRoute - Start
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
@@ -45,6 +47,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.TransitionBefore));
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, 1);
@@ -72,7 +76,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
//------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
//------------------------------------------------
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.FlowSetting));
//------------------------------------------------
float pumpPower = test.PumpPower;
int startTime = StateMachine.Time;
@@ -132,8 +137,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Test));
//------------------------------------------------
State.Create("PMaxTest : Starting the test")
State.Create("PMaxTest : Starting the test")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
@@ -297,7 +303,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
stopTest:
///
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.TransitionAfter));
///
/// Quit this sequence
///
State.Create("PMaxTest : Stopping diverter, gate, etc.")
@@ -311,7 +319,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
}
while (!e.Contains(Event.PreviousStopped));
/// Transition sequence at the end of test
/// 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))
{
@@ -319,6 +327,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Config.Entities.Progress.Completed));
/// Create a list with one item 'retVal' (default is Event.Done) and return it
IList<Event> retList = new List<Event>(1);
retList.Add(retVal);