From f5926259a75e1beb9a882510a0f1444d144ab247 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 14 Jan 2019 15:32:26 +0200 Subject: [PATCH] Config.Entities.Test : Support for tests using multiple (but not all) lines (Israel PT50, 4 lines). --- Config/Entities/Test.cs | 34 +++++++++++++++++++ Config/Properties/AssemblyInfo.cs | 4 +-- Results/BatchResults.cs | 2 +- Results/Entities/TestRslt.cs | 12 +++++++ Results/Properties/AssemblyInfo.cs | 4 +-- .../TestMethods/Adjustment/AdjustmentSeq.cs | 2 +- .../CombinedWithDetectionSeq.cs | 2 +- .../TestMethods/Endurance/EnduranceSeq.cs | 2 +- .../TestMethods/FixedStart/FixedStartSeq.cs | 6 ++-- .../FixedStartAdvancedSeq.cs | 2 +- .../FixedStartDeferredEvaluationSeq.cs | 4 +-- .../FixedStartMassCollectionSeq.cs | 6 ++-- .../FixedStartTankCollectionSeq.cs | 4 +-- .../TestMethods/FlyingStart/FlyingStartSeq.cs | 4 +-- .../FlyingStartFirstRepetWithMassCollSeq.cs | 6 ++-- .../FlyingStartMassCollComparativeSeq.cs | 6 ++-- .../FlyingStartMassCollProlongedSeq.cs | 6 ++-- .../FlyingStartMassCollectionSeq.cs | 6 ++-- .../FlyingStartTankCollectionSeq.cs | 4 +-- .../TestMethods/LeakTest/LeakTestSeq.cs | 2 +- .../TestMethods/PMaxTest/PMaxTestSeq.cs | 2 +- .../TestMethods/PulsesTest/PulsesTestSeq.cs | 2 +- .../PulsesTestManual/PulsesTestManualSeq.cs | 2 +- .../SensitivityTest/SensitivityTestSeq.cs | 3 ++ TBF/ProcedureDlg.cs | 12 +++---- TBF/Utils.cs | 4 +-- 26 files changed, 96 insertions(+), 47 deletions(-) diff --git a/Config/Entities/Test.cs b/Config/Entities/Test.cs index 9047f0358..c97798791 100644 --- a/Config/Entities/Test.cs +++ b/Config/Entities/Test.cs @@ -358,6 +358,40 @@ namespace Config.Entities } } + public virtual bool IsPartCompatible(int waterMeterPartNr) + { + if ((this.Part == 0) || (waterMeterPartNr == 0)) return true; + + if ((this.Part % 10) == waterMeterPartNr) return true; + if (((this.Part / 10) % 10) == waterMeterPartNr) return true; + if (((this.Part / 100) % 10) == waterMeterPartNr) return true; + if (((this.Part / 1000) % 10) == waterMeterPartNr) return true; + + return false; + } + + /// + /// Determines whether tests part number is OK. + /// Examples of correct part number are: + /// 1, 2, 12, 21 in case of max. part nr.== 2 + /// 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234 in case of max. part nr.== 4 + /// + /// Tests par tnumber + /// true when Part number is OK + public static bool IsGoodPartNr(int partNr) + { + bool firstDigitIsOK = ((partNr % 10) > 0) && ((partNr % 10) <= Config.Data.MaxPartNr); + bool secondDigitIsOK = (((partNr/10) % 10) > 0) && (((partNr/10) % 10) <= Config.Data.MaxPartNr); + bool thirdDigitIsOK = (((partNr/100) % 10) > 0) && (((partNr/100) % 10) <= Config.Data.MaxPartNr); + bool fourthDigitIsOK = (((partNr/1000) % 10) > 0) && (((partNr/1000) % 10) <= Config.Data.MaxPartNr); + + if (firstDigitIsOK && (partNr / 10 == 0)) return true; + if (firstDigitIsOK && secondDigitIsOK && (partNr / 100 == 0)) return true; + if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && (partNr / 1000 == 0)) return true; + if (firstDigitIsOK && secondDigitIsOK && thirdDigitIsOK && fourthDigitIsOK && (partNr / 10000 == 0)) return true; + + return false; + } public override string ToString() { diff --git a/Config/Properties/AssemblyInfo.cs b/Config/Properties/AssemblyInfo.cs index 88366a39d..6a1140e73 100644 --- a/Config/Properties/AssemblyInfo.cs +++ b/Config/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18.1102.0")] -[assembly: AssemblyFileVersion("2.18.1102.0")] +[assembly: AssemblyVersion("2.18.1110.0")] +[assembly: AssemblyFileVersion("2.18.1110.0")] diff --git a/Results/BatchResults.cs b/Results/BatchResults.cs index b4cda819e..4cc7c4c78 100644 --- a/Results/BatchResults.cs +++ b/Results/BatchResults.cs @@ -96,7 +96,7 @@ namespace Results { if (d.WaterMeters[i] == null) continue; - if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue; + if (!t.IsPartCompatible(waterMeterParts[i])) continue; /// /// Create empty watermeter test results and add them to the list and to dictionaries diff --git a/Results/Entities/TestRslt.cs b/Results/Entities/TestRslt.cs index d66d46b4b..16e34e675 100644 --- a/Results/Entities/TestRslt.cs +++ b/Results/Entities/TestRslt.cs @@ -319,6 +319,18 @@ namespace Results.Entities #endif } + public virtual bool IsPartCompatible(int waterMeterPartNr) + { + if ((this.Part == 0) || (waterMeterPartNr == 0)) return true; + + if ((this.Part % 10) == waterMeterPartNr) return true; + if (((this.Part / 10) % 10) == waterMeterPartNr) return true; + if (((this.Part / 100) % 10) == waterMeterPartNr) return true; + if (((this.Part / 1000) % 10) == waterMeterPartNr) return true; + + return false; + } + public override string ToString() { return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString()); diff --git a/Results/Properties/AssemblyInfo.cs b/Results/Properties/AssemblyInfo.cs index 2fd976ff5..4d5b54d7b 100644 --- a/Results/Properties/AssemblyInfo.cs +++ b/Results/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18.1109.0")] -[assembly: AssemblyFileVersion("2.18.1109.0")] +[assembly: AssemblyVersion("2.18.1110.0")] +[assembly: AssemblyFileVersion("2.18.1110.0")] diff --git a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index b5b74d91b..36b81f0ec 100644 --- a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index c9ed90709..2dca4e185 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -644,7 +644,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); diff --git a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs index 49c8a79b2..30d96477c 100644 --- a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs +++ b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs @@ -393,7 +393,7 @@ namespace TBF.BenchControl.TestMethods.Endurance /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs index cac55b32e..3854ec878 100644 --- a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs @@ -930,7 +930,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -993,7 +993,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -1050,7 +1050,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index 4ccfbaf87..a73d7e38d 100644 --- a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -571,7 +571,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FixedStartDeferredEvaluation/FixedStartDeferredEvaluationSeq.cs b/TBF/BenchControl/TestMethods/FixedStartDeferredEvaluation/FixedStartDeferredEvaluationSeq.cs index 4abb1c10f..50ac8ab37 100644 --- a/TBF/BenchControl/TestMethods/FixedStartDeferredEvaluation/FixedStartDeferredEvaluationSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartDeferredEvaluation/FixedStartDeferredEvaluationSeq.cs @@ -1094,7 +1094,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -1144,7 +1144,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(data.TestName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 6611f69e5..c8a52c012 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -1019,7 +1019,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -1082,7 +1082,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -1139,7 +1139,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index 6936905ba..0ef094582 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -748,7 +748,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -798,7 +798,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 8f060a640..3c8dd792e 100644 --- a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -565,7 +565,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -623,7 +623,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 34a8803ac..76a9236cd 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -829,7 +829,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -901,7 +901,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -959,7 +959,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index 26bf5ceb6..e32c43f49 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -903,7 +903,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -975,7 +975,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -1033,7 +1033,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; /// MetersKind.Single meters Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index 3cb70ab6d..7af0f8fea 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -797,7 +797,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -869,7 +869,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -927,7 +927,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; /// MetersKind.Single meters Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index ec0681899..048dfe256 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -788,7 +788,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -860,7 +860,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt volumeRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterVolume); Results.Entities.MeterTestRslt energyRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.HeatMeterEnergy); @@ -918,7 +918,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; /// MetersKind.Single meters Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index 19e15dd0e..554baa314 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -535,7 +535,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain); Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux); @@ -594,7 +594,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; /// MetersKind.Single meters Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single); diff --git a/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs b/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs index 4b3795ace..785b26868 100644 --- a/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TBF/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs @@ -301,7 +301,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; if (StateMachine.Procedure.MetersKind == MetersKind.Single) { diff --git a/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs b/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs index f2c25f22e..cf8c0df81 100644 --- a/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TBF/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -212,7 +212,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; if (StateMachine.Procedure.MetersKind == MetersKind.Single) { diff --git a/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs b/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs index 6e4f63691..0f895c67d 100644 --- a/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs +++ b/TBF/BenchControl/TestMethods/PulsesTest/PulsesTestSeq.cs @@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs index 3c139d484..de97fdf11 100644 --- a/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs @@ -403,7 +403,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual for (int i = 0; i < BatchRslts.WMPositionsCount; i++) { - if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + if (!test.IsPartCompatible(Utils.PartNr(i + 1, BatchRslts.Batch.Compound))) continue; Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single); GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; diff --git a/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs b/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs index 54bfd5c26..2f234d4d9 100644 --- a/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs +++ b/TBF/BenchControl/TestMethods/SensitivityTest/SensitivityTestSeq.cs @@ -242,7 +242,10 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest } int time = StateMachine.Time; + + /// TODO: !!! The following can only be done for compound meters int diff = RegisterReaders[(test.Part - 1) * 2 + 1].WMPulses - lastWMPulses[(test.Part - 1) * 2 + 1]; + flowsForDetection[0] = cBrd.ReferenceFreq * outPath.FlowMeter.NominalFlow / 2000.0f; pulseFreqsForDetection[0] = (float)diff / (float)(time - lastTime); lastTime = StateMachine.Time; diff --git a/TBF/ProcedureDlg.cs b/TBF/ProcedureDlg.cs index bbf880bcb..d6dd8ab9c 100644 --- a/TBF/ProcedureDlg.cs +++ b/TBF/ProcedureDlg.cs @@ -809,7 +809,7 @@ namespace TBF if (e.SubItem == (int)MtrlgyClmn.Part) { if (e.DisplayText.Equals("-")) return; /// OK - if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > Config.Data.MaxPartNr) + if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy)) { e.DisplayText = e.Item.SubItems[e.SubItem].Text; e.Cancel = true; @@ -1114,7 +1114,7 @@ namespace TBF if (e.SubItem == (int)Mtrlgy2Clmn.Part) { if (e.DisplayText.Equals("-")) return; /// OK - if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > Config.Data.MaxPartNr) + if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy)) { e.DisplayText = e.Item.SubItems[e.SubItem].Text; e.Cancel = true; @@ -1357,8 +1357,8 @@ namespace TBF if (e.SubItem == (int)ProcessClmn.Part) { if (e.DisplayText.Equals("-")) return; /// OK - if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > 3) - { + if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy)) + { e.DisplayText = e.Item.SubItems[e.SubItem].Text; e.Cancel = true; return; /// NOK @@ -1596,8 +1596,8 @@ namespace TBF if (e.SubItem == (int)ParametersClmn.Part) { if (e.DisplayText.Equals("-")) return; /// OK - if (!int.TryParse(e.DisplayText, out dummy) || dummy < 1 || dummy > 3) - { + if (!int.TryParse(e.DisplayText, out dummy) || !Test.IsGoodPartNr(dummy)) + { e.DisplayText = e.Item.SubItems[e.SubItem].Text; e.Cancel = true; return; /// NOK diff --git a/TBF/Utils.cs b/TBF/Utils.cs index 2c1575ca2..540bae026 100644 --- a/TBF/Utils.cs +++ b/TBF/Utils.cs @@ -261,8 +261,8 @@ namespace TBF if (combined) return wmNr1; - int wmPartSize = 1 + (wmNr1 - 1) / Config.Data.LineSize; - return wmPartSize; + int wmPartNr = 1 + (wmNr1 - 1) / Config.Data.LineSize; + return wmPartNr; } ///