Stopping flow regulation after a test completes (in three test methods).

This commit is contained in:
Milan Hanajik
2019-04-25 11:00:34 +02:00
parent 24e23d01e8
commit 5dad80d031
8 changed files with 116 additions and 2 deletions
+10
View File
@@ -669,6 +669,16 @@ namespace TBF.BenchControl.Elde
return new QueryMeasurementEndOp(this);
}
/// <summary>
/// Stop controls board flow regulation operation
/// Events: FlowRegulationStopped
/// </summary>
/// <returns>Created operation</returns>
public IOperation StopFlowRegulationOp()
{
return new StopFlowRegulationOp(this);
}
/// <summary>
/// Stop the previous control board operation (diverter, gate, etc.)
/// Events: PreviousStopped
@@ -23,7 +23,7 @@ namespace TBF.BenchControl.Elde.RegulValve
public ValveCategory Category; /// Feeding, Output or All
public int AdcValueClosed; /// 0..1023
public int AdcValueOpen; /// 0..1023
public int StableTimeMs; /// 200..1500 ms
public int StableTimeMs; /// 200..1500 ms, step is 50 ms
public int FlowStableSec; /// 0..60 sec
public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions
public bool ReTryCommands;
@@ -0,0 +1,66 @@
///
/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using System;
using log4net;
namespace TBF.BenchControl.Elde
{
class StopFlowRegulationOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(StopFlowRegulationOp));
public override string ToString() { return string.Format("StopFlowRegulationOp(.)"); }
/// Set by the constructor
readonly ControlBoardDev controlBoard;
/// <summary>
/// Stop the previous control board operation (diverter, gate, etc.)
/// Events: None or PreviousStopped
/// </summary>
/// <param name="controlBoardDev">Control board component reference</param>
public StopFlowRegulationOp(ControlBoardDev controlBoardDev)
{
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
this.controlBoard = controlBoardDev;
log.Debug(this.ToString());
}
void SendStopFlowRegulationCommand()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(Command.None,
0, /// ref. flowmeter number
controlBoard.Route, /// route
0, 0, /// ref. pulses
0,
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 },
20,
0,
StopDevs.RegValveRegulation);
}
/// <summary>Start this operation</summary>
public void Start()
{
SendStopFlowRegulationCommand();
}
/// <summary>Run this operation</summary>
/// <returns>Event.FlowRegulationStopped</returns>
public Event Run()
{
return Event.FlowRegulationStopped;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
+1
View File
@@ -132,6 +132,7 @@ namespace TBF.BenchControl
UiCmdB3,
/// Process/Test oriented
FlowRegulationStopped,
PreviousStopped,
Wait,
ProcedureLoaded,
@@ -728,6 +728,18 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
StopRecordingStatistics();
State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopFlowRegulationOp())
.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.FlowRegulationStopped));
///
/// Quit this sequence
///
@@ -617,6 +617,18 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
StopRecordingStatistics();
State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopFlowRegulationOp())
.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.FlowRegulationStopped));
///
/// (Berlin:) Water is stopped immediately after the test and before the 2nd mass measurement in case:
/// - no 'transition sequence after test' is used
@@ -602,6 +602,18 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
StopRecordingStatistics();
State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopFlowRegulationOp())
.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.FlowRegulationStopped));
///
/// (Berlin:) Water is stopped immediately after the test and before the 2nd mass measurement in case:
/// - no 'transition sequence after test' is used
@@ -610,7 +622,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
#if !CEVAK_200
if (isLastRepetition && transitionAfter == null)
#endif
{
{
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff();
State.Create("SequenceBase : Transition : TestEnd - Default action")
+1
View File
@@ -554,6 +554,7 @@
<Compile Include="BenchControl\Elde\RegulValveCoax\SetFlowOp.cs" />
<Compile Include="BenchControl\Elde\RegulValveCoax\SetRegulValvePositionOp.cs" />
<Compile Include="BenchControl\Elde\SetValvesOp.cs" />
<Compile Include="BenchControl\Elde\StopFlowRegulationOp.cs" />
<Compile Include="BenchControl\Elde\TempMeterInternal\ReadTempOp.cs" />
<Compile Include="BenchControl\Elde\TempMeterInternal\TempMeter.cs" />
<Compile Include="BenchControl\Elde\TempMeterInternal\TempMeterCfg.cs" />