Standing start/stop fixed, ver. 3.1.1653

This commit is contained in:
Milan Hanajik
2021-05-21 17:13:45 +02:00
parent 81151935bc
commit 62d725d879
34 changed files with 161 additions and 366 deletions
+1 -1
View File
@@ -75,6 +75,6 @@ namespace TBF.Rig.ControlBoard
/// <returns>Operation</returns>
IOperation QueryMeasurementEndOp();
IOperation StopPreviousOp();
void StopAll(bool isFromUI);
}
}
+1 -2
View File
@@ -474,9 +474,8 @@ namespace TBF.Rig.ControlBoard.Papouch
return null;
}
public IOperation StopPreviousOp()
public void StopAll(bool isFromUI)
{
return new Operations.ReturnGivenEventOp(Event.PreviousStopped);
}
@@ -212,7 +212,7 @@ namespace TBF.Rig.ControlBoard.Uni
public void Stop()
{
log.Info("Op.Stop()");
uniCB.Stop(false);
uniCB.StopAll(false);
}
}
}
@@ -107,9 +107,7 @@ namespace TBF.Rig.ControlBoard.Uni
return Event.OpArgumentError; /// Invalid qFrom, qTo
}
if (!flowMeter.MsrmntAvailable || /// Flow measurement not started yet
(uniCB.State & (ulong)StatusP.TestInProgress) == 0 || /// Test was not started yet
(flowMeter.ReadFlow()) == 0) /// Measured flow is 0
if (!flowMeter.MsrmntAvailable || flowMeter.ReadFlow() == 0) // Measured flow is 0
{
return Event.StartingTest; /// Flow regulation cannot be started
}
@@ -127,7 +125,7 @@ namespace TBF.Rig.ControlBoard.Uni
case OpState.TestInProgress:
if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0 && uniCB.RefPulses < pulsesCount)
if (uniCB.RefPulses < pulsesCount)
{
return Event.TestInProgress; /// Test was not completed yet
}
@@ -146,7 +144,7 @@ namespace TBF.Rig.ControlBoard.Uni
public void Stop()
{
log.Info("Op.Stop()");
uniCB.Stop(false);
uniCB.StopAll(false);
}
}
}
+2 -2
View File
@@ -594,7 +594,7 @@ namespace TBF.Rig.ControlBoard.Uni
public IOperation StopFlowRegulationOp()
{
Stop(false);
StopAll(false);
//scheduledActionQueue.Enqueue(Action.Stop());
return null;
}
@@ -720,7 +720,7 @@ namespace TBF.Rig.ControlBoard.Uni
foreach (var a in actionQueue) log.DebugFormat(" {0}", a);
}
public void Stop(bool isFromUI)
public void StopAll(bool isFromUI)
{
if (IsUIBlocked && isFromUI) return;
@@ -539,7 +539,7 @@ namespace TBF.Rig.TestMethods.Adjustment
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -151,18 +151,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
/// Specific for combined meters
int[] lastWMPulses = new int[2 * Config.Data.CompoundWMsCount];
//--------------------------------
State.Create(string.Format("{0}({1}) : Stop diverter gate etc", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test,e)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
@@ -674,18 +663,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection
}
while (!e.Contains(Event.ValvesSet));
//--------------------------------
State.Create(string.Format("{0}({1}) : Stop_diverter_gate_etc", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test,e)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
@@ -854,7 +854,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
+10 -25
View File
@@ -530,16 +530,7 @@ namespace TBF.Rig.TestMethods.Endurance
Bridge.OnActivity(this, Strings.Endurance_cycle_execution);
//------------------------------------------------
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
int estimtdEndTime = StateMachine.Time + (int)test.TestTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
@@ -674,21 +665,15 @@ namespace TBF.Rig.TestMethods.Endurance
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
+10 -28
View File
@@ -657,18 +657,7 @@ namespace TBF.Rig.TestMethods.FixedStart
TestEndTime = DateTime.Now;
int endPulses = cBrd.RefPulses;
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
@@ -1045,22 +1034,15 @@ namespace TBF.Rig.TestMethods.FixedStart
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -493,18 +493,7 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
while (e.Contains(Event.ValvesBusy));
}
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double massStart = Config.Formulas.CorrectedValue(StartMass.Val, scale.Corrections);
double massEnd = Config.Formulas.CorrectedValue(EndMass.Val, scale.Corrections);
@@ -662,21 +651,15 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal }; /// default 'retVal' value is Event.Done
@@ -697,18 +697,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime;
log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime);
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double flowVolume = 3.6 * LtrPerRefPulse * Convert.ToDouble(endPulses - startPulses) / cBrd.TestTime;
double constMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flowVolume, rangeIx);
@@ -870,21 +859,15 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; } /// TODO: this is an endless loop !!!
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal }; /// default 'retVal' value is Event.Done
@@ -641,18 +641,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
while (e.Contains(Event.ValvesBusy));
}
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double massStart = Config.Formulas.CorrectedValue(StartMass.Val, scale.Corrections);
double massEnd = Config.Formulas.CorrectedValue(EndMass.Val, scale.Corrections);
@@ -1048,21 +1037,15 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
if (outPath.FlowMeter is TBF.Rig.Dummy.FlowMeter.FlowMeter)
@@ -793,18 +793,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
while (e.Contains(Event.ValvesBusy));
}
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double massStart = Config.Formulas.CorrectedValue(StartMass.Val, scale.Corrections);
double massEnd = Config.Formulas.CorrectedValue(EndMass.Val, scale.Corrections);
@@ -969,21 +958,15 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; } /// TODO: this is an endless loop !!!
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal }; /// default 'retVal' value is Event.Done
@@ -620,17 +620,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
log.WarnFormat("Volumes = {0}l", volumeBox.Val);
TestEndTime = DateTime.Now;
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
double volumeCTV = volumeBox.Val;
double refEnergy = Energy.Sum * volumeCTV / VolumeForEnergy.Sum; /// [J]=[J]*[l]/[l]
@@ -904,22 +894,15 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -398,21 +398,15 @@ namespace TBF.Rig.TestMethods.FlowAdjustment
}
while (!e.Contains(Event.FlowRegulationStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -725,7 +725,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
StopRecordingStatistics();
cBrd.Stop(false);
cBrd.StopAll(false);
///
/// Quit this sequence
@@ -735,7 +735,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -1041,7 +1041,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -1112,7 +1112,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -999,7 +999,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -1047,7 +1047,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -759,7 +759,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
+9 -15
View File
@@ -486,21 +486,15 @@ namespace TBF.Rig.TestMethods.LeakTest
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
+9 -15
View File
@@ -305,21 +305,15 @@ namespace TBF.Rig.TestMethods.PMaxTest
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.TransitionAfter));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -512,7 +512,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.Stop(false);
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -495,21 +495,15 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
stopTest:
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -268,21 +268,15 @@ namespace TBF.Rig.TestMethods.RoiDetection
stopTest:
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) break;
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -102,17 +102,7 @@ namespace TBF.Rig.TestMethods.SensitivityTest
int[] lastWMPulses = new int[Config.Data.WMsCount];
//--------------------------------
State.Create(string.Format("{0}({1}) : stopTest diverter gate etc", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test,e)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
@@ -436,18 +426,7 @@ namespace TBF.Rig.TestMethods.SensitivityTest
}
while (!e.Contains(Event.ValvesSet));
//--------------------------------
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test,e)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
@@ -575,19 +554,12 @@ namespace TBF.Rig.TestMethods.SensitivityTest
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) break;
}
while (!e.Contains(Event.PreviousStopped));
cBrd.StopAll(false);
}
return new List<Event> { retVal };
@@ -444,7 +444,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
/// Temperature is withing required range at this point
///
IOperation testInProgress = cBrd.StandingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses, true);
IOperation testInProgress = cBrd.StandingStartStopTestOp(test, test.Qfrom, test.Qto, 2 * totalPulses, true);
//-----------------------------------------------------------------
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
@@ -650,6 +650,8 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
int remainingTime;
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
int initialPulsesCount = RefPulses;
State.Create(string.Format("{0}({1}) : Start the test, open the start/stop valve", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
@@ -701,7 +703,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
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.TestCompleted) && !e.Contains(Event.Next));
while (cBrd.RefPulses < initialPulsesCount + totalPulses && !e.Contains(Event.TestCompleted) && !e.Contains(Event.Next));
/// Measurement loop end
switchTimeStart = 0.001f * cBrd.ValveOpenCloseTime;
@@ -1162,21 +1164,15 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
StopRecordingStatistics();
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError
|| retVal == Event.Error || retVal == Event.ConfigurationError)
{
State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
}
while (!e.Contains(Event.PreviousStopped));
///
/// Quit this sequence
///
if (isLastRepetition || retVal == Event.UiCmdStop
|| retVal == Event.OpArgumentError
|| retVal == Event.Error
|| retVal == Event.ConfigurationError)
{
cBrd.StopAll(false);
}
return new List<Event> { retVal };
+1 -1
View File
@@ -305,7 +305,7 @@ namespace TBF.Rig.Uni.RegValve
if (!leaveMeasurementRunning)
{
/// Stop flow measurement
uniCB.Stop(false);
uniCB.StopAll(false);
}
opState = OpState.Idle;
+1 -1
View File
@@ -472,7 +472,7 @@ namespace TBF.Rig.Uni.RegValveAnalog
{
opState = OpState.Idle;
if (leaveMeasurementRunning) return;
uniCB.Stop(false); /// Stop measurement
uniCB.StopAll(false); /// Stop measurement
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterId);
}
}
+1 -1
View File
@@ -358,7 +358,7 @@ namespace TBF.Rig.Uni.RegValveTandem
if (leaveMeasurementRunning) return;
uniCB.Stop(false); /// Stop measurement
uniCB.StopAll(false); /// Stop measurement
}
}
}
@@ -120,7 +120,7 @@ namespace TBF.Rig.Uni.RegValveTandem
/// <summary>Stop this operation</summary>
public void Stop()
{
uniCB.Stop(false);
uniCB.StopAll(false);
}
}
}