ControlBoard Activity added, updated in operations, values are defined in Enums.
This commit is contained in:
parent
1b402566ed
commit
e428897822
19
TBF/Rig/ControlBoard/Enums.cs
Normal file
19
TBF/Rig/ControlBoard/Enums.cs
Normal file
@ -0,0 +1,19 @@
|
||||
///
|
||||
/// Copyright (c) 2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using Common;
|
||||
|
||||
namespace TBF.Rig.ControlBoard
|
||||
{
|
||||
public enum Activity
|
||||
{
|
||||
[Description("Idle")] Idle,
|
||||
[Description("Setting flow")] SettingFlow,
|
||||
[Description("Flying start/stop test")] FlyingStartStopTest,
|
||||
[Description("Flying start/stop test with div.")] FlyingStartStopTestWithDiverter,
|
||||
[Description("Standing start/stop test")] StandingStartStopTest,
|
||||
[Description("Test completed")] TestCompleted,
|
||||
Count
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,7 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2021-2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using Config.Entities;
|
||||
using Dirichlet.Numerics;
|
||||
using TBF.Boxes;
|
||||
@ -16,6 +19,9 @@ namespace TBF.Rig.ControlBoard
|
||||
/// </summary>
|
||||
void ClearProcessValues();
|
||||
|
||||
Activity Activity { get; } /// Control board activity
|
||||
void SetActivity(Activity a);
|
||||
|
||||
///
|
||||
/// Values valid always
|
||||
///
|
||||
|
||||
@ -42,6 +42,10 @@ namespace TBF.Rig.ControlBoard.Papouch
|
||||
|
||||
OutputPath devices;
|
||||
|
||||
public Activity Activity { get { return activity; } } /// Control board activity
|
||||
Activity activity;
|
||||
public void SetActivity(Activity a) { activity = a; }
|
||||
|
||||
|
||||
enum SelectedOp
|
||||
{
|
||||
@ -338,7 +342,11 @@ namespace TBF.Rig.ControlBoard.Papouch
|
||||
/// <summary>
|
||||
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
|
||||
/// </summary>
|
||||
public void ClearProcessValues() { }
|
||||
public void ClearProcessValues()
|
||||
{
|
||||
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
|
||||
SetActivity(Activity.Idle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set valves to new positions.
|
||||
|
||||
@ -96,6 +96,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
regV.Idx1, flowMeter.Idx1, (diverter != null) ? diverter.DiverterNr : 0, qFrom, qTo);
|
||||
|
||||
/// Start the test (and the flow measurement)
|
||||
uniCB.SetActivity((diverter != null) ? Activity.FlyingStartStopTestWithDiverter : Activity.FlyingStartStopTest);
|
||||
uniCB.StartTest(false, flowMeter.Idx1, (diverter != null) ? diverter.DiverterNr : 0, (diverter != null) ? diverter.StartThreshold : 0,
|
||||
true, withDiverter, false, isProlonged, pulsesCount, massPulsesCount);
|
||||
|
||||
@ -212,6 +213,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
public void Stop()
|
||||
{
|
||||
log.Info("Op.Stop()");
|
||||
uniCB.SetActivity((opState == OpState.TestCompleted) ? Activity.TestCompleted : Activity.Idle);
|
||||
uniCB.StopAll(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +74,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
log.InfoFormat("Start() Et#={0} pulses={1} withDiverter={2}", flowMeter.Idx1, pulsesCount, withDiverter);
|
||||
|
||||
/// Start the test (and the flow measurement)
|
||||
uniCB.SetActivity(Activity.StandingStartStopTest);
|
||||
uniCB.StartTest(false, flowMeter.Idx1, (withDiverter ? diverter.DiverterNr : 0), 0,
|
||||
false, withDiverter, true, false, pulsesCount);
|
||||
|
||||
@ -122,6 +123,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
public void Stop()
|
||||
{
|
||||
log.Info("Stop()");
|
||||
uniCB.SetActivity((opState == OpState.TestCompleted) ? Activity.TestCompleted : Activity.Idle);
|
||||
uniCB.StopAll(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,11 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
ScopeAnalyzerData scopeAnalyzerData;
|
||||
SwitchCountersData switchCounterData;
|
||||
|
||||
public UInt64 State { get { return Data.State; } } /// Control board state
|
||||
public UInt64 State { get { return Data.State; } } /// Control board state
|
||||
|
||||
public Activity Activity { get { return activity; } } /// Control board activity
|
||||
Activity activity;
|
||||
public void SetActivity(Activity a) { activity = a; }
|
||||
|
||||
/// Quido RS
|
||||
TBF.Rig.Modbus.QuidoRS.QuidoRS quidoRS;
|
||||
@ -90,7 +94,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
/// Current flow meter ID
|
||||
public int FlowmeterId { get { return Convert.ToInt32(Data.State & (ulong)StatusP.FlowmtrNrMask); } }
|
||||
|
||||
public UInt64 DigitalInputs { get { return Data.Vstupy; } } /// Digital inputs
|
||||
public UInt64 DigitalInputs { get { return Data.Vstupy; } } /// Digital inputs
|
||||
|
||||
public Int16 AnalogInput(int channel)
|
||||
{
|
||||
@ -601,7 +605,11 @@ namespace TBF.Rig.ControlBoard.Uni
|
||||
///
|
||||
/// Interface functions
|
||||
///
|
||||
public void ClearProcessValues() { } /// Called from ProcessData.ClearProcessValues() at the beginning of each test
|
||||
public void ClearProcessValues()
|
||||
{
|
||||
/// Called from ProcessData.ClearProcessValues() at the beginning of each test
|
||||
SetActivity(Activity.Idle);
|
||||
}
|
||||
|
||||
public double TestTimeWM(int wmNr1)
|
||||
{
|
||||
|
||||
@ -204,6 +204,7 @@
|
||||
<Compile Include="Rig\Configs\ParamsProvider\ComponentCfgCtrl.designer.cs">
|
||||
<DependentUpon>ComponentCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Rig\ControlBoard\Enums.cs" />
|
||||
<Compile Include="Rig\ControlBoard\IAdvancedControlBoard.cs" />
|
||||
<Compile Include="Rig\ControlBoard\IControlBoard.cs" />
|
||||
<Compile Include="Rig\ControlBoard\Papouch\PapouchCB.cs" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user