diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs
index b771d541d..c613c261c 100644
--- a/TBF/Properties/AssemblyInfo.cs
+++ b/TBF/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.1.1600.0")]
-[assembly: AssemblyFileVersion("3.1.1600.0")]
+[assembly: AssemblyVersion("3.1.1601.0")]
+[assembly: AssemblyFileVersion("3.1.1601.0")]
diff --git a/TBF/Rig/ControlBoard/IAdvancedControlBoard.cs b/TBF/Rig/ControlBoard/IAdvancedControlBoard.cs
new file mode 100644
index 000000000..a60df3efa
--- /dev/null
+++ b/TBF/Rig/ControlBoard/IAdvancedControlBoard.cs
@@ -0,0 +1,32 @@
+using System;
+using Config.Entities;
+
+namespace TBF.Rig.ControlBoard
+{
+ public interface IAdvancedControlBoard : IControlBoard
+ {
+ ///
+ /// Get operation for a Flying start-stop test
+ /// Events: OpArgumentError ...... invalid arguments, test cannot be started
+ /// StartingTest ......... starting a test
+ /// TestInProgress ....... test was successfully started, test is running
+ /// TestPart2InProgress .. first part when water is diverted to a tank was successfully completed, part2 in progress,
+ /// prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
+ /// TestCompleted ........ test was successfully completed
+ /// Error ................ unspecified error while running a test
+ ///
+ /// Test entity
+ /// Flow lower limit
+ /// Flow upper limit
+ /// Test duration - number of reference flow meter pulses
+ /// true = Test with diverter
+ /// true = Prolonged test with diverter
+ /// Test part 1 duration - number of reference flow meter pulses<
+ /// true = Read diverter transition
+ /// Operation running a test
+ IOperation FlyingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount,
+ bool withDiverter, bool isProlonged, int massPulsesCount, bool readDivTransition);
+
+ IOperation ReadDiverterTransitionOp(bool isStart, Sequences.Statistics plotter, int batchNr, string testName, int repetition);
+ }
+}
diff --git a/TBF/Rig/ControlBoard/IControlBoard.cs b/TBF/Rig/ControlBoard/IControlBoard.cs
index b4b7bf7d2..d2f819a63 100644
--- a/TBF/Rig/ControlBoard/IControlBoard.cs
+++ b/TBF/Rig/ControlBoard/IControlBoard.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using Config.Entities;
using Dirichlet.Numerics;
using TBF.Rig.Generic;
@@ -16,7 +15,6 @@ namespace TBF.Rig.ControlBoard
///
void ClearProcessValues();
-
///
/// Values valid always
///
@@ -34,7 +32,6 @@ namespace TBF.Rig.ControlBoard
///
double TestTime { get; }
int RefPulses { get; }
-
double TestTimeWM(int wmNr1);
int RefPulsesWM(int wmNr1);
int PulsesWM(int wmNr1);
@@ -71,32 +68,6 @@ namespace TBF.Rig.ControlBoard
/// Operation running a test
IOperation StandingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount);
- ///
- /// Get operation for a Flying start-stop test
- /// Events: OpArgumentError .... invalid arguments, test cannot be started
- /// StartingTest ....... starting a test
- /// TestInProgress ..... test was successfully started, test is running
- /// TestCompleted ...... test was successfully completed
- /// Error .............. unspecified error while running a test
- ///
- /// Operation running a test
- IOperation FlyingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount);
-
- ///
- /// Get operation for a Flying start-stop test with a diverter
- /// Events: OpArgumentError ...... invalid arguments, test cannot be started
- /// StartingTest ......... starting a test
- /// TestInProgress ....... test was successfully started, test is running
- /// TestPart2InProgress .. first part when water is diverted to a tank was successfully completed, part2 in progress,
- /// prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
- /// TestCompleted ........ test was successfully completed
- /// Error ................ unspecified error while running a test
- ///
- /// Operation running a test
- IOperation FlyingStartStopTestWithDivOp(Test test, double qFrom, double qTo, int pulsesCount, int massPulsesCount, bool readDivTransition);
-
-
- IOperation ReadDiverterTransitionOp(bool isStart, Sequences.Statistics plotter, int batchNr, string testName, int repetition);
///
/// Returns operation with events: Event.MeasurementCompleted or Event.None
diff --git a/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestOp.cs b/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestOp.cs
index bdb7e5183..d5796fb46 100644
--- a/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestOp.cs
+++ b/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestOp.cs
@@ -10,33 +10,54 @@ namespace TBF.Rig.ControlBoard.Uni
public class FlyingStartStopTestOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartStopTestOp));
- public override string ToString() { return string.Format("FlyingStartStopTestOp()"); }
+ public override string ToString() { return string.Format("FlyingStartStopTestWithDivOp()"); }
/// Arguments of the constructor
readonly UniCB uniCB;
- readonly TBF.Rig.Uni.RegValve.RegValve regV;
- readonly TBF.Rig.Uni.FlowMeter.FlowMeter flowMeter;
readonly double qFrom;
readonly double qTo;
- readonly int pulsesCount; /// Number of reference pulses for a complete test
+ readonly int pulsesCount; /// Number of reference pulses for a complete test
+ readonly bool withDiverter;
+ readonly bool isProlonged;
+ readonly int massPulsesCount; /// Number of reference pulses for mass collection
+ readonly bool readDivTransition;
+ readonly TBF.Rig.Uni.RegValve.RegValve regV;
+ readonly TBF.Rig.Uni.FlowMeter.FlowMeter flowMeter;
+ readonly int diverterNr;
+ readonly int divThreshold;
///
- /// Operation for a Flying start-stop test (constructor)
+ /// Operation for a Flying start-stop test with a diverter (constructor)
///
- /// Events: OpArgumentError .... invalid arguments, test cannot be started
- /// StartingTest ....... starting a test
- /// TestInProgress ..... test was successfully started, test is running
- /// TestCompleted ...... test was successfully completed
- /// Error .............. unspecified error while running a test
+ /// Events: OpArgumentError ...... invalid arguments, test cannot be started
+ /// StartingTest ......... starting a test
+ /// TestInProgress ....... test was successfully started, test is running
+ /// TestPart1InProgress .. test was successfully started, part1 of a prolonged test (collecting water) is running
+ /// TestPart2InProgress .. first part of a prolonged test was successfully completed, part2 is in progress.
+ /// Prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
+ /// TestCompleted ........ test was successfully completed
+ /// Error ................ unspecified error while running a test
///
/// Control board component
- /// Components used by the test
+ /// Components used by the test
/// Flow lower limit
/// Flow upper limit
/// Test duration - number of reference flow meter pulses
- public FlyingStartStopTestOp(UniCB cb, OutputPath devices, double qFrom, double qTo, int pulsesCount)
+ /// true = Test with diverter
+ /// true = Prolonged test with diverter
+ /// Test part 1 duration - number of reference flow meter pulses<
+ /// true = Read diverter transition
+ public FlyingStartStopTestOp(UniCB cb, OutputPath devices, double qFrom, double qTo, int pulsesCount,
+ bool withDiverter, bool isProlonged, int massPulsesCount, bool readDivTransition)
{
this.uniCB = cb;
+ this.qFrom = qFrom;
+ this.qTo = qTo;
+ this.pulsesCount = pulsesCount;
+ this.withDiverter = withDiverter;
+ this.isProlonged = withDiverter && isProlonged;
+ this.massPulsesCount = massPulsesCount;
+ this.readDivTransition = withDiverter && readDivTransition;
flowMeter = devices.FlowMeter as TBF.Rig.Uni.FlowMeter.FlowMeter;
if (flowMeter == null) throw new ArgumentNullException("Invalid flow meter");
@@ -44,18 +65,23 @@ namespace TBF.Rig.ControlBoard.Uni
regV = devices.RegValve as TBF.Rig.Uni.RegValve.RegValve;
if (regV == null) throw new ArgumentNullException("Invalid regulation valve");
- this.qFrom = qFrom;
- this.qTo = qTo;
- this.pulsesCount = pulsesCount;
+ diverterNr = (withDiverter && devices.Diverter is TBF.Rig.Uni.Diverter.Diverter)
+ ? (devices.Diverter as TBF.Rig.Uni.Diverter.Diverter).DiverterNr : 0;
+
+ divThreshold = (withDiverter && devices.Diverter is TBF.Rig.Uni.Diverter.Diverter)
+ ? (devices.Diverter as TBF.Rig.Uni.Diverter.Diverter).StartThreshold : 0;
log.Debug(this.ToString());
}
- /// Internal state of this operation
+ /// Internal states of this operation
enum OpState
{
StartingTest,
+ ReadingDivTransition,
TestInProgress,
+ TestPart1InProgress, /// prolonged test only
+ TestPart2InProgress, /// prolonged test only
TestCompleted,
}
@@ -66,10 +92,10 @@ namespace TBF.Rig.ControlBoard.Uni
///
public void Start()
{
- log.InfoFormat("Op.Start() RV#={0} Et#={1} Qfrom={2} Qto={3}", regV.Idx1, flowMeter.Idx1, qFrom, qTo);
+ log.InfoFormat("Op.Start() RV#={0} Et#={1} Div#={2} Qfrom={3} Qto={4}", regV.Idx1, flowMeter.Idx1, diverterNr, qFrom, qTo);
/// Start the test (and the flow measurement)
- uniCB.StartTest(false, flowMeter.Idx1, 0, 0, true, false, false, false, pulsesCount, 0);
+ uniCB.StartTest(false, flowMeter.Idx1, diverterNr, divThreshold, true, withDiverter, false, isProlonged, pulsesCount, massPulsesCount);
opState = OpState.StartingTest;
}
@@ -78,12 +104,15 @@ namespace TBF.Rig.ControlBoard.Uni
/// Run this operation
///
///
- /// Event.OpArgumentError .... invalid arguments, test cannot be started
- /// Event.StartingTest ....... starting a test
- /// Event.TestInProgress ..... test was successfully started, test is running
- /// Event.TestCompleted ...... test was successfully completed
- /// Event.Error .............. unspecified error while running a test
- ///
+ /// Event.OpArgumentError ...... invalid arguments, test cannot be started
+ /// Event.StartingTest ......... starting a test
+ /// Event.TestInProgress ....... test was successfully started, test is running
+ /// Event.TestPart1InProgress .. test was successfully started, part1 of a prolonged test (collecting water) is running
+ /// Event.TestPart2InProgress .. first part of a prolonged test was successfully completed, part2 is in progress.
+ /// Prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
+ /// Event.TestCompleted ........ test was successfully completed
+ /// Event.Error ................ unspecified error while running a test
+ ///
public Event Run()
{
log.DebugFormat("Op.Run() opState={0}", opState);
@@ -96,12 +125,16 @@ namespace TBF.Rig.ControlBoard.Uni
{
return Event.OpArgumentError; /// Invalid qFrom, qTo
}
+ if (isProlonged && (massPulsesCount <= 0 || massPulsesCount >= pulsesCount))
+ {
+ return Event.OpArgumentError; /// Invalid qFrom, qTo
+ }
if (!flowMeter.MsrmntAvailable || /// Flow measurement not started yet
(uniCB.State & (ulong)StatusP.ReadingCounters) == 0 || /// Test was not started yet
uniCB.RefFrequency == 0) /// Measured flow is 0
{
- return Event.StartingTest; /// Flow regulation cannot be started
+ return Event.StartingTest; /// Flow regulation cannot be started
}
/// Start flow regulation
@@ -112,8 +145,17 @@ namespace TBF.Rig.ControlBoard.Uni
uniCB.SetFlow(false, regV.Idx1, 2000 * reqFlowLo / flowMeter.NominalFlow,
2000 * reqFlowHi / flowMeter.NominalFlow);
- opState = OpState.TestInProgress;
- return Event.TestInProgress;
+ opState = readDivTransition ? OpState.ReadingDivTransition
+ : (isProlonged ? OpState.TestPart1InProgress : OpState.TestInProgress);
+
+ return isProlonged ? Event.TestPart1InProgress : Event.TestInProgress;
+
+ case OpState.ReadingDivTransition:
+
+ /// Read diverter transition data
+ uniCB.ReadDiverterTransition(false, diverterNr);
+ opState = isProlonged ? OpState.TestPart1InProgress : OpState.TestInProgress;
+ return isProlonged ? Event.TestPart1InProgress : Event.TestInProgress;
case OpState.TestInProgress:
@@ -124,11 +166,30 @@ namespace TBF.Rig.ControlBoard.Uni
opState = OpState.TestCompleted;
return Event.TestCompleted;
+ case OpState.TestPart1InProgress:
+
+ if ((uniCB.State & (ulong)StatusP.DirectionOfDiverter) != 0)
+ {
+ return Event.TestPart1InProgress; /// Test was not completed yet
+ }
+ opState = OpState.TestPart2InProgress;
+ return Event.TestPart2InProgress;
+
+ case OpState.TestPart2InProgress:
+
+ if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0)
+ {
+ /// Test was not completed yet
+ return Event.TestPart2InProgress;
+ }
+ opState = OpState.TestCompleted;
+ return Event.TestCompleted;
+
case OpState.TestCompleted:
default:
return Event.TestCompleted;
}
- }
+ }
///
/// Stop this operation
diff --git a/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestWithDivOp.cs b/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestWithDivOp.cs
deleted file mode 100644
index 8c4bbf9a8..000000000
--- a/TBF/Rig/ControlBoard/Uni/FlyingStartStopTestWithDivOp.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-///
-/// Copyright (c) 2021 Sensus Slovensko a.s.
-///
-using System;
-using log4net;
-using TBF.Rig.GenericDevices;
-
-namespace TBF.Rig.ControlBoard.Uni
-{
- public class FlyingStartStopTestWithDivOp : IOperation
- {
- private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartStopTestWithDivOp));
- public override string ToString() { return string.Format("FlyingStartStopTestWithDivOp()"); }
-
- /// Arguments of the constructor
- readonly UniCB uniCB;
- readonly TBF.Rig.Uni.RegValve.RegValve regV;
- readonly TBF.Rig.Uni.FlowMeter.FlowMeter flowMeter;
- readonly TBF.Rig.Uni.Diverter.Diverter div;
- readonly double qFrom;
- readonly double qTo;
- readonly int pulsesCount; /// Number of reference pulses for a complete test
- readonly int massPulsesCount; /// Number of reference pulses for mass collection
- readonly bool readDivTransition;
- readonly bool isProlongedTest;
-
- ///
- /// Operation for a Flying start-stop test with a diverter (constructor)
- ///
- /// Events: OpArgumentError ...... invalid arguments, test cannot be started
- /// StartingTest ......... starting a test
- /// TestInProgress ....... test was successfully started, test is running
- /// TestPart2InProgress .. first part when water is diverted to a tank was successfully completed, part2 in progress,
- /// prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
- /// TestCompleted ........ test was successfully completed
- /// Error ................ unspecified error while running a test
- ///
- /// Control board component
- /// Components used by the test
- /// Flow lower limit
- /// Flow upper limit
- /// Test duration - number of reference flow meter pulses
- /// Test part 1 duration - number of reference flow meter pulses<
- public FlyingStartStopTestWithDivOp(UniCB cb, OutputPath devices, double qFrom, double qTo,
- int pulsesCount, int massPulsesCount, bool readDivTransition)
- {
- this.uniCB = cb;
-
- flowMeter = devices.FlowMeter as TBF.Rig.Uni.FlowMeter.FlowMeter;
- if (flowMeter == null) throw new ArgumentNullException("Invalid flow meter");
-
- regV = devices.RegValve as TBF.Rig.Uni.RegValve.RegValve;
- if (regV == null) throw new ArgumentNullException("Invalid regulation valve");
-
- div = devices.Diverter as TBF.Rig.Uni.Diverter.Diverter;
- if (div == null) throw new ArgumentNullException("Invalid diverter");
-
- this.qFrom = qFrom;
- this.qTo = qTo;
- this.pulsesCount = pulsesCount;
- this.massPulsesCount = massPulsesCount;
- this.readDivTransition = readDivTransition;
- this.isProlongedTest = (0 < massPulsesCount) && (massPulsesCount < pulsesCount);
-
- log.Debug(this.ToString());
- }
-
- /// Internal states of this operation
- enum OpState
- {
- StartingTest,
- ReadingDivTransition,
- TestInProgress,
- TestPart1InProgress, /// prolonged test only
- TestPart2InProgress, /// prolonged test only
- TestCompleted,
- }
-
- OpState opState;
-
- ///
- /// Start this operation
- ///
- public void Start()
- {
- log.InfoFormat("Op.Start() RV#={0} Et#={1} Div#={2} Qfrom={3} Qto={4}", regV.Idx1, flowMeter.Idx1, div.DiverterNr, qFrom, qTo);
-
- /// Start the test (and the flow measurement)
- uniCB.StartTest(false, flowMeter.Idx1, div.DiverterNr, div.StartThreshold, true, true, false, isProlongedTest, pulsesCount, massPulsesCount);
-
- opState = OpState.StartingTest;
- }
-
- ///
- /// Run this operation
- ///
- ///
- /// Event.OpArgumentError ...... invalid arguments, test cannot be started
- /// Event.StartingTest ......... starting a test
- /// Event.TestInProgress ....... test was successfully started, test is running
- /// Event.TestPart1InProgress .. first part when water is diverted to a tank was successfully completed, part2 in progress,
- /// Event.TestPart2InProgress .. first part when water is diverted to a tank was successfully completed, part2 in progress,
- /// prolonged method only: (massPulsesCount GT 0) and (massPulsesCount LT pulsesCount)
- /// Event.TestCompleted ........ test was successfully completed
- /// Event.Error ................ unspecified error while running a test
- ///
- public Event Run()
- {
- log.DebugFormat("Op.Run() opState={0}", opState);
-
- switch (opState)
- {
- case OpState.StartingTest:
-
- if (qFrom < 0 || qFrom >= qTo || qTo > 1.25 * flowMeter.NominalFlow)
- {
- return Event.OpArgumentError; /// Invalid qFrom, qTo
- }
-
- if (!flowMeter.MsrmntAvailable || /// Flow measurement not started yet
- (uniCB.State & (ulong)StatusP.ReadingCounters) == 0 || /// Test was not started yet
- uniCB.RefFrequency == 0) /// Measured flow is 0
- {
- return Event.StartingTest; /// Flow regulation cannot be started
- }
-
- /// Start flow regulation
- double reqFlowAve = (qFrom + qTo) / 2;
- double reqFlowLo = (0.7 * qFrom) + (0.3 * reqFlowAve); /// Move the lower limit 15% of the range up
- double reqFlowHi = (0.7 * qTo) + (0.3 * reqFlowAve); /// Move the upper limit 15% of the range down
- ///
- uniCB.SetFlow(false, regV.Idx1, 2000 * reqFlowLo / flowMeter.NominalFlow,
- 2000 * reqFlowHi / flowMeter.NominalFlow);
-
- opState = readDivTransition ? OpState.ReadingDivTransition
- : (isProlongedTest ? OpState.TestPart1InProgress : OpState.TestInProgress);
- return isProlongedTest ? Event.TestPart1InProgress : Event.TestInProgress;
-
- case OpState.ReadingDivTransition:
-
- /// Read diverter transition data
- uniCB.ReadDiverterTransition(false, div.DiverterNr);
- opState = isProlongedTest ? OpState.TestPart1InProgress : OpState.TestInProgress;
- return isProlongedTest ? Event.TestPart1InProgress : Event.TestInProgress;
-
- case OpState.TestInProgress:
-
- if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0)
- {
- return Event.TestInProgress; /// Test was not completed yet
- }
- opState = OpState.TestCompleted;
- return Event.TestCompleted;
-
- case OpState.TestPart1InProgress:
-
- if ((uniCB.State & (ulong)StatusP.DirectionOfDiverter) != 0)
- {
- return Event.TestPart1InProgress; /// Test was not completed yet
- }
- opState = OpState.TestPart2InProgress;
- return Event.TestPart2InProgress;
-
- case OpState.TestPart2InProgress:
-
- if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0)
- {
- /// Test was not completed yet
- return Event.TestPart2InProgress;
- }
- opState = OpState.TestCompleted;
- return Event.TestCompleted;
-
- case OpState.TestCompleted:
- default:
- return Event.TestCompleted;
- }
- }
-
- ///
- /// Stop this operation
- ///
- public void Stop()
- {
- log.Info("Op.Stop()");
- uniCB.Stop(false);
- }
- }
-}
diff --git a/TBF/Rig/ControlBoard/Uni/UniCB.cs b/TBF/Rig/ControlBoard/Uni/UniCB.cs
index e6325cef8..2b7f3cd20 100644
--- a/TBF/Rig/ControlBoard/Uni/UniCB.cs
+++ b/TBF/Rig/ControlBoard/Uni/UniCB.cs
@@ -17,7 +17,7 @@ using TBF.UiBridge;
namespace TBF.Rig.ControlBoard.Uni
{
- public class UniCB : ComponentBase, IControlBoard, SchematicDrawing.IDrawingItCmpntWithMeasuredVal
+ public class UniCB : ComponentBase, IAdvancedControlBoard, SchematicDrawing.IDrawingItCmpntWithMeasuredVal
{
private static readonly ILog log = LogManager.GetLogger(typeof(UniCB));
public override string ToString() { return string.Format("CBoard({0})", cbCfg != null ? cbCfg.ToString(-1) : string.Empty); }
@@ -120,9 +120,8 @@ namespace TBF.Rig.ControlBoard.Uni
/// Depends on the control board configuration
ulong valvesToInvert; /// From configurations of valve and pump components. Inversion is applied when creating
/// a message to be sent by serial port
- UInt128 displayedRoute; /// A route displayed on the screen (inversions are not applied)
- UInt128 bitsChangedByUI; /// Ones in this word indicate which valves/pumpes were changed in UI by mouse clicks
UInt128 displayedRoutePlusUI; /// A route displayed on the screen plus the modifications from UI (inversions are not applied)
+ UInt128 bitsChangedByUI; /// Ones in this word indicate which valves/pumpes were changed in UI by mouse clicks
UInt128 outputLatch; /// A copy of data sent to physical digital outputs (inversions are not applied)
///
/// 128-bit word representing the current state of all valves and pumps (inversions are not applied)
@@ -374,12 +373,12 @@ namespace TBF.Rig.ControlBoard.Uni
route = (route & ~bitsChangedByUI) | (displayedRoutePlusUI & bitsChangedByUI);
bitsChangedByUI = 0;
}
- displayedRoute = route;
displayedRoutePlusUI = route;
bitsChangedByUI = 0;
}
+
ProcessData.UpdateMeasuredValuesAndSetpoints();
- Bridge.OnStateMachineTick(this, new StateMachineTickEventArgs(displayedRoute, ProcessData.MsrmntAvailableFlags, ProcessData.MeasuredValues,
+ Bridge.OnStateMachineTick(this, new StateMachineTickEventArgs(route, ProcessData.MsrmntAvailableFlags, ProcessData.MeasuredValues,
ProcessData.AltStrings, ProcessData.Setpoints));
/// Make sure the serial port is open
@@ -543,22 +542,13 @@ namespace TBF.Rig.ControlBoard.Uni
}
///
- /// Start a flying start-stop test
+ /// Start a flying start-stop test (opitonally with a diverter, optionally prolonged)
///
/// Operation running a test
- public IOperation FlyingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount)
+ public IOperation FlyingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount, bool withDiverter = false,
+ bool isProlonged = false, int massPulsesCount = 0, bool readDivTransition = true)
{
- return new FlyingStartStopTestOp(this, devices, qFrom, qTo, pulsesCount);
- }
-
- ///
- /// Start a flying start-stop test with diverter
- ///
- /// Operation running a test
- public IOperation FlyingStartStopTestWithDivOp(Test test, double qFrom, double qTo, int pulsesCount,
- int massPulsesCount = 0, bool readDivTransition = true)
- {
- return new FlyingStartStopTestWithDivOp(this, devices, qFrom, qTo, pulsesCount, massPulsesCount, readDivTransition);
+ return new FlyingStartStopTestOp(this, devices, qFrom, qTo, pulsesCount, withDiverter, isProlonged, massPulsesCount, readDivTransition);
}
public IOperation ReadDiverterTransitionOp(bool isStart, Sequences.Statistics plotter, int batchNr, string testName, int repetition)
diff --git a/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs
index 9b13dd22e..c50c517a9 100644
--- a/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs
+++ b/TBF/Rig/TestMethods/Adjustment/AdjustmentSeq.cs
@@ -25,8 +25,7 @@ namespace TBF.Rig.TestMethods.Adjustment
/// true when capabilities of devices are OK
public static bool CheckDeviceCaps(Config.Entities.Test test, OutputPath devices, out string message)
{
- if (!(StateMachine.ControlBoard is ControlBoard.Legacy.CBoard) &&
- !(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
+ if (!(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
{
/// Control board does not support this method
message = string.Format("{0}: {1}", test.Name, Strings.Test_bench_does_not_suport_selected_test_method);
@@ -120,7 +119,7 @@ namespace TBF.Rig.TestMethods.Adjustment
IList e; /// Events from currently running operations
Event retVal = Event.Done;
- TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
+ TBF.Rig.ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
diff --git a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs
index e8e07c744..ef295a961 100644
--- a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs
+++ b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs
@@ -24,8 +24,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
/// true when capabilities of devices are OK
public static bool CheckDeviceCaps(Config.Entities.Test test, OutputPath devices, out string message)
{
- if (!(StateMachine.ControlBoard is ControlBoard.Legacy.CBoard) &&
- !(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
+ if (!(StateMachine.ControlBoard is ControlBoard.Uni.UniCB))
{
/// Control board does not support this method
message = string.Format("{0}: {1}", test.Name, Strings.Test_bench_does_not_suport_selected_test_method);
@@ -83,7 +82,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
///
public IList Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition, TestParams testParams)
{
- TBF.Rig.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
+ TBF.Rig.ControlBoard.Uni.UniCB cBrd = StateMachine.ControlBoard as TBF.Rig.ControlBoard.Uni.UniCB;
IScale scale = cBrd.Devices.Scale as IScale;
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
diff --git a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs
index 875365070..3e4f43b2e 100644
--- a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs
+++ b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs
@@ -590,8 +590,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(cameraMeasurementOps)
- .AddOperation((repetitionNr == 1) ? cBrd.FlyingStartStopTestWithDivOp(test, test.Qfrom, test.Qto, totalPulses)
- : cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses))
+ .AddOperation(cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses, (repetitionNr == 1)))
.AddOperation(processDataLoggingOp)
.EnterState();
do {
diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs
index 310691a20..8184ce3af 100644
--- a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs
+++ b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs
@@ -699,7 +699,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(cameraMeasurementOps)
- .AddOperation(cBrd.FlyingStartStopTestWithDivOp(test, test.Qfrom, test.Qto, totalPulses))
+ .AddOperation(cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses, true))
.AddOperation(processDataLoggingOp)
.EnterState();
do {
diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs
index c831f6f76..8294a3238 100644
--- a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs
+++ b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs
@@ -578,8 +578,8 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, 0);
bool isTestPart2Completed = false;
- ///
- var prolongedTest = cBrd.FlyingStartStopTestWithDivOp(test, test.Qfrom, test.Qto, targetTotalPulses, targetMassPulses);
+
+ var prolongedTest = cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, targetTotalPulses, true, true, targetMassPulses);
IList testInProgressOps = new List();
testInProgressOps.Add(checkUiOp);
diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
index f16421d6a..581120d4d 100644
--- a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
+++ b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs
@@ -580,7 +580,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(cameraMeasurementOps)
- .AddOperation(cBrd.FlyingStartStopTestWithDivOp(test, test.Qfrom, test.Qto, totalPulses))
+ .AddOperation(cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses, true))
.AddOperation(processDataLoggingOp)
.EnterState();
do {
diff --git a/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
index 2236a80df..3da78597e 100644
--- a/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
+++ b/TBF/Rig/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs
@@ -398,7 +398,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(cameraMeasurementOps)
- .AddOperation(cBrd.FlyingStartStopTestWithDivOp(test, test.Qfrom, test.Qto, totalPulses))
+ .AddOperation(cBrd.FlyingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses, true))
.AddOperation(processDataLoggingOp)
.EnterState();
do {
diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj
index 3d34d050c..aab6f9479 100644
--- a/TBF/TBF.csproj
+++ b/TBF/TBF.csproj
@@ -195,6 +195,7 @@
ComponentCfgCtrl.cs
+
@@ -229,7 +230,6 @@
-