Koncim 8.8.14

This commit is contained in:
Milan Hanajik
2014-08-08 16:25:51 +02:00
parent ae09afef59
commit ffb4d5afb6
8 changed files with 19 additions and 15 deletions
@@ -139,7 +139,7 @@ namespace TBF.BenchControl.DataEntry.Munich
resultSaved = true; resultSaved = true;
} }
return Event.ModelessFormDone; /// Form closed return Event.ModelessFormClosed; /// Form closed
} }
/// <summary>Stop this operation</summary> /// <summary>Stop this operation</summary>
@@ -131,7 +131,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
resultSaved = true; resultSaved = true;
} }
return Event.ModelessFormDone; /// Form closed return Event.ModelessFormClosed; /// Form closed
} }
/// <summary>Stop this operation</summary> /// <summary>Stop this operation</summary>
@@ -165,7 +165,7 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <summary>Run this operation</summary> /// <summary>Run this operation</summary>
/// <returns> /// <returns>
/// Event.None, Event.FlowReached, Event.RegulValveTimeOut, Event.Error /// Event.None, Event.FlowReached, Event.RegulValveTimeOut, Event.OpArgumentError
/// </returns> /// </returns>
public Event Run() public Event Run()
{ {
@@ -198,7 +198,7 @@ namespace TBF.BenchControl.Elde.RegulValve
{ {
if (reqFlowLo >= reqFlowHi || reqFlowLo > flowMeter.NominalFlow || reqFlowHi <= 0) if (reqFlowLo >= reqFlowHi || reqFlowLo > flowMeter.NominalFlow || reqFlowHi <= 0)
{ {
return Event.Error; return Event.OpArgumentError;
} }
log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}", log.InfoFormat("Run(): rv#={0} flowMtr#={1} TARGET: flowLo={2} flowHi={3}",
@@ -73,7 +73,9 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <summary>Run this operation</summary> /// <summary>Run this operation</summary>
/// <returns> /// <returns>
/// Event.SetFlowDone /// Event.None . . . . . . . busy adjusting position
/// Event.PositionReached . . position reached
/// Event.OpArgumentError . . invalid required position
/// </returns> /// </returns>
public Event Run() public Event Run()
{ {
@@ -81,7 +83,7 @@ namespace TBF.BenchControl.Elde.RegulValve
{ {
if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0) if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0)
{ {
return Event.Error; return Event.OpArgumentError;
} }
firstRun = false; firstRun = false;
@@ -99,7 +101,7 @@ namespace TBF.BenchControl.Elde.RegulValve
if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0) if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0)
{ {
return Event.Error; return Event.OpArgumentError;
} }
else if (posLoPct <= positionPct && positionPct <= posHiPct) else if (posLoPct <= positionPct && positionPct <= posHiPct)
{ {
+2 -1
View File
@@ -28,7 +28,7 @@
{ {
None = 0, None = 0,
Done, Done,
ModelessFormDone, ModelessFormClosed,
ValvesSet, ValvesSet,
AmbientDone, AmbientDone,
BalanceDone, BalanceDone,
@@ -90,6 +90,7 @@
/// Generic /// Generic
Error, /// Many ops.: Fatal error occurred Error, /// Many ops.: Fatal error occurred
OpArgumentError,
ConfigurationError, ConfigurationError,
Yes, Yes,
No, No,
@@ -53,14 +53,14 @@ namespace TBF.BenchControl.Sequences
Entities.TransitionSequence purgeBegin; Entities.TransitionSequence purgeBegin;
Entities.TransitionSequence purgeEnd; Entities.TransitionSequence purgeEnd;
StateMachine.LoadProcedure(true); StateMachine.LoadProcedure(true); // TODO: Implement as an operation so that the worker thread is not blocked
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
//------------------------------------------------ //------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight); Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------ //------------------------------------------------
State.Create(Strings.Set_route) State.Create("MainSeq : Setting valves to the default state")
.AddOperation(new MettlerToledo.ReadMassesOp()) .AddOperation(new MettlerToledo.ReadMassesOp())
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose)) .AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
.EnterState(); .EnterState();
@@ -478,7 +478,7 @@ namespace TBF.BenchControl.Sequences
{ {
Bridge.OnActivity(this, "Enter the protocol data"); Bridge.OnActivity(this, "Enter the protocol data");
if (!State.Events.Contains(Event.ModelessFormDone)) if (!State.LastEvents.Contains(Event.ModelessFormClosed))
{ {
/// Wait until modeless dialg is closed /// Wait until modeless dialg is closed
State.Create("MainSeq : Check whether the entry form is closed") State.Create("MainSeq : Check whether the entry form is closed")
@@ -489,7 +489,7 @@ namespace TBF.BenchControl.Sequences
e = StateMachine.WaitRunDevsRunOps(); e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stop; if (e.Contains(Event.UiCmdStop)) goto stop;
} }
while (!e.Contains(Event.ModelessFormDone)); while (!e.Contains(Event.ModelessFormClosed));
} }
/// A state without any dataEntryCmpnt operation so that Stop() when entering /// A state without any dataEntryCmpnt operation so that Stop() when entering
@@ -511,7 +511,7 @@ namespace TBF.BenchControl.Sequences
e = StateMachine.WaitRunDevsRunOps(); e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stop; if (e.Contains(Event.UiCmdStop)) goto stop;
} }
while (!e.Contains(Event.ModelessFormDone)); while (!e.Contains(Event.ModelessFormClosed));
if (dataEntryCmpnt is IHasProtocolTitle) if (dataEntryCmpnt is IHasProtocolTitle)
{ {
+2 -2
View File
@@ -27,7 +27,7 @@ namespace TBF.BenchControl
/// <summary> /// <summary>
/// Events returned by the last RunOperations() /// Events returned by the last RunOperations()
/// </summary> /// </summary>
public static IList<Event> Events; public static IList<Event> LastEvents;
/// <summary>State with an empty list of operations</summary> /// <summary>State with an empty list of operations</summary>
@@ -205,7 +205,7 @@ namespace TBF.BenchControl
} }
} }
Events = events; LastEvents = events;
return events; return events;
} }
@@ -152,6 +152,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress)); Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
if (e.Contains(Event.UiCmdStop)) goto stop; if (e.Contains(Event.UiCmdStop)) goto stop;
if (e.Contains(Event.OpArgumentError))
if (e.Contains(Event.RegulValveTimeOut)) goto error; if (e.Contains(Event.RegulValveTimeOut)) goto error;
if (e.Contains(Event.Next)) goto flow_set; if (e.Contains(Event.Next)) goto flow_set;
} }