iPerlSpecial modifications: RFID ports defined by watermeters, no Quido used, ver.2.5.268.

This commit is contained in:
Milan Hanajik 2016-04-19 10:10:51 +02:00
parent b1e0e74d8a
commit 1d924d7d40
3 changed files with 39 additions and 18 deletions

View File

@ -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);

View File

@ -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<WaterMeters.iPerl.WaterMeter>();
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());
}
/// <summary>

View File

@ -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")]