FixedStartDeferredEvalSeq : Delay time before grabbing images introduced.

This commit is contained in:
Milan Hanajik
2019-12-13 18:08:53 +01:00
parent 512530f456
commit 55df6e809e
4 changed files with 69 additions and 18 deletions
@@ -386,18 +386,33 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
while (!e.Contains(Event.ValvesSet));
int time = StateMachine.Time;
double currentFlow = RefFlow.Val;
if (test.TimeFlow2Mass > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before grabbing images", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(new Operations.TimerOp(test.TimeFlow2Mass))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
}
TestStartTime = DateTime.Now;
LogProcessDataTestInfo(processDataLogger, test.Procedure.Name, test.Name);
int startTime = StateMachine.Time;
int startPulses = 0;
///
/// Grab start images
/// Take start images
///
//-----------------------------------------------------------------
Bridge.OnActivity(this, Strings.Grabbing_images);
//-----------------------------------------------------------------
string fileName = string.Format("{0}-start.bmp", test.Name);
string[] startImages = new string[sensPath.RegisterReaders.Length];
///
@@ -632,8 +647,26 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
EndTime = (double)StateMachine.Time;
TestEndTime = DateTime.Now;
int endPulses = cBrd.EtPulses(0);
if (test.TimeStop2Mass > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before grabbing images", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired));
}
int endPulses = cBrd.EtPulses(0);
switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime;
log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime);
@@ -659,6 +692,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval
///
/// Grab END images
///
//-----------------------------------------------------------------
Bridge.OnActivity(this, Strings.Grabbing_images);
//-----------------------------------------------------------------
fileName = string.Format("{0}-end.bmp", test.Name);
string[] endImages = new string[sensPath.RegisterReaders.Length];
///
@@ -650,20 +650,23 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Waiting before the 2nd mass measurement", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(scale.ReadMassOp(ref Mass))
.AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, CountWhenSendingRdDivCmd, CountWhenReadingDiv, false, DiverterEnd, BatchRslts.Batch.BatchNr, test.Name, repetitionNr))
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
if (test.TimeStop2Mass > 0)
{
State.Create(string.Format("{0}({1}) : Waiting before the 2nd mass measurement", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(scale.ReadMassOp(ref Mass))
.AddOperation(cBrd.ReadDiverterTransitionOp(outPath.Diverter, CountWhenSendingRdDivCmd, CountWhenReadingDiv, false, DiverterEnd, BatchRslts.Batch.BatchNr, test.Name, repetitionNr))
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone));
}
while (!e.Contains(Event.TimerExpired) || !e.Contains(Event.BalanceDone));
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass");
+9
View File
@@ -2013,6 +2013,15 @@ namespace TBF.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Grabbing images.
/// </summary>
internal static string Grabbing_images {
get {
return ResourceManager.GetString("Grabbing_images", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Graphs.
/// </summary>
+3
View File
@@ -2128,4 +2128,7 @@
<data name="calculated" xml:space="preserve">
<value>calculated</value>
</data>
<data name="Grabbing_images" xml:space="preserve">
<value>Grabbing images</value>
</data>
</root>