diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 09e1af24b..1756f4ddf 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -56,19 +56,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------ Bridge.OnActivity(this, string.Format("Simulating {0}", test.Name)); //------------------------------------------------ diff --git a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs index aa4a2caa7..c4a722da4 100644 --- a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs +++ b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs @@ -448,7 +448,6 @@ namespace TBF.BenchControl.TestMethods.Endurance iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result - iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour } } } diff --git a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 9f85b8bf3..ee52d3332 100644 --- a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -60,19 +60,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStart Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------------------------ Bridge.OnActivity(this, string.Format("{0} simulation", test.Name)); //------------------------------------------------------------------ @@ -679,8 +666,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart #endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result - iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } + } } else if (cameraRoi != null) { diff --git a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 712125c88..9eca0fc60 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -72,19 +72,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------------------------- Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name)); //------------------------------------------------------------------- @@ -1055,7 +1042,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl #endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result - iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour } } else if (cameraRoi != null) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index 6bcdf6f83..71c21eafe 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -73,19 +73,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------------------------- Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name)); //------------------------------------------------------------------- @@ -1027,7 +1014,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged #endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result - iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour } } else if (cameraRoi != null) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index a7cc9a8f0..38cdd09fb 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -68,19 +68,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------------------------- Bridge.OnActivity(this, string.Format("{0} Simulation", test.Name)); //------------------------------------------------------------------- @@ -1074,7 +1061,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection #endif iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result iPerl.LastTestResult = meterRslt; /// Save this test result - iPerl.NominalTestFlowLph = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour } } else if (cameraRoi != null) diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index aa0a30462..89c6698d2 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -729,7 +729,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication for (int wmNr0 = 0; wmNr0 < iperlHeads.Count; wmNr0++) { IperlHead ihead = iperlHeads[wmNr0]; - if (ihead.Group == group && ihead.MuxBoardNrOrGroup14 == muxBrdOrGroup14Nrs[threadIx]) + if ((ihead.Group == group) && (threadIx < muxBrdOrGroup14Nrs.Count) && (ihead.MuxBoardNrOrGroup14 == muxBrdOrGroup14Nrs[threadIx])) { wmFound = true; Results.Entities.WaterMeter wm = ProcessData.BatchRslts.WaterMeters[waterMeterPositions0[wmNr0]]; @@ -1819,7 +1819,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication Byte q2CorrRFlow = 0; Byte q2CorrLFlow = 0; - if (q2CorrType == Q2CorrType.Standard) + /// + /// Calculate Q2 correction form an error measured at Q2 (q2adjResult.Error) + /// + if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction)) + { + return CommErr.None; /// Q2 error is too large, water meter failed anyhow + } + + if (q2CorrType == Q2CorrType.Standard) { /// /// Standard process @@ -1830,11 +1838,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication return CommErr.None; } - if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction)) - { - return CommErr.None; /// Q2 error is too large, water meter failed anyhow - } - q2CorrRFlow = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF); q2CorrLFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF); } @@ -1849,11 +1852,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication return CommErr.None; } - if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction)) - { - return CommErr.None; /// Q2 error is too large, water meter failed anyhow - } - if (ihead.Q2ErrWOCorrection < 0) { q2CorrRFlow = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF); @@ -1867,14 +1865,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication } else if (q2CorrType == Q2CorrType.Greece) { - /// - /// Process for Greece - /// - if (!ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjTestData, out q2Correction)) - { - return CommErr.None; /// Q2 error is too large, water meter failed anyhow - } - q2CorrRFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF); q2CorrLFlow = (byte)((int)Math.Round(q2Correction) & 0x000000FF); } diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs index 970e739eb..c32adeb59 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs @@ -122,19 +122,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0))); allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file - for (int i = 0; i < Config.Data.WMsCount; i++) - { - TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length)) - ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead) - : null; - if (iPerl != null) - { - /// TODO: Reimplement - //iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM - iPerl.NominalTestFlowLph = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour - } - } - //------------------------------------------------ Bridge.OnActivity(this, testParams.Activity); //------------------------------------------------ diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs index cca864276..eed534ea6 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlHead/IperlHead.cs @@ -161,7 +161,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead /// Result of the last test used to calculate Q2 correction factors, etc public Results.Entities.MeterTestRslt LastTestResult2; public Results.Entities.MeterTestRslt LastTestResult; - public double NominalTestFlowLph; /// in liter per hour /// @@ -244,6 +243,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead double errLimitLo = q2adjTestData.ErrLimLo + q2adjTestData.Uncertainty; double errLimitHi = q2adjTestData.ErrLimHi - q2adjTestData.Uncertainty; + double nominalTestFlowLph = 500.0 * (q2adjTestData.Qfrom + q2adjTestData.Qto); /// in lph => 500.0 * ... + //double nominalTestFlowLph = 1000.0 * q2adjTestData.Qfrom; /// in lph => 1000.0 * ... + double volumeRefShiftedToTarget = q2adjResult.VolumeRef * (1.0f + CalibTarget / 100.0f); double q2adjErrorShiftedToTarget = Config.Formulas.ErrorFromVolumes(q2adjResult.VolumeMeter, volumeRefShiftedToTarget); @@ -256,16 +258,17 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead const double B = 8.0; /// Raw units per minute, 8 const double C = B * 60.0; /// Raw units per hour, 480 double D = C / A; /// ml correction per hour - double F = D / (NominalTestFlowLph * 10.0); /// Error corrected with 8 Raw Units per minute [%] + double F = D / (nominalTestFlowLph * 10.0); /// Error corrected with 8 Raw Units per minute [%] double G = F / B; /// Error corrected with 1 Raw Unit per minute [%] q2CorrectionFactor = (-1) * (q2adjErrorShiftedToTarget / G) * (volumeRefShiftedToTarget / q2adjResult.VolumeMeter); - log.WarnFormat("Q2 correction: Pos={0}, PCB#={1}, corrFactor={2}, Q2adjError={3}%, shftdError={4}%, [Lo={5}%, Hi={6}%]", + log.WarnFormat("Q2 correction: Pos={0}, PCB#={1}, corrFactor={2}, Q2adjError={3}%, CalTarget={4}%, shftdError={5}%, [Lo={6}%, Hi={7}%]", Name, SerialNr, q2CorrectionFactor.ToString("F1"), q2adjResult.Error.ToString("F2"), + CalibTarget.ToString("F1"), q2adjErrorShiftedToTarget.ToString("F2"), errLimitLo.ToString("F1"), errLimitHi.ToString("F1")); @@ -426,7 +429,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead calibrationStructV4 = null; LastTestResult = null; - NominalTestFlowLph = 0; + LastTestResult2 = null; OrigCalibFactor = 0; OrigCalibFactorLNA = 0; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 54baf75a4..93f93aea8 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.1020.0")] -[assembly: AssemblyFileVersion("2.18.1020.0")] +[assembly: AssemblyVersion("2.18.1021.0")] +[assembly: AssemblyFileVersion("2.18.1021.0")]