From 7afb780d5b2f29c8c1ffef4cc0cee79cd75ed84f Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 16 Sep 2015 16:30:30 +0200 Subject: [PATCH] More RFID comm. logging, 'Set active mode' executed also when wm.CommFailed == true, version 1.5.114. --- TODO.txt | 4 --- .../iPerlCommunicationForm.cs | 29 +++++++++++++++---- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/TODO.txt b/TODO.txt index 9a1ac8897..2c709d2f7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,10 +1,6 @@ iPerl: -- moznost iPerl komunikacie pri vypustani (do Active modu), pouzit 'Simultaneously with next...' -- 'Q2 corrected from ...' chyba sa nezmensi, ukaze sa povodna - 'Q2 corrected from ...' Evaluate a Publish parametre -- Results: ukazovat aj Disabled vodomery - STOP nefunguje vzdy (alebo pomaly) - zlepsit uzivatelsky dojem -- Oracle DB: Bauwjahr - Oracle DB: UPDATE ... - MeterType v iPerl.WaterMeter zmenit na test parameter diff --git a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index d672228ce..166e64503 100644 --- a/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TestBenchFramework/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -143,10 +143,21 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication retv = 0; } - rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", wm.Name, messageID, offset, lenght, retv, (retv != 0) ? "!" : ""); - buffer = new byte[lenght]; for (int i = 0; i < lenght; i++) buffer[i] = buf[i]; + + if ((messageID == MessageID.Configuration) && (offset == 0) && (lenght == WaterMeters.iPerl.ConfigStruct.Length)) + { + rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1},...) returned {2} {3}", wm.Name, messageID, retv, (retv != 0) ? "!" : WaterMeters.iPerl.ConfigStruct.FromByteArray(buffer).ToString()); + } + else if ((messageID == MessageID.Calibration) && (offset == 0) && (lenght == WaterMeters.iPerl.CalibrationStruct.Length)) + { + rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1},...) returned {2} {3}", wm.Name, messageID, retv, (retv != 0) ? "!" : WaterMeters.iPerl.CalibrationStruct.FromByteArray(buffer).ToString()); + } + else + { + rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", wm.Name, messageID, offset, lenght, retv, (retv != 0) ? "!" : ""); + } } return retv; @@ -194,7 +205,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication } else if (lenght == 2) { - rfidDataLogger.InfoFormat("{0}, WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", wm.Name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : ""); + if (messageID == MessageID.Calibration && offset == 2) + { + UInt16 calibFactor = (UInt16)(pBuf[0] + 256 * pBuf[1]); + rfidDataLogger.InfoFormat("{0}, WriteRequestPort(calibFactor={1}) returned {2} {3}", wm.Name, calibFactor, retv, (retv != 0) ? "!" : ""); + } + else + { + rfidDataLogger.InfoFormat("{0}, WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", wm.Name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : ""); + } } else { @@ -775,8 +794,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication /// true on success static CommErr SetActiveMode(WaterMeters.iPerl.WaterMeter wm, ref string resultStr) { - if (wm.CommFailed) return CommErr.CommFailed; - if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port CommErr error = CommErr.CmdActive; @@ -863,7 +880,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication CommErr error = CommErr.Write; - UInt16 newCalibFactor = 3000; /// Default value + UInt16 newCalibFactor = 2600; /// Default value /// if (multiTestParams[currentActivityStep].Activity.Length > WriteCalibrationFactorStr.Length) { diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 3338599c3..2c3c05c28 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.113.1")] -[assembly: AssemblyFileVersion("1.5.113.1")] +[assembly: AssemblyVersion("1.5.114.1")] +[assembly: AssemblyFileVersion("1.5.114.1")]