Bug fix in CombinedWithDetectionSeq related to test.Part

This commit is contained in:
Milan Hanajik
2020-08-03 09:07:22 +02:00
parent 04db3f975e
commit 659315c519
2 changed files with 112 additions and 109 deletions
@@ -1588,6 +1588,8 @@ namespace TBF.BenchControl.Sequences
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
if (tstRslt != null)
{
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.StartTime = DateTime.Now;
tstRslt.EndTime = DateTime.Now + new TimeSpan(0, 0, 1);
@@ -1706,6 +1708,7 @@ namespace TBF.BenchControl.Sequences
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));
}
}
/// <summary>
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -103,9 +103,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
return new List<Event> { Event.ConfigurationError };
}
if (test.Part < 1 || test.Part > Config.Data.CompoundWMsCount)
if (test.Part < 0 || test.Part > Config.Data.CompoundWMsCount)
{
UiBridge.Bridge.OnError(this, string.Format("Test 'Part' should be 1 .. {0}", Config.Data.CompoundWMsCount));
UiBridge.Bridge.OnError(this, string.Format("Test 'Part' should be '-' or 1 .. {0}", Config.Data.CompoundWMsCount));
return new List<Event> { Event.ConfigurationError };
}
@@ -383,7 +383,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
flowsForDetection[0] = cBrd.RefFrequency * outPath.FlowMeter.NominalFlow / 2000.0;
double diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1];
double diff = RegisterReaders[Math.Max(0, test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[Math.Max(0, test.Part - 1) * 2 + 1];
pulseFreqsForDetection[0] = diff / (double)(StateMachine.Time - lastTime);
lastTime = StateMachine.Time;
}