diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index d6df220a7..c33ed73d5 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.9.3102.1")] -[assembly: AssemblyFileVersion("3.9.3102.1")] +[assembly: AssemblyVersion("3.9.3103.1")] +[assembly: AssemblyFileVersion("3.9.3103.1")] diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs index f54934ef8..5a212823b 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs @@ -445,6 +445,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) { log.Debug("PCB_Read() - Simulated response"); + genesisHead.SerialNr = $"PCB_Simul_{genesisHead.GetSlotNr}"; + if (genesisHead.ConfigStruct != null) + genesisHead.ConfigStruct.PCBNumberString = $"PCB_Simul_{genesisHead.GetSlotNr}"; return PcbReadResult.Ok("Simulated PCB_Read"); } diff --git a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs index ff4edde04..9bbb443d6 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs @@ -63,6 +63,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication retVal.Add(iPerlCommunicationForm.SlotDisconnectStr); retVal.Add(iPerlCommunicationForm.PrepareSlotQ3CalibrationStr); retVal.Add(iPerlCommunicationForm.WriteSlotQ3CalibrationStr); + retVal.Add(iPerlCommunicationForm.HoldSlotStr); retVal.Add(iPerlCommunicationForm.ReadConfigurationStr); diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 03ad21e76..d2db71776 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -89,6 +89,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication public const string SlotDisconnectStr = "Disconnect Slot"; public const string PrepareSlotQ3CalibrationStr = "Prepare Q3 Calibration Slot"; public const string WriteSlotQ3CalibrationStr = "Write Q3 Calibration Slot"; + public const string HoldSlotStr = "Hold Slot"; public const string ReadConfigurationStr = "Read configuration"; /// Example: "Read configuration" or "Read configuration if enabled" public const string SetTestModeStr = "Set Test mode"; /// Example: "Set Test mode" or "Set Test mode A0" (hexadecimal number is the required 'testModeConfig' @@ -651,6 +652,12 @@ namespace TBF.Rig.TestMethods.iPerlCommunication #endregion + private static int _messageBoxActive = 0; + + // blocked while MessageBox is active + private static readonly ManualResetEventSlim _messageBoxDone = + new ManualResetEventSlim(true); + /// /// Worker thread /// @@ -703,6 +710,19 @@ namespace TBF.Rig.TestMethods.iPerlCommunication rfidDataLogger.InfoFormat(""); } + //HOLD ON - if activity is like HoldSlotStr, ignore loop and do activity like HoldSlotStr + if (currentActivity.ToLower().Equals(HoldSlotStr.ToLower())) + { + + log.Debug($"Activity '{currentActivity}' is HoldSlotStr, skipping loop and performing HoldOn operation. Thread: {threadID}"); + + CommErr error; + string resultStr = string.Empty; + error = HoldOn(threadID, ref resultStr); // wait for the hold on to complete - one time for each thread + ProcessWaterMetersDialogConfirmation(threadID, resultStr,error); + return; + } + for (int group = 1; group <= lastGroup; group++) { /// Synchronize with QuidoRS and other threads @@ -716,7 +736,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication #if TURA_SPECIAL int threadIx = threadID; /// Just one thread for TURA_SPECIAL #else - for (int threadIx = threadID; threadIx < threadID + 10; threadIx += cfg.NrThreads)//BUMI - max threads = 4 => 10 + for (int threadIx = threadID; threadIx < threadID + 10; threadIx += cfg.NrThreads)// - max threads = 4 => 10 #endif { bool wmFound = false; @@ -859,6 +879,79 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } } + /// + /// Set the state messages in WaterMeters Dialog Confirmation + /// Use after HoldOn() + /// + /// + /// + private static void ProcessWaterMetersDialogConfirmation(int threadID, string resultStr, CommErr commErr) + { + bool wmFound = false; + for (int wmNr0 = 0; wmNr0 < genesisHeads.Count; wmNr0++) + { + GenesisSmartReader ihead = genesisHeads[wmNr0]; + + wmFound = true; + + WaterMeter wm = null; + if (ProcessData.BatchRslts.Batch.WaterMeters != null) + { + foreach (var w in ProcessData.BatchRslts.Batch.WaterMeters) + { + if (w.WMPosition == wmNr0 + 1) + { + wm = w; + break; + } + } + } + + OnCommCompleted(null, + new CommCompletedEventArgs(threadID, wmNr0, ihead, wm, resultStr, commErr)); + } + } + + + private CommErr HoldOn(int threadId, ref string resultStr) + { + log.InfoFormat("HoldOn() threadId={0}", threadId); + CommErr error = CommErr.CommFailed; + + // only first thread enters here + if (Interlocked.CompareExchange(ref _messageBoxActive, 1, 0) == 0) + { + try + { + // block other threads + _messageBoxDone.Reset(); + + if (this.InvokeRequired) + { + this.Invoke(new Action(() => { MessageBox.Show( this, "Confirm when you are ready to continue.", "Communication HOLD ON", MessageBoxButtons.OK, MessageBoxIcon.Information ); })); + } + else + { + MessageBox.Show( this, "Confirm when you are ready to continue.", "Communication HOLD ON", MessageBoxButtons.OK, MessageBoxIcon.Information ); + } + } + finally + { + // release all waiting threads after OK + Interlocked.Exchange(ref _messageBoxActive, 0); + _messageBoxDone.Set(); + + } + } + else + { + // other threads wait here until OK is pressed + _messageBoxDone.Wait(); + } + error = CommErr.None; + return error; + } + private CommErr PrepareSlotQ3Calibration(int threadId, GenesisSmartReader iHead, ref string resultStr) { CommErr error = CommErr.FailedLogin; @@ -867,7 +960,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { log.Debug("SlotLogin successful"); resultStr = string.Format($"Write Q3 Calibration: OK"); - //TODO BUMI make note Q3 calibration is done + // note Q3 calibration is done error = CommErr.None; } else @@ -885,7 +978,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { log.Debug("SlotLogin successful"); resultStr = string.Format($"Write Q3 Calibration: OK"); - //TODO BUMI make note Q3 calibration is done + // note Q3 calibration is done error = CommErr.None; } else @@ -923,7 +1016,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication bool result = iHead.OptoHeadTest.TurnOffRadio(); if (result) { - log.Debug("SlotSetActiveMode successful"); + log.Debug("SlotDisconnect successful"); resultStr = string.Format($"Slot Disconnected: {resultStr}"); error = CommErr.None; } @@ -1199,7 +1292,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (ihead.OptoHeadTest.SetTestMode()) { - log.Debug($" Iperl:{ihead.Name}, test mode activated now"); + log.Debug($"Meter Head:{ihead.Name}, test mode activated now"); } @@ -1207,7 +1300,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { /// Already in the correct test mode resultStr = "Already " + ihead.ConfigStruct.ToString(1); - log.Debug($" Iperl:{ihead.Name}, status: {resultStr}"); + log.Debug($"Meter Head:{ihead.Name}, status: {resultStr}"); return CommErr.None; } @@ -1266,544 +1359,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication return error; } - - /// - /// Read a complete calibration structure from the watermeter - /// - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr ReadCalibration(IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed) return CommErr.CommFailed; - // - // CommErr error = CommErr.Read; - // int readRetVal = 0; - // - // /// Read calibration - // byte[] calib = null; - // readRetVal = ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 0, CalibrationStruct.Length, out calib); - // if (readRetVal == 0) - // { - // ihead.CalibrationStruct = CalibrationStruct.FromByteArray(calib); - // - // if (wm.OrigCalibFactor == 0) - // { - // wm.OrigCalibFactor = ihead.CalibrationStruct.Calibration; - // wm.FWVersion = ihead.CalibrationStruct.FWVersionStr(); - // } - // - // resultStr = ihead.CalibrationStruct.ToString(); - // error = ihead.VerifyIPerlType() ? CommErr.None : CommErr.WrongIPerlType; - // } - // - // return error + Math.Max(0, Math.Min(readRetVal, 4)); - // } - - - /// - /// Read a complete calibration structure from the watermeter - /// - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr ReadCalibrationV4(IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed) return CommErr.CommFailed; - // - // CommErr error = CommErr.Read; - // int readRetVal = 0; - // - // /// Read calibration - // byte[] calib = null; - // readRetVal = ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 0, CalibrationStructV4.Length, out calib); - // if (readRetVal == 0) - // { - // ihead.CalibrationStructV4 = CalibrationStructV4.FromByteArray(calib); - // - // if ((wm.OrigCalibFactor == 0) && (wm.OrigCalibFactorLNA == 0)) - // { - // wm.OrigCalibFactor = ihead.CalibrationStructV4.Calibration; - // wm.OrigCalibFactorLNA = ihead.CalibrationStructV4.CalibrationLNA; - // wm.FWVersion = ihead.CalibrationStructV4.FWVersionStr(); - // } - // - // resultStr = ihead.CalibrationStructV4.ToString(); - // error = ihead.VerifyIPerlType() ? CommErr.None : CommErr.WrongIPerlType; - // } - // - // return error + Math.Max(0, Math.Min(readRetVal, 4)); - // } - - - /// - /// Write the calculated calibration factor to the water meter. - /// Read a part of CalibrationStruct afterwards to verify factor was written correctly. - /// - /// Thread ID - /// IperlHead object - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr WriteCalibrationFactor(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed || (ihead.CalibrationStruct == null)) return CommErr.CommFailed; - // - // /// - // /// Parse calibration factor (1 argument) or calibration factor limits (2 arguments) - // /// - // UInt16 newCalibFactor = 0; - // if (multiTestParams[currentActivityStep].Activity.Length > WriteCalibrationFactorStr.Length) - // { - // UInt16 factorLimitLo; - // UInt16 factorLimitHi; - // UInt16 val; - // - // string calibFactrorStr = multiTestParams[currentActivityStep].Activity.Substring(WriteCalibrationFactorStr.Length + 1); - // string[] arguments = calibFactrorStr.Split(new char[] { ' ' }); - // - // if (arguments.Length >= 2 && - // UInt16.TryParse(arguments[0], out factorLimitLo) && factorLimitLo > 0 && - // UInt16.TryParse(arguments[1], out factorLimitHi) && factorLimitHi > 0) - // { - // /// - // /// Lower and upper limits for the calibration factor are specified as iPerlCommunication activity arguments - // /// - // if (ihead.LastTestResult == null || !ihead.LastTestResult.TestDone) return CommErr.MissingTest; - // - // newCalibFactor = ihead.CalculateNewCalibFactor(ihead.LastTestResult, ihead.CalibFactor, factorLimitLo, factorLimitHi); - // } - // else if (arguments.Length == 1 && UInt16.TryParse(arguments[0], out val) && val > 0) - // { - // /// - // /// Calibration factor value is specified as an iPerlCommunication activity argument - // /// - // newCalibFactor = val; /// Update with specified value - // } - // else if (arguments.Length == 1 && wm.GetTestData(arguments[0]) != null) - // { - // /// - // /// Adjustment test name is specified as an iPerlCommunication activity argument - // /// - // Results.Entities.TestData adjustTestData = wm.GetTestData(arguments[0]); - // Results.Entities.MeterTestRslt adjustTestRslt; - // if (adjustTestData == null) - // { - // return CommErr.MissingTest; - // } - // else if (adjustTestData.Repeats == 1) - // { - // /// Find a test result if Repeats == 1 - // adjustTestRslt = wm.GetMeterTestRslt(arguments[0]); - // - // if (adjustTestRslt == null || !adjustTestRslt.TestDone) return CommErr.MissingTest; - // } - // else - // { - // /// Calculate a summarized test result if Repeats > 1 - // adjustTestRslt = new Results.Entities.MeterTestRslt(); - // for (int i = 1; i <= adjustTestData.Repeats; i++) - // { - // Results.Entities.MeterTestRslt oneMTR = wm.GetMeterTestRslt(Utils.TestTitle(adjustTestData, i)); - // if (oneMTR == null || !oneMTR.TestDone) return CommErr.MissingTest; - // - // adjustTestRslt.VolumeMeter += oneMTR.VolumeMeter; - // adjustTestRslt.VolumeRef += oneMTR.VolumeRef; - // } - // } - // - // newCalibFactor = ihead.CalculateNewCalibFactor(adjustTestRslt, ihead.CalibFactor, ihead.FactorLimitLo, ihead.FactorLimitHi); - // } - // else - // { - // /// - // /// Otherwise the last test is supposed to be an adjustment test - // /// - // if (ihead.LastTestResult == null || !ihead.LastTestResult.TestDone) return CommErr.MissingTest; - // - // newCalibFactor = ihead.CalculateNewCalibFactor(ihead.LastTestResult, ihead.CalibFactor, ihead.FactorLimitLo, ihead.FactorLimitHi); - // } - // } - // else - // { - // /// - // /// No iPerlCommunication activity arguments --> The last test is supposed to be an adjustment test - // /// - // if (ihead.LastTestResult == null || !ihead.LastTestResult.TestDone) return CommErr.MissingTest; - // - // newCalibFactor = ihead.CalculateNewCalibFactor(ihead.LastTestResult, ihead.CalibFactor, ihead.FactorLimitLo, ihead.FactorLimitHi); - // } - // - // if (newCalibFactor == 0) return CommErr.OutOfRange; - // - // /// - // /// Start communication with iPerl - // /// - // CommErr error; - // byte[] data = new byte[2] { (byte)(newCalibFactor & 0x00FF), (byte)((newCalibFactor >> 8) & 0x00FF) }; - // /// - // /// Write the new calibration factor (up to cfg.MaxCommRetries tims) - // /// - // error = CommErr.Write; - // if (0 == WriteRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, data)) - // { - // /// - // /// Read and verify the calibration factor - // /// - // error = CommErr.ReadAfterWrite; - // byte[] calib_2_3 = null; - // if (0 == ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, out calib_2_3)) - // { - // error = CommErr.Verify; - // if (calib_2_3 != null && calib_2_3.Length == 2 && data[0] == calib_2_3[0] && data[1] == calib_2_3[1]) - // { - // error = CommErr.None; - // ihead.CalibrationStruct.Update(data, 2); - // wm.CalibFactor = newCalibFactor; - // resultStr = ihead.CalibrationStruct.ToString(); - // } - // } - // } - // - // ihead.CalibrationStruct.Update(data, 2); - // - // return error; - // } - - - /// - /// Write the calculated calibration factor to the water meter. - /// Read a part of CalibrationStruct afterwards to verify factor was written correctly. - /// - /// Thread ID - /// IperlHead object - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr WriteCalibrationV4Factors(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed || (ihead.CalibrationStructV4 == null)) return CommErr.CommFailed; - // - // /// - // /// Parse calibration factor (1 argument) or calibration factor limits (2 arguments) - // /// - // UInt16 newCalibFactor = 0; - // UInt16 newCalibFactorLNA = 0; - // if (multiTestParams[currentActivityStep].Activity.Length > WriteCalibrationV4FactorsStr.Length) - // { - // UInt16 factorLimitLo = 0; - // UInt16 factorLimitHi = 0; - // UInt16 lnaFactorLimitLo = 0; - // UInt16 lnaFactorLimitHi = 0; - // Results.Entities.TestData adjustTestData = null; - // Results.Entities.TestData lnaAdjustTestData = null; - // Results.Entities.MeterTestRslt adjustTestRslt = null; - // Results.Entities.MeterTestRslt lnaAdjustTestRslt = null; - // - // string calibFactrorStr = multiTestParams[currentActivityStep].Activity.Substring(WriteCalibrationV4FactorsStr.Length + 1); - // string[] arguments = calibFactrorStr.Split(new char[] { ' ' }); - // - // if (arguments.Length == 6) - // { - // if (!wm.TryGetTestData(arguments[0], out adjustTestData) || - // !UInt16.TryParse(arguments[1], out factorLimitLo) || factorLimitLo <= 0 && - // !UInt16.TryParse(arguments[2], out factorLimitHi) || factorLimitHi <= 0 && - // !wm.TryGetTestData(arguments[3], out lnaAdjustTestData) || - // !UInt16.TryParse(arguments[4], out lnaFactorLimitLo) || lnaFactorLimitLo <= 0 && - // !UInt16.TryParse(arguments[5], out lnaFactorLimitHi) || lnaFactorLimitHi <= 0) - // { - // return CommErr.WrongArguments; - // } - // else - // { - // adjustTestRslt = GetAverageTestRslt(wm, adjustTestData); - // lnaAdjustTestRslt = GetAverageTestRslt(wm, lnaAdjustTestData); - // - // if ((adjustTestRslt == null) || (lnaAdjustTestRslt == null)) - // { - // return CommErr.MissingTest; - // } - // - // newCalibFactor = ihead.CalculateNewCalibFactor(adjustTestRslt, ihead.CalibFactor, factorLimitLo, factorLimitHi); - // newCalibFactorLNA = ihead.CalculateNewCalibFactor(lnaAdjustTestRslt, ihead.CalibFactorLNA, lnaFactorLimitLo, lnaFactorLimitHi); - // } - // } - // else if (arguments.Length == 4) - // { - // if (!wm.TryGetTestData(arguments[0], out adjustTestData) || - // !wm.TryGetTestData(arguments[1], out lnaAdjustTestData) || - // !UInt16.TryParse(arguments[2], out lnaFactorLimitLo) || lnaFactorLimitLo <= 0 && - // !UInt16.TryParse(arguments[3], out lnaFactorLimitHi) || lnaFactorLimitHi <= 0) - // { - // return CommErr.WrongArguments; - // } - // else - // { - // factorLimitLo = ihead.FactorLimitLo; - // factorLimitHi = ihead.FactorLimitHi; - // - // adjustTestRslt = GetAverageTestRslt(wm, adjustTestData); - // lnaAdjustTestRslt = GetAverageTestRslt(wm, lnaAdjustTestData); - // - // if ((adjustTestRslt == null) || (lnaAdjustTestRslt == null)) - // { - // return CommErr.MissingTest; - // } - // - // newCalibFactor = ihead.CalculateNewCalibFactor(adjustTestRslt, ihead.CalibFactor, factorLimitLo, factorLimitHi); - // newCalibFactorLNA = ihead.CalculateNewCalibFactor(lnaAdjustTestRslt, ihead.CalibFactorLNA, lnaFactorLimitLo, lnaFactorLimitHi); - // } - // } - // else if (arguments.Length == 2) - // { - // if (!wm.TryGetTestData(arguments[0], out adjustTestData) || - // !wm.TryGetTestData(arguments[1], out lnaAdjustTestData)) - // { - // return CommErr.WrongArguments; - // } - // else - // { - // factorLimitLo = ihead.FactorLimitLo; - // factorLimitHi = ihead.FactorLimitHi; - // lnaFactorLimitLo = ihead.FactorLimitLo; - // lnaFactorLimitHi = ihead.FactorLimitHi; - // - // adjustTestRslt = GetAverageTestRslt(wm, adjustTestData); - // lnaAdjustTestRslt = GetAverageTestRslt(wm, lnaAdjustTestData); - // - // if ((adjustTestRslt == null) || (lnaAdjustTestRslt == null)) - // { - // return CommErr.MissingTest; - // } - // - // newCalibFactor = ihead.CalculateNewCalibFactor(adjustTestRslt, ihead.CalibFactor, factorLimitLo, factorLimitHi); - // newCalibFactorLNA = ihead.CalculateNewCalibFactor(lnaAdjustTestRslt, ihead.CalibFactorLNA, lnaFactorLimitLo, lnaFactorLimitHi); - // } - // } - // else - // { - // return CommErr.WrongArguments; - // } - // } - // else - // { - // return CommErr.WrongArguments; - // } - // - // if (newCalibFactor == 0 || newCalibFactorLNA == 0) return CommErr.OutOfRange; - // - // /// - // /// Start communication with iPerl - // /// - // CommErr error; - // byte[] data = new byte[2] { (byte)(newCalibFactor & 0x00FF), (byte)((newCalibFactor >> 8) & 0x00FF) }; - // byte[] dataLNA = new byte[2] { (byte)(newCalibFactorLNA & 0x00FF), (byte)((newCalibFactorLNA >> 8) & 0x00FF) }; - // /// - // /// Write the new calibration factor (up to cfg.MaxCommRetries tims) - // /// - // error = CommErr.Write; - // if (0 == WriteRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, data) && - // 0 == WriteRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 34, 2, dataLNA)) - // { - // /// - // /// Read and verify the calibration factor - // /// - // error = CommErr.ReadAfterWrite; - // byte[] calib_2_3 = null; - // byte[] calib_34_35 = null; - // if (0 == ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, out calib_2_3) && - // 0 == ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 34, 2, out calib_34_35)) - // { - // error = CommErr.Verify; - // if (calib_2_3 != null && calib_2_3.Length == 2 && data[0] == calib_2_3[0] && data[1] == calib_2_3[1] && - // calib_34_35 != null && calib_34_35.Length == 2 && dataLNA[0] == calib_34_35[0] && dataLNA[1] == calib_34_35[1]) - // { - // error = CommErr.None; - // ihead.CalibrationStructV4.Update(data, 2); - // ihead.CalibrationStructV4.Update(dataLNA, 34); - // wm.CalibFactor = newCalibFactor; - // wm.CalibFactorLNA = newCalibFactorLNA; - // resultStr = ihead.CalibrationStructV4.ToString(); - // } - // } - // } - // - // ihead.CalibrationStructV4.Update(data, 2); - // ihead.CalibrationStructV4.Update(dataLNA, 34); - // - // return error; - // } - - - /// - /// Get averaged meter test result using test name and repetitions from a given test data. - /// - /// Water meter - /// TestData (name and repetitions) - /// (1) selected MeterTestRslt or (2) average of repeated MTR-s or (3) null when at least one MTR is missing - static Results.Entities.MeterTestRslt GetAverageTestRslt(WaterMeter wm, Results.Entities.TestData testData) - { - Results.Entities.MeterTestRslt avgTestRslt; - - if (testData.Repeats > 1) - { - /// Calculate a summarized test result if Repeats > 1 - avgTestRslt = new Results.Entities.MeterTestRslt(); - for (int i = 1; i <= testData.Repeats; i++) - { - Results.Entities.MeterTestRslt oneMTR = wm.GetMeterTestRslt(Utils.TestTitle(testData, i)); - if (oneMTR == null || !oneMTR.TestDone) return null; - - avgTestRslt.VolumeMeter += oneMTR.VolumeMeter; - avgTestRslt.VolumeRef += oneMTR.VolumeRef; - } - } - else - { - avgTestRslt = wm.GetMeterTestRslt(Utils.TestTitle(testData, 1)); - if (avgTestRslt == null || !avgTestRslt.TestDone) return null; - } - - return avgTestRslt; - } - - /// - /// Normalize calibration factor in case ti is close to value 8000. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr NormalizeCalibrationFactor(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed || (ihead.CalibrationStruct == null)) return CommErr.CommFailed; - - if (ihead.FactorLimitLo <= ihead.CalibFactor && ihead.CalibFactor <= ihead.FactorLimitHi) - { - resultStr = "Calibration factor is OK"; - return CommErr.None; /// No need to update the calibration factor - } - - CommErr error = CommErr.Write; - - /// Determine the new calibration factor - UInt16 defaultCalibFactor; - switch (ihead.CalibrationStruct.MeterType) - { - case MeterType.DN15: - defaultCalibFactor = 2710; - break; - case MeterType.DN20: - defaultCalibFactor = 3746; - break; - case MeterType.DN25: - defaultCalibFactor = 3300; - break; - case MeterType.DN32: - defaultCalibFactor = 2500; - break; - case MeterType.DN40: - defaultCalibFactor = 3080; - break; - case MeterType.DN25_Q3_10: - case MeterType.CoaxManifold: - default: - defaultCalibFactor = 3040; - break; - } - - byte[] data = new byte[2] { (byte)(defaultCalibFactor & 0x00FF), (byte)((defaultCalibFactor >> 8) & 0x00FF) }; - if (0 == WriteRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, data)) - { - error = CommErr.None; - ihead.CalibrationStruct.Update(data, 2); - } - - if (error == CommErr.None) - { - error = CommErr.Verify; - - /// Read calibration - byte[] calib_2_3 = null; - if (0 == ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, out calib_2_3)) - { - error = CommErr.None; - ihead.CalibrationStruct.Update(calib_2_3, 2); - resultStr = ihead.CalibrationStruct.ToString(); - } - } - - return error; - } - - - /// - /// Normalize calibration factor in case ti is close to value 8000. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr NormalizeCalibrationV4Factors(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed || (ihead.CalibrationStructV4 == null)) return CommErr.CommFailed; - - if (ihead.FactorLimitLo <= ihead.CalibFactor && ihead.CalibFactor <= ihead.FactorLimitHi) - { - resultStr = "Calibratin factor is OK"; - return CommErr.None; /// No need to update the calibration factor - } - - CommErr error = CommErr.Write; - - /// Determine the new calibration factor - UInt16 defaultCalibFactor; - switch (ihead.CalibrationStructV4.MeterType) - { - case MeterType.DN15: - defaultCalibFactor = 2710; - break; - case MeterType.DN20: - defaultCalibFactor = 3746; - break; - case MeterType.DN25: - defaultCalibFactor = 3300; - break; - case MeterType.DN32: - defaultCalibFactor = 2500; - break; - case MeterType.DN40: - defaultCalibFactor = 3080; - break; - case MeterType.DN25_Q3_10: - case MeterType.CoaxManifold: - default: - defaultCalibFactor = 3040; - break; - } - - byte[] data = new byte[2] { (byte)(defaultCalibFactor & 0x00FF), (byte)((defaultCalibFactor >> 8) & 0x00FF) }; - if (0 == WriteRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, data)) - { - error = CommErr.None; - ihead.CalibrationStructV4.Update(data, 2); - } - - if (error == CommErr.None) - { - error = CommErr.Verify; - - /// Read calibration - byte[] calib_2_3 = null; - if (0 == ReadRequestPort(ihead, MessageID.Calibration, StructName.Calibration, 2, 2, out calib_2_3)) - { - error = CommErr.None; - ihead.CalibrationStructV4.Update(calib_2_3, 2); - resultStr = ihead.CalibrationStructV4.ToString(); - } - } - - return error; - } - + + /// /// Reset both Q2 correction factors in the memory to 0. @@ -1835,74 +1392,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication return error; } - - /// - /// Reset both Q2 correction factors to 0. - /// Read them back to verify factors were written correctly. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr ResetQ2Correction(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, 0, 0); - } - - /// - /// Set both Q2 correction factors to default values obtained by a REST service - /// Read them back to verify factors were written correctly. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr WriteDefaultQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed) return CommErr.CommFailed; - - if (ProcessData.IsQ2PreCorrectionCalculated) - { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, ProcessData.CalculatedQ2PreCorrectionLR, - ProcessData.CalculatedQ2PreCorrectionRL); - } - else - { - int q2corrRL; - int q2corrLR; - switch (ihead.MeterType) - { - case MeterType.DN15: - q2corrRL = cfg.DfltQ2c_15_rl; - q2corrLR = cfg.DfltQ2c_15_lr; - break; - case MeterType.DN20: - q2corrRL = cfg.DfltQ2c_20_rl; - q2corrLR = cfg.DfltQ2c_20_lr; - break; - case MeterType.DN25: - q2corrRL = cfg.DfltQ2c_25_63_rl; - q2corrLR = cfg.DfltQ2c_25_63_lr; - break; - case MeterType.DN25_Q3_10: - q2corrRL = cfg.DfltQ2c_25_10_rl; - q2corrLR = cfg.DfltQ2c_25_10_lr; - break; - case MeterType.DN32: - q2corrRL = cfg.DfltQ2c_32_rl; - q2corrLR = cfg.DfltQ2c_32_lr; - break; - case MeterType.DN40: - q2corrRL = cfg.DfltQ2c_40_rl; - q2corrLR = cfg.DfltQ2c_40_lr; - break; - default: - q2corrRL = 0; - q2corrLR = 0; - break; - } - - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, q2corrLR, q2corrRL); - } - } + /// /// Write both Q2 correction factors to given values. @@ -1954,768 +1444,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication return error; } - - - static CommErr InitOrReadQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed) return CommErr.CommFailed; - if (wm.Pruefindex == 0) return CommErr.CommFailed; /// Unknown pruefindex - - if (wm.Pruefindex == 1) - { - int q2corrRL; - int q2corrLR; - if (ProcessData.IsQ2PreCorrectionCalculated) - { - q2corrRL = ProcessData.CalculatedQ2PreCorrectionRL; - q2corrLR = ProcessData.CalculatedQ2PreCorrectionLR; - } - else - { - switch (ihead.MeterType) - { - case MeterType.DN15: - q2corrRL = cfg.DfltQ2c_15_rl; - q2corrLR = cfg.DfltQ2c_15_lr; - break; - case MeterType.DN20: - q2corrRL = cfg.DfltQ2c_20_rl; - q2corrLR = cfg.DfltQ2c_20_lr; - break; - case MeterType.DN25: - q2corrRL = cfg.DfltQ2c_25_63_rl; - q2corrLR = cfg.DfltQ2c_25_63_lr; - break; - case MeterType.DN25_Q3_10: - q2corrRL = cfg.DfltQ2c_25_10_rl; - q2corrLR = cfg.DfltQ2c_25_10_lr; - break; - case MeterType.DN32: - q2corrRL = cfg.DfltQ2c_32_rl; - q2corrLR = cfg.DfltQ2c_32_lr; - break; - case MeterType.DN40: - q2corrRL = cfg.DfltQ2c_40_rl; - q2corrLR = cfg.DfltQ2c_40_lr; - break; - default: - q2corrRL = 0; - q2corrLR = 0; - break; - } - } - - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, q2corrLR, q2corrRL); - } - else - { - return ReadQ2Correction(threadId, ihead, wm, ref resultStr); - } - } - - - /// - /// Reset 2Hz correction factor in the memory to 0. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr Reset2HzCorrection(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed) return CommErr.CommFailed; - - CommErr error = CommErr.Write; - - /// Write zero Q2 correction - byte[] wrData = new byte[1] { 0 }; - /// - if (0 == WriteRequestPort(ihead, MessageID.MetrologyMemory, StructName.ProductionInfo, Hz2CorrFactorsAddr, wrData.Length, wrData)) - { - error = CommErr.None; - } - - /// - /// Verification disabled on 16.02.2016 - /// -#if false - /// Verify the correction factors - if (error == CommErr.None) - { - error = CommErr.Verify; - - /// Read calibration - byte[] rdData = null; - if ((0 == ReadRequestPort(threadId, ihead, MessageID.MetrologyMemory, Hz2CorrFactorsAddr, 1, out rdData)) && - (rdData != null) && (rdData.Length == 2) && (rdData[0] == 0) && (rdData[1] == 0)) - { - error = CommErr.None; - resultStr = "2Hz correction reset to 0"; - ihead.Q2CorrectionFactor = 0; - } - } -#else - if (error == CommErr.None) - { - resultStr = "2Hz correction reset to 0"; - ihead.Hz2Correction = 0; - } -#endif - - return error; - } - - - /// - /// Write the calculated Q2 correction factors to the memory. - /// Read them back to verify factors were written correctly. - /// - /// Write Q2 correction - /// Write Q2 correction Alt - /// Write Q2 correction [Greece | R-L | L-R] testname - /// Update Q2 corrections - /// Conditional update of Q2 corrections - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr CalculateAndWriteQ2Corrections(int threadId, IperlHead ihead, WaterMeter wm, - Test test, ref string resultStr, Q2CorrType q2CorrType, string restOfLine) - { - var args = string.IsNullOrEmpty(restOfLine) ? new string[0] : restOfLine.Split(new char[] { ' ' }); - - Results.Entities.MeterTestRslt q2adjResult; /// The only test or the 1st test (the test in R-L direction) - Results.Entities.TestData q2adjTestData; /// The 2nd test in L-R direction in case tests in both directions are done - /// - if (args.Length == 0) - { - /// In case of no test name argument, ihead.LastTestResult is used (if it exists) - if (ihead.LastTestResult == null || !ihead.LastTestResult.TestDone) return CommErr.MissingTest; - q2adjResult = ihead.LastTestResult; - q2adjTestData = q2adjResult.TestRslt.TestData; - } - else // if (args.Length >= 1) - { - /// Get test data from (the 1st) test name - q2adjTestData = wm.GetTestData(args[0]); - if (q2adjTestData == null) return CommErr.MissingTest; - - if (q2adjTestData.Repeats == 1) - { - /// Find a test result if Repets == 1 - q2adjResult = wm.GetMeterTestRslt(args[0]); - if (q2adjResult == null || !q2adjResult.TestDone) return CommErr.MissingTest; - } - else - { - /// Calculate a summarized test result if Repeats > 1 - q2adjResult = new Results.Entities.MeterTestRslt(); - for (int i = 1; i <= q2adjTestData.Repeats; i++) - { - Results.Entities.MeterTestRslt oneMTR = wm.GetMeterTestRslt(string.Format("{0} ({1}/{2})", args[0], i, q2adjTestData.Repeats)); - if (oneMTR == null || !oneMTR.TestDone) return CommErr.MissingTest; - - q2adjResult.VolumeMeter += oneMTR.VolumeMeter; - q2adjResult.VolumeRef += oneMTR.VolumeRef; - - if (i == 1) - { - q2adjResult.CalibFactor = oneMTR.CalibFactor; - q2adjResult.CalibFactorLNA = oneMTR.CalibFactorLNA; - q2adjResult.Q2CorrRL = oneMTR.Q2CorrRL; - q2adjResult.Q2CorrLR = oneMTR.Q2CorrLR; - } - } - - q2adjResult.Error = Config.Formulas.ErrorFromVolumes(q2adjResult.VolumeMeter, q2adjResult.VolumeRef); - } - } - - var q3mtr = wm.MeterTestRslts.FirstOrDefault(x => x.Name() == "Q3"); - double q3error = (q3mtr != null) ? q3mtr.Error : 0; - - Results.Entities.MeterTestRslt q2adjResult2 = null; /// 2nd test name for a test in L-R direction - Results.Entities.TestData q2adjTestData2 = null; - /// - if (args.Length >= 2) - { - /// Get the 2nd test data from the 2nd test name - q2adjTestData2 = wm.GetTestData(args[1]); - if (q2adjTestData2 == null) return CommErr.MissingTest; - - if (q2adjTestData2.Repeats == 1) - { - /// Find a test result if Repets == 1 - q2adjResult2 = wm.GetMeterTestRslt(args[1]); - if (q2adjResult2 == null || !q2adjResult2.TestDone) return CommErr.MissingTest; - } - else - { - /// Calculate a summarized test result if Repeats > 1 - q2adjResult2 = new Results.Entities.MeterTestRslt(); - for (int i = 1; i <= q2adjTestData2.Repeats; i++) - { - Results.Entities.MeterTestRslt oneMTR = wm.GetMeterTestRslt(string.Format("{0} ({1}/{2})", args[1], i, q2adjTestData2.Repeats)); - if (oneMTR == null || !oneMTR.TestDone) return CommErr.MissingTest; - - q2adjResult2.VolumeMeter += oneMTR.VolumeMeter; - q2adjResult2.VolumeRef += oneMTR.VolumeRef; - - if (i == 1) - { - q2adjResult2.CalibFactor = oneMTR.CalibFactor; - q2adjResult2.CalibFactorLNA = oneMTR.CalibFactorLNA; - q2adjResult2.Q2CorrRL = oneMTR.Q2CorrRL; - q2adjResult2.Q2CorrLR = oneMTR.Q2CorrLR; - } - } - - q2adjResult2.Error = Config.Formulas.ErrorFromVolumes(q2adjResult2.VolumeMeter, q2adjResult2.VolumeRef); - } - } - - - if (q2adjResult == null || - ((q2CorrType == Q2CorrType.Update || q2CorrType == Q2CorrType.ConditionalUpdate) && q2adjResult2 == null)) - { - return CommErr.MissingTest; /// Procedure configuration error - } - - - if ((q2CorrType == Q2CorrType.ConditionalUpdate || - q2CorrType == Q2CorrType.ConditionalUpdateRL || - q2CorrType == Q2CorrType.ConditionalUpdateLR) && wm.PassedFromTests()) - { - resultStr = string.Format("No Q2 correction update"); - rfidDataLogger.InfoFormat("{0}({1}): No Q2 correction update", ihead.Name, ihead.SerialNr); - return CommErr.None; /// No Q2 correction when doing conditional update and WM passed - } - - double errLimitLo = test.ErrLimLo + test.Uncertainty; - double errLimitHi = test.ErrLimHi - test.Uncertainty; - - /// - /// Calculate Q2 correction factor(s) - /// - int q2CorrRL = 0; - int q2CorrLR = 0; - /// - if (q2CorrType == Q2CorrType.Standard || - q2CorrType == Q2CorrType.Standard_incl_05 || - q2CorrType == Q2CorrType.Standard_plus_incl_05) - { - /// - /// Standard process (RL) - /// No 2nd Q2 test, MakeQ2CorrectedFrom(...) is used to calculate Q2 error - /// Do not forget to modify iPerlCommunicationSeq.MakeQ2CorrectedFrom(...) - /// - double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error); - q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom, errorTarget)))); - } - else if (q2CorrType == Q2CorrType.Dewa || - q2CorrType == Q2CorrType.Dewa_incl_05 || - q2CorrType == Q2CorrType.Dewa_plus_incl_05) - { - /// - /// Standard process for the oposite flow direction (LR) - /// No 2nd Q2 test, MakeQ2CorrectedFrom(...) is used to calculate Q2 error - /// Do not forget to modify iPerlCommunicationSeq.MakeQ2CorrectedFrom(...) - /// - double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error); - q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom, errorTarget)))); - } - else if (q2CorrType == Q2CorrType.RL || - q2CorrType == Q2CorrType.RL_incl_05 || - q2CorrType == Q2CorrType.ConditionalUpdateRL) - { - /// - /// RL only - /// Assuming the 2nd Q2 test is done afterwards - /// MakeQ2CorrectedFrom(...) is not used - /// - if (q2CorrType == Q2CorrType.RL && Math.Abs(q2adjResult.Error) <= 0.5) - { - resultStr = string.Format("Q2 correction = 0 (writing bypassed)"); - return CommErr.None; - } - - q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom)))); - } - else if (q2CorrType == Q2CorrType.LR || - q2CorrType == Q2CorrType.LR_incl_05 || - q2CorrType == Q2CorrType.ConditionalUpdateLR) - { - /// - /// LR only - /// Assuming the 2nd Q2 test is done afterwards - /// MakeQ2CorrectedFrom(...) is not used - /// - if (q2CorrType == Q2CorrType.LR && Math.Abs(q2adjResult.Error) <= 0.5) - { - resultStr = string.Format("Q2 correction = 0 (writing bypassed)"); - return CommErr.None; - } - - q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom)))); - } - else if (q2CorrType == Q2CorrType.Update || q2CorrType == Q2CorrType.ConditionalUpdate) - { - /// - /// After tests in both directions - /// Assuming the 2nd Q2 tests are done afterwards - /// MakeQ2CorrectedFrom(...) is not used - /// - q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom)))); - q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult2, q2adjResult2.Q2CorrLR, q2adjTestData2.Qfrom)))); - } - else if (q2CorrType == Q2CorrType.Greece || q2CorrType == Q2CorrType.Greece_incl_05 || q2CorrType == Q2CorrType.UpdateBothQ2FactorsTestLRDir) - { - /// - /// Process for Greece - /// - if (q2CorrType == Q2CorrType.Greece && Math.Abs(q2adjResult.Error) <= 0.5) - { - resultStr = string.Format("Q2 correction = 0 (writing bypassed)"); - return CommErr.None; - } - - q2CorrLR = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrLR, q2adjTestData.Qfrom)))); - q2CorrRL = q2CorrLR; - } - else if (q2CorrType == Q2CorrType.UpdateBothQ2FactorsTestRLDir) - { - /// - /// Another strange process - /// - double errorTarget = (q3error * q2adjResult.Error < 0) ? (0.1 * q2adjResult.Error) : (-0.1 * q2adjResult.Error); - q2CorrRL = Math.Max(-128, Math.Min(127, Convert.ToInt32(ihead.CalculateQ2CorrectionFactor(q2adjResult, q2adjResult.Q2CorrRL, q2adjTestData.Qfrom, errorTarget)))); - q2CorrLR = q2CorrRL; - } - - - /// - /// Write calculated Q2 correction factors into the water meter - /// - if (ihead.CommFailed) return CommErr.CommFailed; - - CommErr error = CommErr.Write; - - if (q2CorrType == Q2CorrType.Standard || - q2CorrType == Q2CorrType.Standard_incl_05 || - q2CorrType == Q2CorrType.Standard_plus_incl_05 || - q2CorrType == Q2CorrType.RL || - q2CorrType == Q2CorrType.RL_incl_05 || - q2CorrType == Q2CorrType.ConditionalUpdateRL) - { - /// - /// Write R-L Q2 correction factor only - /// - byte[] wrData = new byte[1] { (byte)q2CorrRL }; - if (0 == WriteRequestPort(ihead, MessageID.MetrologyMemory, StructName.ProductionInfo, Q2CorrFactorsAddrRL, wrData.Length, wrData)) - { - wm.Q2CorrRL = ihead.Q2CorrRL = q2CorrRL; - resultStr = string.Format("Q2 correction: RL={0}", q2CorrRL); - error = CommErr.None; - } - } - else if (q2CorrType == Q2CorrType.Dewa || - q2CorrType == Q2CorrType.Dewa_incl_05 || - q2CorrType == Q2CorrType.Dewa_plus_incl_05 || - q2CorrType == Q2CorrType.LR || - q2CorrType == Q2CorrType.LR_incl_05 || - q2CorrType == Q2CorrType.ConditionalUpdateLR) - { - /// - /// Write L-R Q2 correction factor only - /// - byte[] wrData = new byte[1] { (byte)q2CorrLR }; - if (0 == WriteRequestPort(ihead, MessageID.MetrologyMemory, StructName.ProductionInfo, Q2CorrFactorsAddrLR, wrData.Length, wrData)) - { - wm.Q2CorrLR = ihead.Q2CorrLR = q2CorrLR; - resultStr = string.Format("Q2 correction: LR={0}", q2CorrLR); - error = CommErr.None; - } - } - else - { - /// - /// Write both Q2 correction factors - /// - byte[] wrData = new byte[2] { (byte)q2CorrLR, (byte)q2CorrRL }; - if (0 == WriteRequestPort(ihead, MessageID.MetrologyMemory, StructName.ProductionInfo, Q2CorrFactorsAddr, wrData.Length, wrData)) - { - wm.Q2CorrRL = ihead.Q2CorrRL = q2CorrRL; - wm.Q2CorrLR = ihead.Q2CorrLR = q2CorrLR; - resultStr = string.Format("Q2 correction: RL={0}, LR={1}", q2CorrRL, q2CorrLR); - error = CommErr.None; - } - } - - - /// - /// Q2 correction factor was successfully written to the water meter. - /// Check whether the original error at Q2 was within limits. - /// - if (error == CommErr.None && - (q2adjResult.Error < errLimitLo || errLimitHi < q2adjResult.Error || - (q2adjResult2 != null && (q2adjResult2.Error < errLimitLo || errLimitHi < q2adjResult2.Error)))) - { - resultStr += " (OoR)"; - - /// At least one of Q2 errors is out of range for Q2 correction - log.WarnFormat("OoR => anyhow Q2 correction was done: Pos={0}, PCB#={1}, ***Q2_RL err={2}%***, ***Q2_LR err={3}%***, [Lo={4}%, Hi={5}%]", - ihead.Name, - ihead.SerialNr, - q2adjResult.Error.ToString("F2"), - q2adjResult2 != null ? q2adjResult2.Error.ToString("F2") : string.Empty, - errLimitLo.ToString("F2"), - errLimitHi.ToString("F2")); - - rfidDataLogger.InfoFormat("{0}({1}): Q2 error ({2},{3}) is out of range ({4}..{5}) => Failed", - ihead.Name, - ihead.SerialNr, - q2adjResult.Error.ToString("F2"), - q2adjResult2 != null ? q2adjResult2.Error.ToString("F2") : string.Empty, - errLimitLo.ToString("F2"), - errLimitHi.ToString("F2")); - - error = CommErr.Q2OutOfRange; - } - - /// - /// Verification disabled on 16.02.2016 - /// -#if false - if (error == CommErr.None) - { - error = CommErr.Verify; - - /// Read calibration - byte[] rdData = null; - if ((0 == ReadRequestPort(threadId, ihead, MessageID.MetrologyMemory, Q2CorrFactorsAddr, 2, out rdData)) && - (rdData != null) && (rdData.Length == 2) && (rdData[0] == q2CorrRFlow) && (rdData[1] == q2CorrLFlow)) - { - error = CommErr.None; - resultStr = string.Format("Q2 factors: R-flow={0}, L-flow={1}", (SByte)q2CorrRFlow, (SByte)q2CorrLFlow); - rfidDataLogger.Warn(ihead.Name + ": " + resultStr); - - wm.Q2ErrWOCorrection = ihead.Q2ErrorWOCorrection; - if (q2CorrType != Q2CorrType.LR) wm.Q2CorrRFlow = ihead.Q2CorrRFlow = (int)(sbyte)q2CorrRFlow; - if (q2CorrType != Q2CorrType.RL) wm.Q2CorrLFlow = ihead.Q2CorrLFlow = (int)(sbyte)q2CorrLFlow; - } - } -#else - - if ((q2CorrType != Q2CorrType.Update) && (q2CorrType != Q2CorrType.ConditionalUpdate)) - { - wm.Q2ErrWOCorrection = ihead.Q2ErrWOCorrection = q2adjResult.Error; - } - - /// - /// Update WaterMeter entity and IperlHead - /// - if (error == CommErr.None) - { - rfidDataLogger.WarnFormat("{0}({1}): {2}", ihead.Name, ihead.SerialNr, resultStr); - } -#endif - - return error; - } - - - /// - /// Write the calculated 2Hz correction factor to the memory. - /// - /// Water meter object - /// String passed to caller - /// true on success - static CommErr Write2HzCorrection(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - { - if (ihead.CommFailed) return CommErr.CommFailed; - - /// Calculate the correction - ihead.Hz2CorrectionDone = false; - int hz2CorrectionFactor; - bool wmOK = ihead.Calculate2HzCorrectionFactor(ihead.LastTestResult2, ihead.LastTestResult, out ihead.Diff2Hz8Hz, out hz2CorrectionFactor); - - if (hz2CorrectionFactor == 0) - { - resultStr = string.Format("2Hz correction = 0 (writing bypassed)"); - return CommErr.None; - } - - CommErr error = CommErr.Write; - - Byte hz2CorrectionByte = (byte)(hz2CorrectionFactor & 0x000000FF); - byte[] wrData = new byte[1] { hz2CorrectionByte }; - /// - if (0 == WriteRequestPort(ihead, MessageID.MetrologyMemory, StructName.ProductionInfo, Hz2CorrFactorsAddr, wrData.Length, wrData)) - { - error = CommErr.None; - wm.Hz2Correction = ihead.Hz2Correction = hz2CorrectionFactor; - wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone = true; - } - - /// - /// Verification disabled on 16.02.2016 - /// -#if false - if (error == CommErr.None) - { - error = CommErr.Verify; - - /// Read calibration - byte[] rdData = null; - if ((0 == ReadRequestPort(wm, MessageID.MetrologyMemory, Hz2CorrFactorsAddr, 1, out rdData)) && - (rdData != null) && (rdData.Length == 2) && (rdData[0] == hz2CorrectionByte)) - { - error = CommErr.None; - resultStr = string.Format("2Hz factor = {0}", (SByte)hz2CorrectionByte); - rfidDataLogger.Warn(ihead.Name + ": " + resultStr); - wm.Hz2Correction = ihead.Hz2CorrectionFactor = hz2CorrectionFactor; - wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz; - wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone; - } - } -#else - if (error == CommErr.None) - { - resultStr = string.Format("2Hz correction = {0}", (SByte)hz2CorrectionByte); - rfidDataLogger.Warn(ihead.Name + ": " + resultStr); - wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz; - wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone = true; - wm.Hz2Correction = ihead.Hz2Correction = hz2CorrectionFactor; - } -#endif - - return error; - } - - /// - /// DEWA rework. - /// - /// iPERL head object - /// Water meter object - /// Arrow direction - /// String passed to caller - /// true on success - // static CommErr DewaRework(IperlHead ihead, WaterMeter wm, FlowDir flowDir, ref string resultStr) - // { - // if (ihead.CommFailed) return CommErr.CommFailed; - // - // byte arrow = (flowDir == FlowDir.L_R) ? (byte)1 : (byte)2; /// L-R is reverse flow (=1), R-L is forward flow (=2)(default) - // - // List dataToBeWritten = new List - // { - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 33:0x19A1, new byte[] { (byte)0xA5 }, "Open Sealing"), // ????? - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 5:0x1985, new byte[] { arrow }, "Arrow"), - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 28:0x199C, new byte[5], "Clear S/N"), - // new iPerlDataWrite(MessageID.Configuration, StructName.Configuration, 0x0015, new byte[] { (byte)0xA0 }, "Test mode config = A0"), - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 14:0x198E, new byte[] { (byte)(2510 & 0xFF), (byte)((2510 >> 8) & 0xFF) }, "Receipt mean current") - // }; - // - // // check meter status: 1-Idle, 2-Active, 3-Test, 4-End Of Life - // if (0 == ReadRequestPort(ihead, MessageID.Configuration, StructName.Configuration, 1, 1, out byte[] rdData)) - // { - // int eMeterState = (int)((SByte)rdData[0]); - // switch (eMeterState) - // { - // case 1: // Idle -> Test -> Active - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.Command, StructName.Command, 0x0000, new byte[] { (byte)Command.SetTestMode }, "Set test mode")); - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.Command, StructName.Command, 0x0000, new byte[] { (byte)Command.SetActiveMode }, "Set active mode")); - // break; - // case 3: // Test Mode -> Active - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.Command, StructName.Command, 0x0000, new byte[] { (byte)Command.SetActiveMode }, "Set active mode")); - // break; - // } - // } - // - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.RadioPassthrough, StructName.RadioInfo, 0x1804, new byte[] { (byte)1 }, "System Status")); - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.RadioPassthrough, StructName.RadioParams, 0x1898, new byte[] { (byte)3 }, "WakeUpInterval")); - // dataToBeWritten.Add(new iPerlDataWrite(MessageID.RadioPassthrough, StructName.RadioParams, 0x18A2, new byte[] { (byte)0x4A, (byte)0x53, (byte)0x3B, (byte)0x8F, - // (byte)0x70, (byte)0x31, (byte)0xC2, (byte)0x5D, - // (byte)0x6F, (byte)0x2D, (byte)0xE8, (byte)0x07, - // (byte)0x6E, (byte)0x0F, (byte)0x97, (byte)0xC3, }, "AES Key Crypted")); - // - // int successfyllyWrittenFlags = 0; /// Ones in this word represent communication failures, LSB represents the first step - // int mask = 1; - // foreach (var wData in dataToBeWritten) - // { - // bool isSuccessfullyWritten = false; - // if (0 == WriteRequestPort(ihead, wData.MessageID, wData.StructName, wData.Offset, wData.Data.Length, wData.Data)) - // { - // isSuccessfullyWritten = true; - // } - // - // if (!isSuccessfullyWritten) - // { - // /// Communication failed in this step - // successfyllyWrittenFlags = (successfyllyWrittenFlags | mask); - // } - // - // mask = (mask << 1); /// Adjust the mask for the next step - // } - // - // if (successfyllyWrittenFlags == 0) - // { - // /// Success - // if (ihead.ConfigStruct != null) - // { - // ihead.ConfigStruct.StatusMode = ProtocolStatuses.Active; - // ihead.ConfigStruct.OpthoStatusMode = DiagnosticLedState.State4; - // } - // - // resultStr = "OK"; - // return CommErr.None; - // } - // else - // { - // return CommErr.Write; - // } - // } - - /// - /// Start testing a sealed meter - /// - /// iPERL head object - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr StartTestingSealedMeter(IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed) return CommErr.CommFailed; - // - // Byte testModeConfig = 0xA0; /// Default value - // /// - // if (multiTestParams[currentActivityStep].Activity.Length > StartTestingSealedMetersStr.Length) - // { - // string testModeConfigStr = multiTestParams[currentActivityStep].Activity.Substring(StartTestingSealedMetersStr.Length + 1); - // UInt16 byteVal; - // if (UInt16.TryParse(testModeConfigStr, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out byteVal) && byteVal <= 255) - // { - // testModeConfig = (Byte)byteVal; /// Update with specified value - // } - // } - // - // iPerlDataWrite[] dataToBeWritten = new iPerlDataWrite[] - // { - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 33:0x19A1, new byte[] { (byte)0xA5 }, "Open Sealing"), /// 0x5A=sealed, 0xA5=unsealed ?????? - // new iPerlDataWrite(MessageID.RadioPassthrough, StructName.RadioInfo, 0x1804, new byte[] { (byte)1 }, "System Status"), - // new iPerlDataWrite(MessageID.Command, StructName.Command, 0x0000, new byte[] { (byte)Command.SetActiveMode }, "Set active mode"), - // new iPerlDataWrite(MessageID.Configuration, StructName.Configuration, 0x0015, new byte[] { testModeConfig }, string.Format("Test mode config = {0:X2}", testModeConfig)), - // }; - // - // if (ihead.ConfigStruct != null) ihead.OrigTestModeConfig = ihead.ConfigStruct.TestModeConfig; - // - // int successfyllyWrittenFlags = 0; /// Ones in this word represent communication failures, LSB represents the first step - // int mask = 1; - // foreach (var wData in dataToBeWritten) - // { - // bool isSuccessfullyWritten = false; - // if (0 == WriteRequestPort(ihead, wData.MessageID, wData.StructName, wData.Offset, wData.Data.Length, wData.Data)) - // { - // isSuccessfullyWritten = true; - // } - // - // if (!isSuccessfullyWritten) - // { - // /// Communication failed in this step - // successfyllyWrittenFlags = (successfyllyWrittenFlags | mask); - // } - // - // mask = (mask << 1); /// Adjust the mask for the next step - // } - // - // if (successfyllyWrittenFlags == 0) - // { - // /// Success - // if (ihead.ConfigStruct != null) - // { - // ihead.ConfigStruct.MeterState = MeterState.Active; - // ihead.ConfigStruct.TestModeConfig = (byte)0xA0; - // } - // - // resultStr = "OK"; - // return CommErr.None; - // } - // else - // { - // return CommErr.Write; - // } - // } - - /// - /// End testing a sealed meter - /// - /// iPERL head object - /// Water meter object - /// String passed to caller - /// true on success - // static CommErr EndTestingSealedMeter(IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (ihead.CommFailed) return CommErr.CommFailed; - // - // Byte testModeConfig = (ihead.OrigTestModeConfig != 0) ? ihead.OrigTestModeConfig : (byte)0x80; /// Restore original value (default is 0x80) - // - // iPerlDataWrite[] dataToBeWritten = new iPerlDataWrite[] - // { - // new iPerlDataWrite(MessageID.Command, StructName.Command, 0x0000, new byte[] { (byte)Command.SetActiveMode }, "Set active mode"), - // new iPerlDataWrite(MessageID.Configuration, StructName.Configuration, 0x0015, new byte[] { testModeConfig }, string.Format("Test mode config = {0:X2}", testModeConfig)), - // new iPerlDataWrite(MessageID.RadioPassthrough, StructName.RadioInfo, 0x1804, new byte[] { (byte)0 }, "System Status"), - // new iPerlDataWrite(MessageID.MetrologyMemory, StructName.Calibration, ihead.CommInterface == CommunicationInterface.NFC? 33:0x19A1, new byte[] { (byte)0x5A }, "Close Sealing") /// 0x5A=sealed, 0xA5=unsealed ?????? - // }; - // - // int successfyllyWrittenFlags = 0; /// Ones in this word represent communication failures, LSB represents the first step - // int mask = 1; - // foreach (var wData in dataToBeWritten) - // { - // bool isSuccessfullyWritten = false; - // if (0 == WriteRequestPort(ihead, wData.MessageID, wData.StructName, wData.Offset, wData.Data.Length, wData.Data)) - // { - // isSuccessfullyWritten = true; - // } - // - // if (!isSuccessfullyWritten) - // { - // /// Communication failed in this step - // successfyllyWrittenFlags = (successfyllyWrittenFlags | mask); - // } - // - // mask = (mask << 1); /// Adjust the mask for the next step - // } - // - // if (successfyllyWrittenFlags == 0) - // { - // /// Success - // if (ihead.ConfigStruct != null) - // { - // ihead.ConfigStruct.MeterState = MeterState.Active; - // ihead.ConfigStruct.TestModeConfig = (byte)0xA0; - // } - // - // resultStr = "OK"; - // return CommErr.None; - // } - // else - // { - // return CommErr.Write; - // } - // } - - // static CommErr GetQ2PreCorrectionsFormRest(int threadId, IperlHead ihead, WaterMeter wm, ref string resultStr) - // { - // if (!ProcessData.IsQ2PreCorrectionCalculated) - // { - // ProcessData.IsQ2PreCorrectionCalculated = true; - // /*bool success = iPerlCommunicationSeq.GetQ2PreCorrectionsOrBackups(cfg, wm.WMTypeId(), - // out ProcessData.CalculatedQ2PreCorrectionLR, - // out ProcessData.CalculatedQ2PreCorrectionRL);*/ - // } - // - // resultStr = string.Format("Q2 pre-corrections: LR={0} RL={1}", ProcessData.CalculatedQ2PreCorrectionLR, ProcessData.CalculatedQ2PreCorrectionRL); - // return CommErr.None; - // } - + + static CommErr SetIperlCommMilestoneReached(TestMethod testMethod, ConditionID id, ref string resultStr) { if (id < ConditionID.A || id >= ConditionID.Count) @@ -2862,15 +1592,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } - /// - /// Called when communication with all watermeters is completed - /// - public static void OnAllCompleted(object sender, AllCompletedEventArgs data) - { - if (AllCompletedHandler == null) return; - try { AllCompletedHandler(sender, data); } - catch (Exception e) { log.Error("AllCompletedHandler(...) failed", e); } - } + public static event EventHandler AllCompletedHandler; void DoOnAllCompleted(object sender, AllCompletedEventArgs data) diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll index 46fbfb2eb..61862ce0a 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll and b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.pdb b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.pdb index 821d979fe..1607e107d 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.pdb and b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll index c3e54f65d..216e4c483 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.pdb index 389b46128..d165d3a7c 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll index 279ef28d4..2e8dded91 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.pdb index 368369e04..f753a5462 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll index a589a166b..90e6ada91 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.pdb index 2ba467eb5..4ad515ef8 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll index 10bce610f..e2b95f57e 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.pdb index 63e3495ba..d095f208c 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol.pdb differ diff --git a/packages/Common/Xylem.Common.Logic.RelatePcb.dll b/packages/Common/Xylem.Common.Logic.RelatePcb.dll index d833280ac..f7aa03153 100644 Binary files a/packages/Common/Xylem.Common.Logic.RelatePcb.dll and b/packages/Common/Xylem.Common.Logic.RelatePcb.dll differ diff --git a/packages/Common/Xylem.Common.Logic.RelatePcb.pdb b/packages/Common/Xylem.Common.Logic.RelatePcb.pdb index cff931e61..930e3f1f4 100644 Binary files a/packages/Common/Xylem.Common.Logic.RelatePcb.pdb and b/packages/Common/Xylem.Common.Logic.RelatePcb.pdb differ diff --git a/packages/Common/Xylem.Common.Logic.ServiceCore.dll b/packages/Common/Xylem.Common.Logic.ServiceCore.dll index ae5cc6ef3..b129b274f 100644 Binary files a/packages/Common/Xylem.Common.Logic.ServiceCore.dll and b/packages/Common/Xylem.Common.Logic.ServiceCore.dll differ diff --git a/packages/Common/Xylem.Common.Logic.ServiceCore.pdb b/packages/Common/Xylem.Common.Logic.ServiceCore.pdb index ce4a62908..3afadcb63 100644 Binary files a/packages/Common/Xylem.Common.Logic.ServiceCore.pdb and b/packages/Common/Xylem.Common.Logic.ServiceCore.pdb differ diff --git a/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb b/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb index 3a3c157e4..2d7e41a63 100644 Binary files a/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb and b/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb differ diff --git a/packages/Common/Xylem.Common.Ui.GenesisToolBox.exe b/packages/Common/Xylem.Common.Ui.GenesisToolBox.exe index b61c33973..01ef89b4e 100644 Binary files a/packages/Common/Xylem.Common.Ui.GenesisToolBox.exe and b/packages/Common/Xylem.Common.Ui.GenesisToolBox.exe differ diff --git a/packages/Common/Xylem.Common.Ui.GenesisToolBox.pdb b/packages/Common/Xylem.Common.Ui.GenesisToolBox.pdb index 13ce19dfe..f0788e46f 100644 Binary files a/packages/Common/Xylem.Common.Ui.GenesisToolBox.pdb and b/packages/Common/Xylem.Common.Ui.GenesisToolBox.pdb differ diff --git a/packages/Common/XylemCommonUiLegacyGenCtl.dll b/packages/Common/XylemCommonUiLegacyGenCtl.dll index 89c59d866..8e8f5f8cf 100644 Binary files a/packages/Common/XylemCommonUiLegacyGenCtl.dll and b/packages/Common/XylemCommonUiLegacyGenCtl.dll differ diff --git a/packages/Common/XylemCommonUiLegacyGenCtl.pdb b/packages/Common/XylemCommonUiLegacyGenCtl.pdb index 0e0465316..1aad70413 100644 Binary files a/packages/Common/XylemCommonUiLegacyGenCtl.pdb and b/packages/Common/XylemCommonUiLegacyGenCtl.pdb differ