Problems when passing flowmeter/diverter info to test start by SendCommand() fixed, version 1.5.77.
This commit is contained in:
parent
90cfda893c
commit
f85fbd0b55
@ -468,9 +468,9 @@ namespace TBF.BenchControl.Elde
|
||||
/// <param name="readers">An array of register readers</param>
|
||||
/// <param name="refPulses">Number of reference pulses to complete the test</param>
|
||||
/// <returns>Created operation</returns>
|
||||
public IOperation StartMeasurementOp(IFlowMeter flowMeter, int refPulses, TestMethods method, float filterConstant)
|
||||
public IOperation StartMeasurementOp(IFlowMeter flowMeter, IDiverter diverter, TestMethods method, int refPulses, float filterConstant)
|
||||
{
|
||||
return new StartMeasurementOp(this, flowMeter, refPulses, method, filterConstant);
|
||||
return new StartMeasurementOp(this, flowMeter, diverter, method, refPulses, filterConstant);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -15,6 +15,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
readonly DiverterCfg diverterCfg;
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly ulong mask; /// derived from bitPosition in the constructor
|
||||
public int AdcNr { get { return diverterCfg.AdcNr; } }
|
||||
|
||||
public bool State
|
||||
{
|
||||
|
||||
@ -91,10 +91,10 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
message += Environment.NewLine + "'Idx1' should be between 1 and 7";
|
||||
}
|
||||
float fdummy;
|
||||
if (!Utils.TryParseUFloat(nominalFlowTextBox.Text, out fdummy) || fdummy < 0.2 || fdummy > 1600)
|
||||
if (!Utils.TryParseUFloat(nominalFlowTextBox.Text, out fdummy) || fdummy < 0.01 || fdummy > 1600)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Nominal flow' should be between 0.2 and 1600";
|
||||
message += Environment.NewLine + "'Nominal flow' should be between 0.01 and 1600";
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ namespace TBF.BenchControl.Elde
|
||||
readonly int refPulses; /// Number of reference pulses for a complete test
|
||||
readonly TestMethods testMethod;
|
||||
readonly float filterConstant;
|
||||
readonly int diverterIdx;
|
||||
|
||||
bool started = false;
|
||||
|
||||
@ -29,7 +30,7 @@ namespace TBF.BenchControl.Elde
|
||||
/// <param name="readers">Register readers references</param>
|
||||
/// <param name="volume">Water volume for the test in liters</param>
|
||||
public StartMeasurementOp(ControlBoardDev controlBoardDev, GenericDevices.IFlowMeter flowMeter,
|
||||
int refPulses, TestMethods method, float filterConstant)
|
||||
GenericDevices.IDiverter diverter, TestMethods method, int refPulses, float filterConstant)
|
||||
{
|
||||
if (controlBoardDev == null) throw new ArgumentNullException("controlBoardDev");
|
||||
this.controlBoard = controlBoardDev;
|
||||
@ -47,6 +48,11 @@ namespace TBF.BenchControl.Elde
|
||||
throw new ArgumentException("flowMeter is null or is not Elde");
|
||||
}
|
||||
|
||||
if (diverter is Elde.Diverter.Diverter)
|
||||
{
|
||||
diverterIdx = (diverter as Elde.Diverter.Diverter).AdcNr - 4;
|
||||
}
|
||||
|
||||
this.refPulses = refPulses;
|
||||
this.testMethod = method;
|
||||
this.filterConstant = filterConstant;
|
||||
@ -58,7 +64,13 @@ namespace TBF.BenchControl.Elde
|
||||
public void Start()
|
||||
{
|
||||
controlBoard.SyncRoute();
|
||||
controlBoard.SendCommand(Command.Start, flowMeterIdx, controlBoard.Route, refPulses, testMethod,
|
||||
#if IPERLST
|
||||
int flowMeterIdxAndDiv = flowMeterIdx + 16 * diverterIdx;
|
||||
#else
|
||||
int flowMeterIdxAndDiv = flowMeterIdx;
|
||||
#endif
|
||||
|
||||
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route, refPulses, testMethod,
|
||||
filterConstant, 20, 0, StopDevs.None);
|
||||
}
|
||||
|
||||
|
||||
@ -168,7 +168,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
State.Create("Adjustment : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -231,7 +231,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
State.Create("CombinedMeters : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -410,7 +410,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create(Strings.Start_the_test)
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -285,7 +285,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
||||
State.Create("FixedStartCombinedMeters : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, 2 * totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
2 * totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -285,7 +285,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
State.Create("FixedStartMassCollection : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, 2 * totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
2 * totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -129,7 +129,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
State.Create("FlyingStart : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -241,7 +241,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
State.Create("FlyingStartCollectionMethod : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -201,7 +201,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Starting the test")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro, (float)test.TolerRed))
|
||||
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, outPath.Diverter, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||
totalPulses, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.5.76.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.76.1")]
|
||||
[assembly: AssemblyVersion("1.5.77.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.77.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user