diff --git a/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs b/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs index c24171914..41eee7b36 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/ITestMethod.cs @@ -11,12 +11,12 @@ namespace TBF.BenchControl.GenericDevices /// /// True = use result of the test with this method when evaluating the final result /// - bool Evaluate { get; } + bool Evaluate(Entities.Test test); /// /// True = use result of the test with this method when publishing (printing, saving) results /// - bool Publish { get; } + bool Publish(Entities.Test test); /// /// Check compatibility of the method with the watermeters diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs index c7040d8f9..603eb56b6 100644 --- a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("TestMethods.Adjustment({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return false; } } - public bool Publish { get { return false; } } + public bool Evaluate(Entities.Test test) { return false; } + public bool Publish(Entities.Test test) { return false; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs index 3a16bb887..a561e5556 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetection.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetection)); public override string ToString() { return string.Format("TestMethods.CameraRoiDetection({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return false; } } - public bool Publish { get { return false; } } + public bool Evaluate(Entities.Test test) { return false; } + public bool Publish(Entities.Test test) { return false; } public bool CanTest(Entities.MetersKind meters) { return true; } public RoiDetection() diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs index 242f11839..c11f7d9cb 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/TestMethod.cs @@ -15,8 +15,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters readonly TestMethodCfg testMethodCfg; - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Combined; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs index 2f3f57939..68d9de181 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/TestMethod.cs @@ -15,8 +15,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection readonly TestMethodCfg testMethodCfg; - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Combined; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartCombinedMeters/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartCombinedMeters/TestMethod.cs index bb7023fbf..566967ffe 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartCombinedMeters/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartCombinedMeters/TestMethod.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("TestMethods.FixedStartMassCollection({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/TestMethod.cs index 41463e87a..ba222e054 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/TestMethod.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("TestMethods.FixedStartMassCollection({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethod.cs index 6cb8dd3fa..aad363bb3 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/TestMethod.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("TestMethods.FlyingStart({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs index 7c345b253..534b7361d 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/TestMethod.cs @@ -16,8 +16,34 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod readonly TestMethodCfg testMethodCfg; - public bool Evaluate { get { return testMethodCfg.TestParams.Evaluate; } } - public bool Publish { get { return testMethodCfg.TestParams.Publish; } } + public bool Evaluate(Entities.Test test) + { + TestParams tp = new TestParams(); + foreach (var tstPrms in test.MoreParams) + { + if (tstPrms.CmpntName.Equals(Name)) + { + tp.UpdateTestParams(tstPrms); + return tp.Evaluate; + } + } + return true; + } + + public bool Publish(Entities.Test test) + { + TestParams tp = new TestParams(); + foreach (var tstPrms in test.MoreParams) + { + if (tstPrms.CmpntName.Equals(Name)) + { + tp.UpdateTestParams(tstPrms); + return tp.Publish; + } + } + return true; + } + public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/LeakTest/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/LeakTest/TestMethod.cs index c790602c4..4c5edeb52 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LeakTest/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LeakTest/TestMethod.cs @@ -15,8 +15,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest readonly TestMethodCfg testMethodCfg; - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return true; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/TestMethod.cs index fe3397156..f9e8ee4b6 100644 --- a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/TestMethod.cs @@ -15,8 +15,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest readonly TestMethodCfg testMethodCfg; - public bool Evaluate { get { return true; } } - public bool Publish { get { return true; } } + public bool Evaluate(Entities.Test test) { return true; } + public bool Publish(Entities.Test test) { return true; } public bool CanTest(Entities.MetersKind meters) { return true; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/TestMethod.cs index c96518fea..6ec60b7fa 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/TestMethod.cs @@ -13,8 +13,8 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); public override string ToString() { return string.Format("TestMethods.ReferenceFlowmeterCalibration({0})", Cfg.ToString(1)); } - public bool Evaluate { get { return false; } } - public bool Publish { get { return false; } } + public bool Evaluate(Entities.Test test) { return false; } + public bool Publish(Entities.Test test) { return false; } public bool CanTest(Entities.MetersKind meters) { return true; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs index 2267df844..ae1c50aff 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs @@ -21,8 +21,27 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication public bool SimultWithPrevious { get { return testMethodCfg.TestParams.SimultWithPrevious; } } public bool SimultWithNext { get { return testMethodCfg.TestParams.SimultWithNext; } } - public bool Evaluate { get { return false; } } - public bool Publish { get { return false; } } + + public bool Evaluate(Entities.Test test) + { + return Publish(test); + } + + public bool Publish(Entities.Test test) + { + iPerlCommunicationParams tp = new iPerlCommunicationParams(); + foreach (var tstPrms in test.MoreParams) + { + if (tstPrms.CmpntName.Equals(Name)) + { + tp.UpdateTestParams(tstPrms); + string lowercaseAct = tp.Activity.ToLower(); + return lowercaseAct.Contains("simulate ") || lowercaseAct.Contains("q2 corrected from "); + } + } + return false; + } + public bool CanTest(Entities.MetersKind meters) { return meters == Entities.MetersKind.Single; } public TestMethod() diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs index 9b3456967..d6dd8ad27 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationSeq.cs @@ -59,9 +59,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); - const string Q2correctedFromCmd = "Q2 corrected from "; + const string Q2correctedFromCmd = "q2 corrected from "; - if (testParams.Activity.Contains(Q2correctedFromCmd)) + if (testParams.Activity.ToLower().Contains(Q2correctedFromCmd)) { string fromTestName = testParams.Activity.Substring(Q2correctedFromCmd.Length); @@ -81,7 +81,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication rList.Add(Event.Done); return rList; } - else if (testParams.Activity.Contains("Simulate ")) + else if (testParams.Activity.ToLower().Contains("simulate ")) { Entities.TestResult tstRslt; @@ -104,6 +104,17 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour } } + + //------------------------------------------------ + Bridge.OnActivity(this, testParams.Activity); + //------------------------------------------------ + + State.Create(string.Format("iPerlCommunicationSeq : {0}", testParams.Activity)) + .AddOperation(checkUiOp) + .EnterState(); + e = StateMachine.WaitRunDevsRunOps(); + + if (e.Contains(Event.UiCmdStop)) retVal = Event.UiCmdStop; } else { diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index e4db76628..adbba61e5 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.5.106.1")] -[assembly: AssemblyFileVersion("1.5.106.1")] +[assembly: AssemblyVersion("1.5.107.1")] +[assembly: AssemblyFileVersion("1.5.107.1")] diff --git a/TestBenchFramework/Screens/ResultsTabPageCtrl.cs b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs index 618d6199f..4fc0d7823 100644 --- a/TestBenchFramework/Screens/ResultsTabPageCtrl.cs +++ b/TestBenchFramework/Screens/ResultsTabPageCtrl.cs @@ -249,9 +249,9 @@ namespace TBF.Screens /// Get decorated test names for the specified watermeter /// The parameter meterNr is used in the same way as the parameter meterNr of Utils.GetSortedTestResults /// - /// Water meter nr (1-based): 1 .. Program.WMsCount + /// Water meter nr (1-based): 1 .. Program.WMsCount /// A list of strings - IList GetAllDecoratedTestNames(int meterNr) + IList GetAllDecoratedTestNames(int meterPartNr) { IList rslt = new List(); @@ -260,7 +260,7 @@ namespace TBF.Screens BenchControl.GenericDevices.ITestMethod method = BenchControl.TbfComponents.FindComponent(test.Method) as BenchControl.GenericDevices.ITestMethod; - if ((method != null) && method.Publish && ((test.Part == 0) || (meterNr == 0) || (test.Part == meterNr))) + if ((method != null) && method.Publish(test) && ((test.Part == 0) || (meterPartNr == 0) || (test.Part == meterPartNr))) { if (test.Repeats == 1) { diff --git a/TestBenchFramework/Utils.cs b/TestBenchFramework/Utils.cs index a68387b81..a7d2c519f 100644 --- a/TestBenchFramework/Utils.cs +++ b/TestBenchFramework/Utils.cs @@ -196,7 +196,7 @@ namespace TBF BenchControl.GenericDevices.ITestMethod method = BenchControl.TbfComponents.FindComponent(test.Method) as BenchControl.GenericDevices.ITestMethod; - if ((method != null) && method.Publish && ((test.Part == 0) || (meterPartNr == 0) || (test.Part == meterPartNr))) + if ((method != null) && method.Publish(test) && ((test.Part == 0) || (meterPartNr == 0) || (test.Part == meterPartNr))) { for (int rpt = 1; rpt <= test.Repeats; rpt++) { @@ -238,7 +238,7 @@ namespace TBF BenchControl.GenericDevices.ITestMethod method = BenchControl.TbfComponents.FindComponent(test.Method) as BenchControl.GenericDevices.ITestMethod; - if ((method != null) && method.Publish && ((test.Part == 0) || (meterPartNr == 0) || (test.Part == meterPartNr))) + if ((method != null) && method.Publish(test) && ((test.Part == 0) || (meterPartNr == 0) || (test.Part == meterPartNr))) { if (test.Repeats == 1) {