(1) filters[] initialized earlier in test method sequences, (2) filters and shortPulses used in SetFlowOp(.), ver. 2.18.1206

This commit is contained in:
Milan Hanajik
2019-05-02 10:23:33 +02:00
parent 1e97a26863
commit d0bba74dff
30 changed files with 423 additions and 335 deletions
@@ -51,10 +51,27 @@ namespace TBF.BenchControl.TestMethods.Endurance
}
}
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
if (sensPath != null && sensPath.RegisterReaders != null)
{
foreach (var rr in sensPath.RegisterReaders)
{
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
{
filters[eldeRR.Position - 1] = eldeRR.Filter;
}
}
}
IList<IOperation> readTempPressOps = new List<IOperation>();
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
@@ -87,9 +104,6 @@ namespace TBF.BenchControl.TestMethods.Endurance
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
Event retVal = Event.Done;
IList<Event> e; /// Events from currently running operations
//====================================
loop:
/// Read pressure and temperature once before calling Bridge.OnTestSelected(...)
@@ -139,7 +153,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
@@ -205,22 +219,15 @@ namespace TBF.BenchControl.TestMethods.Endurance
///
/// Find ROI-s
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
foreach (var rr in sensPath.RegisterReaders)
{
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
if (regr != null)
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
if ((cameraRoI != null) && cameraRoI.Detected)
{
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
rois.Add(cameraRoI);
}
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
if (roi != null && roi.Detected)
{
rois.Add(roi);
}
}
}
/// Find cameras
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();