|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
///
|
|
|
|
|
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
|
|
|
|
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
|
|
|
|
|
///
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
@@ -18,10 +18,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
{
|
|
|
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(iPerlCommunicationSeq));
|
|
|
|
|
|
|
|
|
|
public const string Q2correctedFromCmd = "q2 corrected from ";
|
|
|
|
|
public const string StrictQ2ErrorCheckStr = "strict Q2 error check ";
|
|
|
|
|
public const string Q2correctionCheckCmd = "q2 correction check ";
|
|
|
|
|
public const string IperlCheckCmd = "iperl_check ";
|
|
|
|
|
public const string Q2correctedFromCmd = "Q2 corrected from ";
|
|
|
|
|
public const string StrictQ2ErrorCheckStr = "Strict Q2 error check ";
|
|
|
|
|
public const string Q2correctionCheckCmd = "Q2 correction check ";
|
|
|
|
|
public const string IperlCheckCmd = "iPERL_check ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.Windows.Forms.Form modelessDlg;
|
|
|
|
@@ -59,8 +59,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
modelessDlg = null;
|
|
|
|
|
|
|
|
|
|
processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
|
|
|
|
|
|
|
|
|
if (testParams.Activity.ToLower().Equals(iPerlCommunicationForm.GetDefaultQ2CorrectionsStr.ToLower()))
|
|
|
|
|
|
|
|
|
|
string cmd;
|
|
|
|
|
if (testParams.Activity.ToLower().Equals(cmd = iPerlCommunicationForm.GetDefaultQ2CorrectionsStr.ToLower()))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
@@ -114,13 +115,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
}
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(Q2correctedFromCmd))
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(cmd = Q2correctedFromCmd.ToLower()))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
|
|
|
|
|
|
|
|
|
|
string fromTestName = testParams.Activity.Substring(Q2correctedFromCmd.Length);
|
|
|
|
|
string fromTestName = testParams.Activity.Substring(cmd.Length);
|
|
|
|
|
|
|
|
|
|
MakeQ2CorrectedFrom(test.Name, fromTestName);
|
|
|
|
|
|
|
|
|
@@ -130,13 +131,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
}
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(StrictQ2ErrorCheckStr))
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(cmd = StrictQ2ErrorCheckStr.ToLower()))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
|
|
|
|
|
|
|
|
|
|
string fromTestName = testParams.Activity.Substring(Q2correctedFromCmd.Length);
|
|
|
|
|
string fromTestName = testParams.Activity.Substring(cmd.Length);
|
|
|
|
|
|
|
|
|
|
StrictQ2ErrorCheck(test.Name, fromTestName);
|
|
|
|
|
|
|
|
|
@@ -146,13 +147,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
}
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(Q2correctionCheckCmd))
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(cmd = Q2correctionCheckCmd.ToLower()))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
|
|
|
|
|
|
|
|
|
|
string[] testNames = testParams.Activity.Substring(Q2correctionCheckCmd.Length).Split(new char[] { ' ' });
|
|
|
|
|
string[] testNames = testParams.Activity.Substring(cmd.Length).Split(new char[] { ' ' });
|
|
|
|
|
|
|
|
|
|
if (testNames.Length >= 2)
|
|
|
|
|
{
|
|
|
|
@@ -165,13 +166,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
}
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(IperlCheckCmd))
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(cmd = IperlCheckCmd.ToLower()))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
|
|
|
|
|
|
|
|
|
|
string[] args = testParams.Activity.Substring(IperlCheckCmd.Length).Split(new char[] { ' ' });
|
|
|
|
|
string[] args = testParams.Activity.Substring(cmd.Length).Split(new char[] { ' ' });
|
|
|
|
|
|
|
|
|
|
int maxTestIndex = (ProcessData.BenchInfo is DataContainer.iPerlBenchInfo.Component)
|
|
|
|
|
? (ProcessData.BenchInfo as DataContainer.iPerlBenchInfo.Component).MaxTestIndex
|
|
|
|
@@ -284,19 +285,19 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
}
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("simulate "))
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains(cmd = "simulate "))
|
|
|
|
|
{
|
|
|
|
|
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
|
|
|
|
|
|
|
|
|
|
if (testParams.Activity.ToLower().Contains("q3")) MakeSimulated(test, 1, 0, -0.5f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("q2")) MakeSimulated(test, 1, 0, 0.5f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("q1")) MakeSimulated(test, 1, 0, -5.1f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("compound ok")) MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("compound nok")) MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("compound rise")) MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
|
|
|
|
|
else if (testParams.Activity.ToLower().Contains("compound fall")) MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "q2") MakeSimulated(test, 1, 0, 0.5f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "q1") MakeSimulated(test, 1, 0, -5.1f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound ok") MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound nok") MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound rise") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
|
|
|
|
|
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound fall") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
|
|
|
|
|
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
|
|
|
|
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
|
|
|
@@ -731,36 +732,39 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
|
|
|
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
|
|
|
|
|
: null;
|
|
|
|
|
|
|
|
|
|
#if ORACLE_DB
|
|
|
|
|
meterRslt.ErrorBC = oriMeterRslt.Error;
|
|
|
|
|
#endif
|
|
|
|
|
meterRslt.PulsesMeter = oriMeterRslt.PulsesMeter;
|
|
|
|
|
meterRslt.PulsesMaster = oriMeterRslt.PulsesMaster;
|
|
|
|
|
meterRslt.PulsesPerLiter = oriMeterRslt.PulsesPerLiter;
|
|
|
|
|
meterRslt.VolumeRef = oriMeterRslt.VolumeRef;
|
|
|
|
|
meterRslt.TestTime = oriMeterRslt.TestTime;
|
|
|
|
|
|
|
|
|
|
if (iPerl != null && ProcessData.BatchRslts.Batch.WaterMeters[i] != null &&
|
|
|
|
|
!ProcessData.BatchRslts.Batch.WaterMeters[i].Disabled)
|
|
|
|
|
if (meterRslt != null && oriMeterRslt != null)
|
|
|
|
|
{
|
|
|
|
|
/// Either no iPerl head or no Q2 correction
|
|
|
|
|
meterRslt.Error = oriMeterRslt.Error;
|
|
|
|
|
meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter;
|
|
|
|
|
meterRslt.VolumeStart = oriMeterRslt.VolumeStart;
|
|
|
|
|
meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd;
|
|
|
|
|
#if ORACLE_DB
|
|
|
|
|
if (ProcessData.BatchRslts.Batch.WaterMeters[i].Pruefindex == 1)
|
|
|
|
|
{
|
|
|
|
|
meterRslt.Passed = (oriMeterRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin()
|
|
|
|
|
&& oriMeterRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
meterRslt.ErrorBC = oriMeterRslt.Error;
|
|
|
|
|
#endif
|
|
|
|
|
meterRslt.PulsesMeter = oriMeterRslt.PulsesMeter;
|
|
|
|
|
meterRslt.PulsesMaster = oriMeterRslt.PulsesMaster;
|
|
|
|
|
meterRslt.PulsesPerLiter = oriMeterRslt.PulsesPerLiter;
|
|
|
|
|
meterRslt.VolumeRef = oriMeterRslt.VolumeRef;
|
|
|
|
|
meterRslt.TestTime = oriMeterRslt.TestTime;
|
|
|
|
|
|
|
|
|
|
if (iPerl != null && ProcessData.BatchRslts.Batch.WaterMeters[i] != null &&
|
|
|
|
|
!ProcessData.BatchRslts.Batch.WaterMeters[i].Disabled)
|
|
|
|
|
{
|
|
|
|
|
meterRslt.Passed = oriMeterRslt.Passed;
|
|
|
|
|
/// Either no iPerl head or no Q2 correction
|
|
|
|
|
meterRslt.Error = oriMeterRslt.Error;
|
|
|
|
|
meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter;
|
|
|
|
|
meterRslt.VolumeStart = oriMeterRslt.VolumeStart;
|
|
|
|
|
meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd;
|
|
|
|
|
#if ORACLE_DB
|
|
|
|
|
if (ProcessData.BatchRslts.Batch.WaterMeters[i].Pruefindex == 1)
|
|
|
|
|
{
|
|
|
|
|
meterRslt.Passed = (oriMeterRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin()
|
|
|
|
|
&& oriMeterRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
meterRslt.Passed = oriMeterRslt.Passed;
|
|
|
|
|
}
|
|
|
|
|
meterRslt.TestDone = true;
|
|
|
|
|
tstRslt.TestDone = true;
|
|
|
|
|
}
|
|
|
|
|
meterRslt.TestDone = true;
|
|
|
|
|
tstRslt.TestDone = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|