Uni.XyzStartStopTest[WithDiv]Op, etc., AdjustmentSeq and all FlyingStartXyzSeq completed, ver. 3.1.1630

This commit is contained in:
Milan Hanajik
2021-03-14 21:28:41 +01:00
parent 6e1b02ebd5
commit 7af4e9465c
49 changed files with 1201 additions and 1164 deletions
+41 -20
View File
@@ -16,7 +16,7 @@ namespace TBF.Rig.ControlBoard.Legacy
public class CBoard : ComponentBase, IControlBoard
{
private static readonly ILog log = LogManager.GetLogger(typeof(CBoard));
public override string ToString() { return string.Format("ControlBoard({0})", Cfg.ToString(1)); }
public override string ToString() { return string.Format("ControlBoard({0})", Cfg.ToString(-1)); }
const int FiltersCount = 8;
@@ -406,14 +406,14 @@ namespace TBF.Rig.ControlBoard.Legacy
/// <summary>Initialize this device</summary>
public void Initialize()
{
int divertersCount = Rig.Elde.Diverter.Diverter.DivertersCount;
int divertersCount = Rig.Uni.Diverter.Diverter.DivertersCount;
DiverterEdge = new uint[divertersCount];
for (int i = 0; i < divertersCount; i++)
{
DiverterEdge[i] = (uint)Rig.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
controlCom.SetDivLimit(i, (uint)Rig.Elde.Diverter.Diverter.Diverters[i].ThresholdLo,
(uint)Rig.Elde.Diverter.Diverter.Diverters[i].ThresholdHi);
DiverterEdge[i] = (uint)Rig.Uni.Diverter.Diverter.Diverters[i].ThresholdGate;
controlCom.SetDivLimit(i, (uint)Rig.Uni.Diverter.Diverter.Diverters[i].ThresholdLo,
(uint)Rig.Uni.Diverter.Diverter.Diverters[i].ThresholdHi);
}
controlCom.SendCalibData(RegValveCalib,
@@ -675,17 +675,41 @@ namespace TBF.Rig.ControlBoard.Legacy
/// <summary>
/// Start a test, Events: MeasurementStarted
/// Start a standing start-stop test
/// </summary>
/// <param name="iParam">Int32 parameter 1</param>
/// <param name="dParam1">Double parameter 1 (alternative lower flow limit)</param>
/// <param name="dParam2">Double parameter 2 (alternative upper flow limit)</param>
/// <returns>Operation</returns>
public IOperation StartTestOp(Test test, int iParam = 0, double dParam1 = 0, double dParam2 = 0)
/// <returns>Operation running a test</returns>
public IOperation StandingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount)
{
return StartTestOp(test, false, false, true, qFrom, qTo, pulsesCount, 0);
}
/// <summary>
/// Start a flying start-stop test
/// </summary>
/// <returns>Operation running a test</returns>
public IOperation FlyingStartStopTestOp(Test test, double qFrom, double qTo, int pulsesCount)
{
return StartTestOp(test, true, false, false, qFrom, qTo, pulsesCount, 0);
}
/// <summary>
/// Start a flying start-stop test with diverter
/// </summary>
/// <returns>Operation running a test</returns>
public IOperation FlyingStartStopTestWithDivOp(Test test, double qFrom, double qTo, int pulsesCount, int massPulsesCount, bool readDivTransition)
{
return StartTestOp(test, true, true, false, qFrom, qTo, pulsesCount, massPulsesCount);
}
/// <summary>
/// Start a test
/// </summary>
/// <returns>Operation running a test</returns>
public IOperation StartTestOp(Test test, bool isSyncMethod, bool isDivUsed, bool isStartStop, double qFrom, double qTo, int pulsesCount, int massPulsesCount)
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
return new Operations.ReturnGivenEventOp(Event.MeasurementStarted);
return new Operations.ReturnGivenEventOp(Event.TestInProgress);
}
/// Get total number of pulses
@@ -701,12 +725,11 @@ namespace TBF.Rig.ControlBoard.Legacy
}
if (methodClass.Contains("TestMethods.CombinedWithDetection."))
{
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), dParam1, dParam2, totalPulses);
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), test.Qfrom, test.Qto, totalPulses);
}
if (methodClass == "TestMethods.DiverterTest")
{
if (iParam == 0) return null;
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), test.Qfrom, test.Qto, totalPulses / iParam);
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), test.Qfrom, test.Qto, totalPulses);
}
if (methodClass == "TestMethods.Dummy")
{
@@ -745,8 +768,7 @@ namespace TBF.Rig.ControlBoard.Legacy
}
if (methodClass.Contains("TestMethods.FlyingStartFirstRepetWithMassColl."))
{
TestMethods tm = (iParam == 1) ? (TestMethods.Diverter | TestMethods.Synchro) : TestMethods.Synchro;
return new StartMeasurementOp(this, devices, tm, test.Qfrom, test.Qto, totalPulses);
return new StartMeasurementOp(this, devices, TestMethods.Synchro, test.Qfrom, test.Qto, totalPulses);
}
if (methodClass.Contains("TestMethods.FlyingStartMassCollComparative."))
{
@@ -758,8 +780,7 @@ namespace TBF.Rig.ControlBoard.Legacy
}
if (methodClass.Contains("TestMethods.FlyingStartMassCollProlonged."))
{
if (iParam == 0) return null;
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), test.Qfrom, test.Qto, totalPulses, iParam);
return new StartMeasurementOp(this, devices, (TestMethods.Diverter | TestMethods.Synchro), test.Qfrom, test.Qto, totalPulses, massPulsesCount);
}
if (methodClass.Contains("TestMethods.FlyingStartTankCollection."))
{
@@ -791,7 +812,7 @@ namespace TBF.Rig.ControlBoard.Legacy
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
return new Operations.ReturnGivenEventOp(Event.MeasurementStarted);
return new Operations.ReturnGivenEventOp(Event.TestInProgress);
}
else
{