diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs index 55810018a..80f55d915 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/TestMethod.cs @@ -62,22 +62,34 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication { /// Check whether RFID serial ports are free SerialPort rfidPort; - rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard1), 9600, Parity.None, 8, StopBits.One); - rfidPort.Open(); - rfidPort.Close(); + if (testMethodCfg.RfidPortNrBoard1 != 0) + { + rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard1), 9600, Parity.None, 8, StopBits.One); + rfidPort.Open(); + rfidPort.Close(); + } - rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard2), 9600, Parity.None, 8, StopBits.One); - rfidPort.Open(); - rfidPort.Close(); + if (testMethodCfg.RfidPortNrBoard2 != 0) + { + rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard2), 9600, Parity.None, 8, StopBits.One); + rfidPort.Open(); + rfidPort.Close(); + } - rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard3), 9600, Parity.None, 8, StopBits.One); - rfidPort.Open(); - rfidPort.Close(); + if (testMethodCfg.RfidPortNrBoard3 != 0) + { + rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard3), 9600, Parity.None, 8, StopBits.One); + rfidPort.Open(); + rfidPort.Close(); + } - rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard4), 9600, Parity.None, 8, StopBits.One); - rfidPort.Open(); - rfidPort.Close(); - } + if (testMethodCfg.RfidPortNrBoard4 != 0) + { + rfidPort = new SerialPort(string.Format("COM{0}", testMethodCfg.RfidPortNrBoard4), 9600, Parity.None, 8, StopBits.One); + rfidPort.Open(); + rfidPort.Close(); + } + } rfidDataLogger.Fatal("------------------------------------------------------------------------"); rfidDataLogger.FatalFormat("Test Bench Framework ver. {0}", Program.Version); diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 5548a286a..782301926 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Runtime.InteropServices; +using System.Text; using System.Threading; using System.Windows.Forms; using log4net; @@ -438,13 +439,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication waterMeters = new List(); foreach (var rr in ProcessData.RegisterReaders) { - WaterMeters.iPerl.WaterMeter iPerl = rr as WaterMeters.iPerl.WaterMeter; - if (iPerl != null) waterMeters.Add(iPerl); + if (rr is WaterMeters.iPerl.WaterMeter) + { + waterMeters.Add(rr as WaterMeters.iPerl.WaterMeter); + } } WaterMetersCount = waterMeters.Count; - ShuffleTextBoxes(this.WaterMetersCount, Config.Data.LineSize); + ShuffleTextBoxes(WaterMetersCount, Config.Data.LineSize); /// /// Prepare worker threads, 'rfidPortNrs', 'lastGroup', etc.. @@ -473,6 +476,12 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication if (iPerl.Group > lastGroup) lastGroup = iPerl.Group; } + + StringBuilder sb = new StringBuilder(); + sb.Append("rfidPortNrs = {"); + foreach (var v in rfidPortNrs) sb.Append(string.Format(" {0}", v)); + sb.Append(string.Format(" }, nrThreads = {0}", workerThreads.Count)); + log.WarnFormat(sb.ToString()); } /// diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index d09ca0f39..d79ca8680 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.5.267.1")] -[assembly: AssemblyFileVersion("2.5.267.1")] +[assembly: AssemblyVersion("2.5.268.1")] +[assembly: AssemblyFileVersion("2.5.268.1")]