TestMethods.Evacuation added, ProcessData.FillState updated by SequenceBase.Transition(), ver. 2.27.1813, Statistics v. 2.27.1800
This commit is contained in:
parent
1d152afd6c
commit
ed606701c0
@ -377,6 +377,17 @@ namespace Common
|
|||||||
Count
|
Count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// State of water filled in the test bench.
|
||||||
|
/// </summary>
|
||||||
|
public enum FillState
|
||||||
|
{
|
||||||
|
Unknown, /// Test bench fill state is unknown
|
||||||
|
Empty, /// Test bench is empty, no water
|
||||||
|
Full, /// Test bench is full of water
|
||||||
|
Count
|
||||||
|
}
|
||||||
|
|
||||||
public enum MeretProtocol
|
public enum MeretProtocol
|
||||||
{
|
{
|
||||||
[Description("<undefined>")] Undefined,
|
[Description("<undefined>")] Undefined,
|
||||||
|
|||||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.25.1427.0")]
|
[assembly: AssemblyVersion("2.27.1800.0")]
|
||||||
[assembly: AssemblyFileVersion("2.25.1427.0")]
|
[assembly: AssemblyFileVersion("2.27.1800.0")]
|
||||||
|
|||||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.27.1807.0")]
|
[assembly: AssemblyVersion("2.27.1813.0")]
|
||||||
[assembly: AssemblyFileVersion("2.27.1807.0")]
|
[assembly: AssemblyFileVersion("2.27.1813.0")]
|
||||||
|
|||||||
@ -131,7 +131,7 @@ namespace TBF.Rig.Sequences
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MainSeq()
|
public MainSeq()
|
||||||
{
|
{
|
||||||
benchFilled = false;
|
FillState = FillState.Unknown;
|
||||||
|
|
||||||
simultWithPurgingCount = 0;
|
simultWithPurgingCount = 0;
|
||||||
simultWithPurgingCfg = null;
|
simultWithPurgingCfg = null;
|
||||||
@ -497,7 +497,10 @@ namespace TBF.Rig.Sequences
|
|||||||
{
|
{
|
||||||
goto assume_bench_filled;
|
goto assume_bench_filled;
|
||||||
}
|
}
|
||||||
else if ((selection == Selection.Cycle && benchFilled) || (selection == Selection.RestoreBatch) || (selection == Selection.RestoreAndFixBatch) || (selection == Selection.RestoreInterruptedSession))
|
else if ((selection == Selection.Cycle && FillState == FillState.Full) ||
|
||||||
|
(selection == Selection.RestoreBatch) ||
|
||||||
|
(selection == Selection.RestoreAndFixBatch) ||
|
||||||
|
(selection == Selection.RestoreInterruptedSession))
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
/// Always ask a question in case of a restored batch
|
/// Always ask a question in case of a restored batch
|
||||||
@ -588,7 +591,7 @@ namespace TBF.Rig.Sequences
|
|||||||
|
|
||||||
assume_bench_filled:
|
assume_bench_filled:
|
||||||
|
|
||||||
benchFilled = true;
|
FillState = FillState.Full;
|
||||||
Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled);
|
Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled);
|
||||||
|
|
||||||
if ((selection == Selection.Cycle) || (selection == Selection.RestoreBatch) || (selection == Selection.RestoreAndFixBatch))
|
if ((selection == Selection.Cycle) || (selection == Selection.RestoreBatch) || (selection == Selection.RestoreAndFixBatch))
|
||||||
@ -704,6 +707,7 @@ namespace TBF.Rig.Sequences
|
|||||||
if (selection == Selection.PurgeBegin) goto fill_the_bench;
|
if (selection == Selection.PurgeBegin) goto fill_the_bench;
|
||||||
if (selection == Selection.PurgeEnd)
|
if (selection == Selection.PurgeEnd)
|
||||||
{
|
{
|
||||||
|
FillState = FillState.Unknown; /// Enfoce evacuation
|
||||||
switch (DoEvacuation(purgeEnd))
|
switch (DoEvacuation(purgeEnd))
|
||||||
{
|
{
|
||||||
case Event.Error: goto error;
|
case Event.Error: goto error;
|
||||||
|
|||||||
@ -811,8 +811,8 @@ namespace TBF.Rig.Sequences
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
benchFilled = false; /// because evacuation sequence started
|
if (FillState != FillState.Empty)
|
||||||
///
|
{
|
||||||
switch (Transition(purgeEnd, TransitionContext.PurgeEnd))
|
switch (Transition(purgeEnd, TransitionContext.PurgeEnd))
|
||||||
{
|
{
|
||||||
case Event.Error:
|
case Event.Error:
|
||||||
@ -826,6 +826,7 @@ namespace TBF.Rig.Sequences
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (simultWithEvacuationCount > 0)
|
if (simultWithEvacuationCount > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using Common;
|
||||||
using TBF.Rig.GenericDevices;
|
using TBF.Rig.GenericDevices;
|
||||||
using TBF.Boxes;
|
using TBF.Boxes;
|
||||||
|
|
||||||
@ -43,6 +44,13 @@ namespace TBF.Rig.Sequences
|
|||||||
public static IList<Results.Output.SensusTestInfo> RawTestInfos; /// Incomplete raw test infos from Oracle DB
|
public static IList<Results.Output.SensusTestInfo> RawTestInfos; /// Incomplete raw test infos from Oracle DB
|
||||||
public static Results.Output.SensusTestInfo[] CompleteTestInfos; /// Complete TBF test infos obtained as a best mathch
|
public static Results.Output.SensusTestInfo[] CompleteTestInfos; /// Complete TBF test infos obtained as a best mathch
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// State of water filled in the test bench.
|
||||||
|
/// Updated by Transition(sequence, context)
|
||||||
|
/// when context == TransitionContext.PurgeBegin
|
||||||
|
/// or context == TransitionContext.PurgeEnd
|
||||||
|
/// </summary>
|
||||||
|
public static FillState FillState;
|
||||||
|
|
||||||
static ProcessData()
|
static ProcessData()
|
||||||
{
|
{
|
||||||
@ -54,6 +62,7 @@ namespace TBF.Rig.Sequences
|
|||||||
IsQ2PreCorrectionCalculated = false;
|
IsQ2PreCorrectionCalculated = false;
|
||||||
CalculatedQ2PreCorrectionLR = 0;
|
CalculatedQ2PreCorrectionLR = 0;
|
||||||
CalculatedQ2PreCorrectionRL = 0;
|
CalculatedQ2PreCorrectionRL = 0;
|
||||||
|
FillState = FillState.Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -547,15 +547,16 @@ namespace TBF.Rig.Sequences
|
|||||||
case TransitionContext.BetweenTests: message = Strings.Between_tests_sequence_i_n; break;
|
case TransitionContext.BetweenTests: message = Strings.Between_tests_sequence_i_n; break;
|
||||||
|
|
||||||
case TransitionContext.AfterTestWithOverlap:
|
case TransitionContext.AfterTestWithOverlap:
|
||||||
case TransitionContext.AfterTest:
|
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
|
||||||
message = Strings.Test_stop_sequence_i_n;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
|
||||||
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
|
||||||
default: message = "Transition"; break;
|
default: message = "Transition"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (context == TransitionContext.PurgeBegin && FillState != FillState.Full) FillState = FillState.Unknown;
|
||||||
|
if (context == TransitionContext.PurgeEnd && FillState != FillState.Empty) FillState = FillState.Unknown;
|
||||||
|
|
||||||
if (transitionSequence == null)
|
if (transitionSequence == null)
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
@ -569,11 +570,9 @@ namespace TBF.Rig.Sequences
|
|||||||
|
|
||||||
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
State.Create("SequenceBase : Transition : TestEnd - Default action")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||||
StateMachine.DefaultValvesClose))
|
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop;
|
||||||
}
|
}
|
||||||
@ -832,8 +831,12 @@ namespace TBF.Rig.Sequences
|
|||||||
else if (stopFlag)
|
else if (stopFlag)
|
||||||
return Event.UiCmdStop;
|
return Event.UiCmdStop;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (context == TransitionContext.PurgeBegin) FillState = FillState.Full;
|
||||||
|
if (context == TransitionContext.PurgeEnd) FillState = FillState.Empty;
|
||||||
return Event.Done;
|
return Event.Done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Event PerformSteps(IList<IValve> valvesToOpen, IList<IValve> valvesToClose, IList<IOperation> rvPosOps, string stateTitle)
|
Event PerformSteps(IList<IValve> valvesToOpen, IList<IValve> valvesToClose, IList<IOperation> rvPosOps, string stateTitle)
|
||||||
|
|||||||
@ -63,6 +63,7 @@ namespace TBF.Rig
|
|||||||
Factories.Add(new TestMethods.DiverterTest.Factory());
|
Factories.Add(new TestMethods.DiverterTest.Factory());
|
||||||
Factories.Add(new TestMethods.Dummy.Factory());
|
Factories.Add(new TestMethods.Dummy.Factory());
|
||||||
Factories.Add(new TestMethods.Endurance.Factory());
|
Factories.Add(new TestMethods.Endurance.Factory());
|
||||||
|
Factories.Add(new TestMethods.Evacuation.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.Single.Factory());
|
Factories.Add(new TestMethods.FixedStart.Single.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
|
Factories.Add(new TestMethods.FixedStart.Compound.Factory());
|
||||||
Factories.Add(new TestMethods.FixedStart.HeatMeters.Factory());
|
Factories.Add(new TestMethods.FixedStart.HeatMeters.Factory());
|
||||||
|
|||||||
40
TBF/Rig/TestMethods/Evacuation/Component.cs
Normal file
40
TBF/Rig/TestMethods/Evacuation/Component.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using log4net;
|
||||||
|
using Common;
|
||||||
|
using Config.Entities;
|
||||||
|
|
||||||
|
namespace TBF.Rig.TestMethods.Evacuation
|
||||||
|
{
|
||||||
|
public class Component : ComponentBase, GenericDevices.ITestMethod
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("{0}({1})", GetType().Namespace.Substring(8), Cfg.ToString(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanTest(MetersKind meters) { return true; }
|
||||||
|
public bool DoTransitions() { return false; }
|
||||||
|
|
||||||
|
public Component() { }
|
||||||
|
|
||||||
|
public Component(Generic.IComponentCfg cfg)
|
||||||
|
: base(cfg)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
||||||
|
{
|
||||||
|
return (new EvacuationSeq()).Execute(test, repetNr, isLastRepetition, DebugLevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
95
TBF/Rig/TestMethods/Evacuation/EvacuationSeq.cs
Normal file
95
TBF/Rig/TestMethods/Evacuation/EvacuationSeq.cs
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Common;
|
||||||
|
using log4net;
|
||||||
|
using TBF.Resources;
|
||||||
|
using TBF.UiBridge;
|
||||||
|
using Config.Entities;
|
||||||
|
|
||||||
|
namespace TBF.Rig.TestMethods.Evacuation
|
||||||
|
{
|
||||||
|
public class EvacuationSeq : Sequences.SequenceBase
|
||||||
|
{
|
||||||
|
private static readonly ILog log = LogManager.GetLogger(typeof(EvacuationSeq));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fixed start mass collection method sequence
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="test">Test entity</param>
|
||||||
|
/// <returns>
|
||||||
|
/// Event.Done . . . . . . . OK
|
||||||
|
/// Event.MakeSecondPass . . OK, 2nd pass (=evaluation) required
|
||||||
|
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
||||||
|
/// Event.OpArgumentError . Target flow is out of range
|
||||||
|
/// Event.Error . . . . . . Unspecified error
|
||||||
|
/// </returns>
|
||||||
|
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||||
|
DebugMode debugLevel)
|
||||||
|
{
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
|
//------------------------------------------------
|
||||||
|
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.JustStarted));
|
||||||
|
|
||||||
|
TransitionSequence purgeEnd = StateMachine.TransitionSequences
|
||||||
|
.FirstOrDefault<TransitionSequence>(x => x.Name == StateMachine.Procedure.TransitionEnd);
|
||||||
|
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
Event retVal = (purgeEnd != null) ? Transition(purgeEnd, TransitionContext.PurgeEnd) : Event.OK;
|
||||||
|
bool passed = (retVal == Event.Done);
|
||||||
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
|
//------------------------------------------------
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Populate TestResult data entity with data
|
||||||
|
///
|
||||||
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
|
if (tstRslt != null)
|
||||||
|
{
|
||||||
|
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
|
||||||
|
UpdateTempPressDensAmb(tstRslt);
|
||||||
|
|
||||||
|
/// Main results
|
||||||
|
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
|
||||||
|
tstRslt.TestDone = passed;
|
||||||
|
tstRslt.ErrorFlags = 0;
|
||||||
|
tstRslt.InfoFlags = 0;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Single meters
|
||||||
|
///
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
|
||||||
|
GenericDevices.IRegReader regReader = sensPath.RegisterReaders[i];
|
||||||
|
|
||||||
|
if (meterRslt != null && regReader != null)
|
||||||
|
{
|
||||||
|
meterRslt.TestDone = passed;
|
||||||
|
meterRslt.Passed = passed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Update results
|
||||||
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName, tstRslt));
|
||||||
|
}
|
||||||
|
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.TransitionAfter));
|
||||||
|
|
||||||
|
return new List<Event> { retVal };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
TBF/Rig/TestMethods/Evacuation/Factory.cs
Normal file
25
TBF/Rig/TestMethods/Evacuation/Factory.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||||
|
///
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using TBF.Rig.Generic;
|
||||||
|
using TBF.Rig.Configs.NameOnly;
|
||||||
|
|
||||||
|
namespace TBF.Rig.TestMethods.Evacuation
|
||||||
|
{
|
||||||
|
public class Factory : IComponentFactory
|
||||||
|
{
|
||||||
|
public string ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||||
|
|
||||||
|
public IComponent DummyComponent() { return new Component(); }
|
||||||
|
|
||||||
|
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||||
|
|
||||||
|
public IComponentCfg DefaultConfig() { return new TestMethodCfg(GetType().Namespace.Substring(20), this); }
|
||||||
|
|
||||||
|
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||||
|
{
|
||||||
|
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1332,6 +1332,9 @@
|
|||||||
<Compile Include="Rig\TestMethods\Endurance\CycleStepsCtrl.cs">
|
<Compile Include="Rig\TestMethods\Endurance\CycleStepsCtrl.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Rig\TestMethods\Evacuation\Component.cs" />
|
||||||
|
<Compile Include="Rig\TestMethods\Evacuation\Factory.cs" />
|
||||||
|
<Compile Include="Rig\TestMethods\Evacuation\EvacuationSeq.cs" />
|
||||||
<Compile Include="Rig\TestMethods\FixedStartAdvanced\FixedStartAdvancedSeq.cs" />
|
<Compile Include="Rig\TestMethods\FixedStartAdvanced\FixedStartAdvancedSeq.cs" />
|
||||||
<Compile Include="Rig\TestMethods\FixedStartAdvanced\Single\Component.cs" />
|
<Compile Include="Rig\TestMethods\FixedStartAdvanced\Single\Component.cs" />
|
||||||
<Compile Include="Rig\TestMethods\FixedStartAdvanced\Single\Factory.cs" />
|
<Compile Include="Rig\TestMethods\FixedStartAdvanced\Single\Factory.cs" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user