diff --git a/Results/DB.cs b/Results/DB.cs index c81fec55b..ff2e5819a 100644 --- a/Results/DB.cs +++ b/Results/DB.cs @@ -307,38 +307,45 @@ namespace Results { bool hasCalibrationFactors = false; - foreach (var tstRslt in batch.TestRslts) + try { - if (tstRslt.CalibFactorResultsToSave != null && - tstRslt.CalibFactorResultsToSave.Count > 0) - { - hasCalibrationFactors = true; - break; - } - } - - if (hasCalibrationFactors) - { - TestRsltCalibFactorHelper.CreateTableIfNotExists(session); foreach (var tstRslt in batch.TestRslts) { - if (tstRslt.CalibFactorResultsToSave == null || - tstRslt.CalibFactorResultsToSave.Count == 0) + if (tstRslt.CalibFactorResultsToSave != null && + tstRslt.CalibFactorResultsToSave.Count > 0) { - continue; - } - - TestRsltCalibFactorHelper.DeleteByTestRsltIdNoTransaction(session, tstRslt.Id); - - foreach (var calib in tstRslt.CalibFactorResultsToSave) - { - calib.TestRslt = tstRslt; - calib.ErrorStr = TestRsltCalibFactorHelper.Truncate(calib.ErrorStr, 240); - - session.SaveOrUpdate(calib); + hasCalibrationFactors = true; + break; } } + + if (hasCalibrationFactors) + { + TestRsltCalibFactorHelper.CreateTableIfNotExists(session); + + foreach (var tstRslt in batch.TestRslts) + { + if (tstRslt.CalibFactorResultsToSave == null || + tstRslt.CalibFactorResultsToSave.Count == 0) + { + continue; + } + + TestRsltCalibFactorHelper.DeleteByTestRsltIdNoTransaction(session, tstRslt.Id); + + foreach (var calib in tstRslt.CalibFactorResultsToSave) + { + calib.TestRslt = tstRslt; + calib.ErrorStr = TestRsltCalibFactorHelper.Truncate(calib.ErrorStr, 240); + + session.SaveOrUpdate(calib); + } + } + } + }catch(Exception exc) + { + log.ErrorFormat("DB - Cannot save calibration factors: {0}", exc.Message); } } diff --git a/Results/Entities/TestRsltCalibFactor.cs b/Results/Entities/TestRsltCalibFactor.cs index 36c771422..2c762e755 100644 --- a/Results/Entities/TestRsltCalibFactor.cs +++ b/Results/Entities/TestRsltCalibFactor.cs @@ -8,6 +8,8 @@ namespace Results.Entities public virtual int CalibFactorIndex { get; set; } // 1, 2, 3 + public virtual bool IsCalibFactorValid { get; set; } + public virtual int BaseCalibFactor { get; set; } public virtual int CalculatedCalibFactor { get; set; } @@ -29,6 +31,7 @@ namespace Results.Entities { Stored = false; ErrorStr = string.Empty; + IsCalibFactorValid = false; } } } \ No newline at end of file diff --git a/Results/Entities/helpers/DatabaseMigrationHelper.cs b/Results/Entities/helpers/DatabaseMigrationHelper.cs index cd4af3082..ec0cfaaef 100644 --- a/Results/Entities/helpers/DatabaseMigrationHelper.cs +++ b/Results/Entities/helpers/DatabaseMigrationHelper.cs @@ -66,8 +66,7 @@ namespace Results.Entities.helpers { alter.Transaction = transaction; - alter.CommandText = - "ALTER TABLE `" + tableName + "` ADD COLUMN `" + columnName + "` " + columnDefinition; + alter.CommandText = "ALTER TABLE `" + tableName + "` ADD COLUMN `" + columnName + "` " + columnDefinition; alter.ExecuteNonQuery(); } diff --git a/Results/Entities/helpers/TestRsltCalibFactorHelper.cs b/Results/Entities/helpers/TestRsltCalibFactorHelper.cs index b0c6befa4..81a04bb8b 100644 --- a/Results/Entities/helpers/TestRsltCalibFactorHelper.cs +++ b/Results/Entities/helpers/TestRsltCalibFactorHelper.cs @@ -1,10 +1,14 @@ using System.Collections.Generic; +using log4net; using NHibernate; namespace Results.Entities.helpers { public static class TestRsltCalibFactorHelper { + + private static readonly ILog log = LogManager.GetLogger(typeof(TestRsltCalibFactorHelper)); + public static bool TableExists(ISession session) { try @@ -24,6 +28,7 @@ namespace Results.Entities.helpers ISession session, int testRsltId) { + log.DebugFormat("Deleting TestRsltCalibFactor records for TestRsltId: {0}", testRsltId); session.CreateSQLQuery(@" DELETE FROM TestRsltCalibFactor WHERE TestRsltId = :testRsltId") .SetParameter("testRsltId", testRsltId) .ExecuteUpdate(); @@ -65,6 +70,7 @@ CREATE TABLE IF NOT EXISTS TestRsltCalibFactor ( CalibFactorIndex INT NOT NULL, BaseCalibFactor INT NOT NULL, CalculatedCalibFactor INT NOT NULL, + IsCalibFactorValid BIT NOT NULL, Stored BIT NOT NULL, ErrorStr VARCHAR(240) NULL, TimeStart DOUBLE NOT NULL, @@ -90,6 +96,7 @@ CREATE TABLE IF NOT EXISTS TestRsltCalibFactor ( CalibFactorIndex INTEGER NOT NULL, BaseCalibFactor INTEGER NOT NULL, CalculatedCalibFactor INTEGER NOT NULL, + IsCalibFactorValid INTEGER NOT NULL, Stored INTEGER NOT NULL, ErrorStr VARCHAR(240) NULL, TimeStart DOUBLE NOT NULL, @@ -103,6 +110,7 @@ CREATE TABLE IF NOT EXISTS TestRsltCalibFactor ( );"; } + log.InfoFormat("Creating TestRsltCalibFactor table: {0}", sql); session.CreateSQLQuery(sql).ExecuteUpdate(); } } diff --git a/Results/Mappings/MeterTestRsltMap.cs b/Results/Mappings/MeterTestRsltMap.cs index 35a57abf3..5b9cce0ec 100644 --- a/Results/Mappings/MeterTestRsltMap.cs +++ b/Results/Mappings/MeterTestRsltMap.cs @@ -49,7 +49,7 @@ namespace Results.Mappings #endif References(x => x.WaterMeter); References(x => x.TestRslt); - Map(x => x.Q3Channel).Not.Nullable() .Default("0"); + Map(x => x.Q3Channel); } } } diff --git a/Results/Mappings/TestRsltCalibFactorMap.cs b/Results/Mappings/TestRsltCalibFactorMap.cs index 5a0764afc..618e7c132 100644 --- a/Results/Mappings/TestRsltCalibFactorMap.cs +++ b/Results/Mappings/TestRsltCalibFactorMap.cs @@ -14,6 +14,7 @@ namespace Results.Mappings .Not.Nullable(); Map(x => x.CalibFactorIndex).Not.Nullable(); + Map(x => x.IsCalibFactorValid).Not.Nullable(); Map(x => x.BaseCalibFactor).Not.Nullable(); Map(x => x.CalculatedCalibFactor).Not.Nullable(); diff --git a/Results/Mappings/WaterMeterDataMap.cs b/Results/Mappings/WaterMeterDataMap.cs index 622e43739..0dfe40ba2 100644 --- a/Results/Mappings/WaterMeterDataMap.cs +++ b/Results/Mappings/WaterMeterDataMap.cs @@ -58,7 +58,7 @@ namespace Results.Mappings #if ORACLE_DB Map(x => x.WMTypeId); #endif - Map(x => x.Q3Channel) .Not.Nullable() .Default("0"); + Map(x => x.Q3Channel); } } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 50b62ac3b..e247b9f11 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.3110.1")] -[assembly: AssemblyFileVersion("3.9.3110.1")] +[assembly: AssemblyVersion("3.9.3121.1")] +[assembly: AssemblyFileVersion("3.9.3121.1")] diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs index 22ec77c38..c46d6942c 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs @@ -380,6 +380,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication if (pcbResult.IsValidPcb) { + log.Debug($"Setting PCB: {pcbResult.PcbId} for Head: {genesisHead.Name}"); genesisHead.SerialNr = pcbResult.PcbId; if (genesisHead.ConfigStruct != null) { @@ -474,6 +475,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication if (pbcReadBuildAsync.Success && !string.IsNullOrEmpty(pbcReadBuildAsync.PcbId)) { + log.Debug($"Setting PCB: {pbcReadBuildAsync.PcbId} for Head: {genesisHead.Name}"); genesisHead.SerialNr = pbcReadBuildAsync.PcbId; } @@ -1330,6 +1332,16 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult connectFullPassLoginWithRetryAsync = await genesisSmartReader.CommInterfaceBridge.ConnectFullPassLoginWithRetryAsync(genesisSmartReader.GetSlotNr, token); log.Debug($"GroupedLoginSlot_Async( Slot: {genesisSmartReader.GetSlotNr}) - Result: " + connectFullPassLoginWithRetryAsync); + if (connectFullPassLoginWithRetryAsync?.PcbResult?.Success == true) + { + log.Debug($"Setting PCB: {connectFullPassLoginWithRetryAsync?.PcbResult?.Result?.PcbId} for Head: {genesisSmartReader.Name}"); + genesisSmartReader.SerialNr = connectFullPassLoginWithRetryAsync?.PcbResult?.Result?.PcbId; + if (genesisSmartReader.ConfigStruct != null) + { + genesisSmartReader.ConfigStruct.PCBNumberString = genesisSmartReader.SerialNr; + } + } + return connectFullPassLoginWithRetryAsync; } catch (Exception ex) @@ -1447,30 +1459,78 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication } } - public string WriteQ3Calibration() + public string WriteQ3Calibration(TestMethodCfg cfg, Test test, WaterMeter wm) { if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) { log.Debug("Connect() - Simulated response"); return ResultOk; //"Simulated Connect"; } - return Task.Run(() => WriteQ3Calibration_Async(genesisHead)) + + if (cfg == null) + { + log.Error("WriteQ3Calibration() - Missing TestMethodCfg"); + return "Missing TestMethodCfg"; + } + if (test == null) + { + log.Error("WriteQ3Calibration() - Missing Test"); + return "Missing Test"; + } + + + return Task.Run(() => WriteQ3Calibration_Async(genesisHead, cfg, test, wm)) .GetAwaiter() .GetResult(); } - private async Task WriteQ3Calibration_Async(GenesisSmartReader genesisSmartReader) + private async Task WriteQ3Calibration_Async(GenesisSmartReader genesisSmartReader, + TestMethodCfg cfg, + Test test, WaterMeter wm) { try { - log.Debug("WriteQ3Calibration_Async called for iHead: " + genesisHead); + log.Debug("WriteQ3Calibration_Async called for iHead: " + genesisHead?.Name + " , cfg: " + cfg?.Name + " , test: " + test?.Name); - if (genesisHead == null) return string.Empty; - if (string.IsNullOrEmpty(genesisHead.CommInterface)) return string.Empty; + if (genesisHead == null) + { + log.Error("WriteQ3Calibration_Async() - Missing GenesisSmartReader"); + return string.Empty; + } + if (string.IsNullOrEmpty(genesisHead.CommInterface)) + { + log.Error("WriteQ3Calibration_Async() - Missing CommInterface"); + return string.Empty; + } GciBridge gciBridge = genesisHead.CommInterfaceBridge; - if (gciBridge == null) return string.Empty; + if (gciBridge == null) + { + log.Error("WriteQ3Calibration_Async() - Missing GciBridge"); + return string.Empty; + } + Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(test.Name, test.Part); + log.Debug($"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Test: {test.Name} - Part: {test.Part} - IsTestRslt: {(tstRslt==null?true:false)}"); + + try + { + if (tstRslt.CalibFactorResultsToSave.Count == 0) + { + for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + { + tstRslt.CalibFactorResultsToSave.Add(new TestRsltCalibFactor() + { + Stored = false, + CalibFactorIndex = i + } + ); + } + } + }catch(Exception ex) + { + log.Error($"WriteQ3Calibration_Async() - DB Exception: {ex.Message}"); + } CancellationToken token = default; @@ -1481,6 +1541,8 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication return "CalculateQ3Calibration Initialised Data not valid"; } + StoreCalibrationValuesResults(tstRslt, genesisSmartReader); + if (!genesisSmartReader.Q3CalibValid) { log.Error("WriteQ3Calibration_Async() - Q3Channel not valid"); @@ -1490,36 +1552,112 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication //Get Activity Status LedState ledMode = LedState.inactive; // swich on LED byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0; + UInt16 calibFactor1 = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch1Value); UInt16 calibFactor2 = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch2Value); UInt16 calibFactor3 = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch3Value); + UInt16 valueSampleRate = 2; UInt16 ResetAccumulatorsValue = 0; UInt16 ForwardArrowValue = 0; UInt16 StoreCalibrationValue = 1; - log.Debug( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set Led Mode: {valueLed}"); + + + + log.Debug( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start"); + + log.Debug( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor1: {calibFactor1}"); var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, calibFactor1, false, false, token); if (CalFactor1AsyncResult == null || !CalFactor1AsyncResult.Success) { log.Error( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor1AsyncResult failed. Result: {CalFactor1AsyncResult}"); return "Failed to set CalFactor1"; } + wm.OrigCalibFactor = calibFactor1; + if (genesisSmartReader.Q3CalibDiffPercentageValue.Length == 3) + wm.Q2ErrWOCorrection = genesisSmartReader.Q3CalibDiffPercentageValue[0]; + //CH3 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[0] != null) + { + tstRslt.CalibFactorResultsToSave[0].CalculatedCalibFactor = Convert.ToInt32(calibFactor1); + tstRslt.CalibFactorResultsToSave[0].Stored = true; + tstRslt.CalibFactorResultsToSave[0].IsCalibFactorValid = true; + tstRslt.CalibFactorResultsToSave[0].Error = genesisSmartReader.Q3CalibDiffPercentageValue[0]; + } + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor3: {calibFactor1}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH1 Exception:", ex); + } + + log.Debug( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor2: {calibFactor2}"); var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor2, calibFactor2, false, false, token); if (CalFactor2AsyncResult == null || !CalFactor2AsyncResult.Success) { log.Error( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor2AsyncResult failed. Result: {CalFactor2AsyncResult}"); return "Failed to set CalFactor2"; } + wm.CalibFactorLNA = calibFactor2; + if (genesisSmartReader.Q3CalibDiffPercentageValue.Length == 3) + wm.OrigCalibFactorLNA = genesisSmartReader.Q3CalibDiffPercentageValue[1]; + //CH3 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[1] != null) + { + tstRslt.CalibFactorResultsToSave[1].CalculatedCalibFactor = Convert.ToInt32(calibFactor2); + tstRslt.CalibFactorResultsToSave[1].Stored = true; + tstRslt.CalibFactorResultsToSave[1].IsCalibFactorValid = true; + tstRslt.CalibFactorResultsToSave[1].Error = genesisSmartReader.Q3CalibDiffPercentageValue[1]; + } + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor3: {calibFactor2}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH2 Exception:", ex); + } + + + log.Debug( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor3: {calibFactor3}"); var CalFactor3AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor3, calibFactor3, false, false, token); if (CalFactor3AsyncResult == null || !CalFactor3AsyncResult.Success) { log.Error( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor3AsyncResult failed. Result: {CalFactor3AsyncResult}"); return "Failed to set CalFactor3"; } + wm.CalibFactor = calibFactor3; + if (genesisSmartReader.Q3CalibDiffPercentageValue.Length == 3) + wm.Diff2Hz8Hz = genesisSmartReader.Q3CalibDiffPercentageValue[2]; + //CH3 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[2] != null) + { + tstRslt.CalibFactorResultsToSave[2].CalculatedCalibFactor = Convert.ToInt32(calibFactor3); + tstRslt.CalibFactorResultsToSave[2].Stored = true; + tstRslt.CalibFactorResultsToSave[2].IsCalibFactorValid = true; + tstRslt.CalibFactorResultsToSave[2].Error = genesisSmartReader.Q3CalibDiffPercentageValue[2]; + } + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor3: {calibFactor3}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH3 Exception:", ex); + } + log.Info( $"WriteQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Set DONE CalFactor1: {calibFactor1}, CalFactor2: {calibFactor2}, CalFactor2: {calibFactor3}"); @@ -1569,46 +1707,133 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication } } - - public string PrepareQ3Calibration(TestMethodCfg cfg, Test test) + private void StoreCalibrationValuesResults(TestRslt tstRslt, GenesisSmartReader genesisSmartReader) { + try + { + if (tstRslt == null || tstRslt.CalibFactorResultsToSave == null) + { + log.Error("StoreCalibrationValuesResults() - Missing TestRslt OR CalibFactorResultsToSave"); + return; + } + + for (int i = 0; i < tstRslt.CalibFactorResultsToSave.Count; i++) + { + ushort calibFactor = 0; + switch (i) + { + case 0: + calibFactor = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch1Value); + break; + case 1: + calibFactor = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch2Value); + break; + case 2: + calibFactor = Convert.ToUInt16(genesisSmartReader.Q3Calib_Ch3Value); + break; + } + + tstRslt.CalibFactorResultsToSave[i].CalculatedCalibFactor = calibFactor; + tstRslt.CalibFactorResultsToSave[i].IsCalibFactorValid = genesisSmartReader.Q3CalibValid; + tstRslt.CalibFactorResultsToSave[i].Error = genesisSmartReader.Q3CalibDiffPercentageValue[i]; + log.Debug($"StoreCalibrationValuesResults() - CalibFactor: {i} - CalibFactor: {calibFactor} - Q3CalibValid: {genesisSmartReader.Q3CalibValid} - Q3CalibDiffPercentageValue: {genesisSmartReader.Q3CalibDiffPercentageValue[i]}"); + } + } + catch (Exception ex) + { + log.Error("StoreCalibrationValuesResults() - Exception:", ex); + } + } + + + public string PrepareQ3Calibration(TestMethodCfg cfg, Test test, WaterMeter wm) + { + log.Debug("PrepareQ3Calibration() - Start, Head: " + genesisHead?.Name); if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) { - log.Debug("Connect() - Simulated response"); + log.Debug("PrepareQ3Calibration() - Simulated response"); return ResultOk;//"Simulated Connect"; } - return Task.Run(() => PrepareQ3Calibration_Async(genesisHead, cfg, test)) + + + if (cfg == null) + { + log.Error($"PrepareQ3Calibration({genesisHead?.Name}) - Missing TestMethodCfg"); + return "PrepareQ3Calibration - Missing TestMethodCfg"; + } + + if (test == null) + { + log.Error($"PrepareQ3Calibration({genesisHead?.Name}) - Missing Test"); + return "PrepareQ3Calibration - Missing Test"; + } + + return Task.Run(() => PrepareQ3Calibration_Async(genesisHead, cfg, test, wm)) .GetAwaiter() .GetResult(); } - private async Task PrepareQ3Calibration_Async( - GenesisSmartReader genesisSmartReader, + private async Task PrepareQ3Calibration_Async(GenesisSmartReader genesisSmartReader, TestMethodCfg cfg, - Test test) + Test test, WaterMeter wm) { try { - log.Debug("PrepareQ3Calibration_Async called for iHead: " + genesisHead); + log.Debug("PrepareQ3Calibration_Async called for iHead: " + genesisHead?.Name + ", cfg: " + cfg?.Name + ", test: " + test?.Name); - if (genesisHead == null) return string.Empty; - if (string.IsNullOrEmpty(genesisHead.CommInterface)) return string.Empty; - GciBridge gciBridge = genesisHead.CommInterfaceBridge; - if (gciBridge == null) return string.Empty; - - if (test == null) return "Valid Test Missing!"; - Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(test.Name, test.Part); - log.Debug($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Test: {test.Name} - Part: {test.Part} - IsTestRslt: {(tstRslt==null?true:false)}"); - - if (tstRslt.CalibFactorResultsToSave.Count == 0) + if (genesisHead == null) { - for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) - { - tstRslt.CalibFactorResultsToSave.Add(new TestRsltCalibFactor()); - } + log.Error("PrepareQ3Calibration_Async() - Missing GenesisSmartReader"); + return string.Empty; + } + if (string.IsNullOrEmpty(genesisHead.CommInterface)) + { + log.Error("PrepareQ3Calibration_Async() - Missing CommInterface"); + return string.Empty; + } + GciBridge gciBridge = genesisHead.CommInterfaceBridge; + if (gciBridge == null) + { + log.Error("PrepareQ3Calibration_Async() - Missing GciBridge"); + return string.Empty; } + Results.Entities.TestRslt tstRslt = null; + + try + { + if (test == null) + { + log.Error($"PrepareQ3Calibration_Async({genesisHead?.Name}) - Missing Test"); + return "Valid Test Missing!"; + } + tstRslt = ProcessData.BatchRslts.GetTestRslt(test.Name, test.Part); + log.Debug($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Test: {test.Name} - Part: {test.Part} - IsTestRslt: {(tstRslt==null?true:false)}"); + if (tstRslt?.CalibFactorResultsToSave?.Count > 0) + { + tstRslt?.CalibFactorResultsToSave.Clear(); + } + if (tstRslt?.CalibFactorResultsToSave?.Count == 0) + { + for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + { + tstRslt.CalibFactorResultsToSave.Add(new TestRsltCalibFactor() + { + Stored = false, + CalibFactorIndex = i + } + ); + } + } + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async({genesisSmartReader.GetSlotNr}) - DB TestRslt Exception:", ex); + return ex.Message; + } + + CancellationToken token = default; //Get Activity Status @@ -1618,34 +1843,95 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication UInt16 valueSampleRate = 10; //TODO BUMI - implement variable values for Q3Channel - be shure is implemented in Head - string prepareMeterSizeAndCalibration = await PrepareMeterSizeAndCalibration(genesisSmartReader, cfg, gciBridge, token); + string prepareMeterSizeAndCalibration = await PrepareMeterSizeAndCalibration(genesisSmartReader, cfg, gciBridge, tstRslt, token); if (prepareMeterSizeAndCalibration != ResultOk) { log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - prepareMeterSizeAndCalibration failed. Result: {prepareMeterSizeAndCalibration}"); return prepareMeterSizeAndCalibration; } - log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set Led Mode: {valueLed}"); - var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, genesisSmartReader.Q3CalibValue[0], false, false, token); + ushort calibrationFactor1 = Convert.ToUInt16(genesisSmartReader?.Q3CalibValue[0]); + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor1: {calibrationFactor1}"); + var CalFactor1AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor1, calibrationFactor1, false, false, token); if (CalFactor1AsyncResult == null || !CalFactor1AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor1AsyncResult failed. Result: {CalFactor1AsyncResult}"); return "Failed to disable Led Mode"; } - - var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor2, genesisSmartReader.Q3CalibValue[1], false, false, token); + + //CH1 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[0] != null) + { + tstRslt.CalibFactorResultsToSave[0].BaseCalibFactor = Convert.ToInt32(calibrationFactor1); + tstRslt.CalibFactorResultsToSave[0].Stored = false; + } + //wm.OrigCalibFactor = calibrationFactor1; // now dosabled + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor1: {calibrationFactor1}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH1 Exception:", ex); + } + + + ushort calibrationFactor2 = Convert.ToUInt16(genesisSmartReader?.Q3CalibValue[1]); + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor2: {calibrationFactor2}"); + var CalFactor2AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor2, calibrationFactor2, false, false, token); if (CalFactor2AsyncResult == null || !CalFactor2AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor2AsyncResult failed. Result: {CalFactor2AsyncResult}"); return "Failed to disable Led Mode"; } + //CH2 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[1] != null) + { + tstRslt.CalibFactorResultsToSave[1].BaseCalibFactor = Convert.ToInt32(calibrationFactor2); + tstRslt.CalibFactorResultsToSave[1].Stored = false; + } + //wm.CalibFactorLNA = calibrationFactor2; // now dosabled + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor2: {calibrationFactor2}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH2 Exception:", ex); + } - var CalFactor3AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor3, genesisSmartReader.Q3CalibValue[2], false, false, token); + + ushort calibrationFactor3 = Convert.ToUInt16(genesisSmartReader?.Q3CalibValue[2]); + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set CalFactor1: {calibrationFactor3}"); + var CalFactor3AsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.CalFactor3, calibrationFactor3, false, false, token); if (CalFactor3AsyncResult == null || !CalFactor3AsyncResult.Success) { log.Error( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - CalFactor3AsyncResult failed. Result: {CalFactor3AsyncResult}"); return "Failed to disable Led Mode"; } + //CH3 to DB + try + { + if (tstRslt != null && + tstRslt?.CalibFactorResultsToSave?.Count == 3 && + tstRslt?.CalibFactorResultsToSave?[2] != null) + { + tstRslt.CalibFactorResultsToSave[2].BaseCalibFactor = Convert.ToInt32(calibrationFactor3); + tstRslt.CalibFactorResultsToSave[2].Stored = false; + } + //wm.CalibFactor = calibrationFactor3; // now dosabled + log.Debug( $"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB Stored tstRslt:{tstRslt.Name()} - CalFactor3: {calibrationFactor3}"); + } + catch (Exception ex) + { + log.Error($"PrepareQ3Calibration_Async( Slot: {genesisSmartReader.GetSlotNr}) - DB CH3 Exception:", ex); + } + + var SampleRateAsyncResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.SampleRate, valueSampleRate, false, false, token); if (SampleRateAsyncResult == null || !SampleRateAsyncResult.Success) @@ -1673,66 +1959,82 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication } private static async Task PrepareMeterSizeAndCalibration(GenesisSmartReader genesisSmartReader, TestMethodCfg cfg, - GciBridge gciBridge, CancellationToken token) + GciBridge gciBridge, Results.Entities.TestRslt tstRslt, CancellationToken token) { UInt16 valueCalibrate = 15625; //Predefined Calibration Value + log.Debug( $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader?.GetSlotNr}) - Start - predefined {valueCalibrate}"); try { - if (cfg != null) - { - var MeterSizeAsyncResult = await gciBridge.ReadRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, - RadioService.MeterSize, token); - - if (MeterSizeAsyncResult == null || !MeterSizeAsyncResult.Success) - { - log.Error($"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Error reading MeterSize register. Result: {MeterSizeAsyncResult}"); - return "Error reading MeterSize register"; - } - - string rawHex = MeterSizeAsyncResult.Result?.RawHex; - if (string.IsNullOrWhiteSpace(rawHex)) - { - log.Error( - $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize RawHex is empty"); - return "MeterSize RawHex is empty"; - } - - uint meterSizeRaw = ParseRawHexToUInt32(rawHex); - - // If register returns 4 bytes like "00 00 00 02", this gives 2. - // If it returns "02", this also gives 2. - if (meterSizeRaw > ushort.MaxValue) - { - log.Error( - $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize too large. RawHex='{rawHex}', Value={meterSizeRaw}"); - return "MeterSize value too large"; - } - - ushort int16MeterSize = (ushort)meterSizeRaw; - - double[] dSize = cfg.GetQ3CalibrationBySizeDoubles(int16MeterSize); - if (dSize == null || dSize.Length != 3) - { - log.Info( - $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Problem with Q3Channel calculation. Size: {int16MeterSize}"); - return ResultNok; - } - - genesisSmartReader - .SetQ3Calibration(dSize); // new double[]{valueCalibrate,valueCalibrate,valueCalibrate} - log.Info( - $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Based MeterSize: {int16MeterSize} Set Q3Channel: CH1({dSize[0]}), CH2({dSize[1]}), CH3({dSize[2]})"); - } - else + // if (cfg != null) + // { + // var MeterSizeAsyncResult = await gciBridge.ReadRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, + // RadioService.MeterSize, token); + // + // if (MeterSizeAsyncResult == null || !MeterSizeAsyncResult.Success) + // { + // log.Error($"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Error reading MeterSize register. Result: {MeterSizeAsyncResult}"); + // return "Error reading MeterSize register"; + // } + // + // string rawHex = MeterSizeAsyncResult.Result?.RawHex; + // if (string.IsNullOrWhiteSpace(rawHex)) + // { + // log.Error( + // $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize RawHex is empty"); + // return "MeterSize RawHex is empty"; + // } + // + // uint meterSizeRaw = ParseRawHexToUInt32(rawHex); + // + // // If register returns 4 bytes like "00 00 00 02", this gives 2. + // // If it returns "02", this also gives 2. + // if (meterSizeRaw > ushort.MaxValue) + // { + // log.Error( + // $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - MeterSize too large. RawHex='{rawHex}', Value={meterSizeRaw}"); + // return "MeterSize value too large"; + // } + // + // ushort int16MeterSize = (ushort)meterSizeRaw; + // + // double[] dSize = cfg.GetQ3CalibrationBySizeDoubles(int16MeterSize); + // if (dSize == null || dSize.Length != 3) + // { + // log.Info( + // $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Problem with Q3Channel calculation. Size: {int16MeterSize}"); + // return ResultNok; + // } + // + // genesisSmartReader .SetQ3Calibration(dSize); // new double[]{valueCalibrate,valueCalibrate,valueCalibrate} + // for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + // { + // tstRslt.CalibFactorResultsToSave[i].BaseCalibFactor = Convert.ToInt32(dSize[i]); + // } + // + // log.Info( + // $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Based MeterSize: {int16MeterSize} Set Q3Channel: CH1({dSize[0]}), CH2({dSize[1]}), CH3({dSize[2]})"); + // } + // else { genesisSmartReader.SetQ3Calibration(new double[] { valueCalibrate, valueCalibrate, valueCalibrate }); + for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + { + if(tstRslt != null && tstRslt?.CalibFactorResultsToSave[i] != null) + tstRslt.CalibFactorResultsToSave[i].BaseCalibFactor = Convert.ToInt32(valueCalibrate); + } + + log.Info( $"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Hard Set Q3Channel: CH1({valueCalibrate}), CH2({valueCalibrate}), CH3({valueCalibrate})"); } }catch(Exception ex) { log.Error($"PrepareMeterSizeAndCalibration( Slot: {genesisSmartReader.GetSlotNr}) - Error during Q3Channel calculation: {ex.Message}"); genesisSmartReader.SetQ3Calibration(new double[] { valueCalibrate, valueCalibrate, valueCalibrate }); + for (int i = 0; i < genesisSmartReader.ChannelsCount; i++) + { + tstRslt.CalibFactorResultsToSave[i].BaseCalibFactor = Convert.ToInt32(valueCalibrate); + } return ResultNok; } diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs index 75a9078fb..613d1f1c6 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader.cs @@ -1340,16 +1340,6 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations void DataStreamPostProcessing() { PrepareCalculatedChannelData(); - try - { - log.DebugFormat("DataStreamPostProcessing() - harcoded call GetQ3Calibration(200.0, 120.0, 17969.0);"); - SetQ3Calibration(new double[]{17969.0,17969.0,17969.0 }); - CalculateQ3Calibration(200.0, 120.0); - } - catch (Exception ex) - { - log.Error($"DataStreamPostProcessing -- Q3 CALIBRATION -- failed: {ex}"); - } } /// @@ -1883,7 +1873,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations _readLoopTask = Task.Run(() => { - log.Debug($"OPTHO {OptoComPortNr} background read loop started."); + logStream.Debug($"OPTHO {OptoComPortNr} background read loop started."); while (!token.IsCancellationRequested) { @@ -1939,12 +1929,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}"); + logStream.Error($"OPTHO {OptoComPortNr} background read error: {ex.Message}"); Thread.Sleep(100); } } - log.Debug($"OPTHO {OptoComPortNr} background read loop stopped."); + logStream.Debug($"OPTHO {OptoComPortNr} background read loop stopped."); }, token); } @@ -2025,7 +2015,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations { try { - log.Debug($"OPTHO {OptoComPortNr} processing loop started."); + logStream.Debug($"OPTHO {OptoComPortNr} processing loop started."); while (!token.IsCancellationRequested) { @@ -2055,14 +2045,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (blockCompleted) { - log.Debug("Processing loop completed flow block detected."); + logStream.Debug("Processing loop completed flow block detected."); if (resetSerialBuffersOnCompletedFlowBlock) ResetDataBuffer(); } } catch (Exception ex) { - log.Error($"Processing loop failed: {ex}"); + logStream.Error($"Processing loop failed: {ex}"); } continue; @@ -2076,16 +2066,16 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}"); + logStream.Error($"OPTHO {OptoComPortNr} processing loop error: {ex}"); Thread.Sleep(50); } } - log.Debug($"OPTHO {OptoComPortNr} processing loop stopped."); + logStream.Debug($"OPTHO {OptoComPortNr} processing loop stopped."); } catch (Exception ex) { - log.Error($"StartProcessingLoop fatal error: {ex}"); + logStream.Error($"StartProcessingLoop fatal error: {ex}"); } }, token); } @@ -2114,13 +2104,13 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations // 🔴 STEP 1: Check if we should start processing if (startDataProcessing && optoState == DataStreamState.ProcessAndSave) { - log.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line); + logStream.DebugFormat("Read Opto Data Line timestamp:{0} to process from queue: {1}",timestamp.ToString("HH:mm:ss.fff") , line); bool blockCompleted; ProcessOptoLine(line, optoState, out blockCompleted); if (blockCompleted) { - log.Debug("ReadOptoData() completed flow block detected."); + logStream.Debug("ReadOptoData() completed flow block detected."); if (resetSerialBuffersOnCompletedFlowBlock) // DO NOT call ResetDataBuffer() here ResetDataBuffer(); } @@ -2128,7 +2118,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}"); + logStream.Error($"OPTHO {OptoComPortNr} processing queued line failed: {ex.Message}"); } } } @@ -2144,7 +2134,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations var encoding = optoSerialPort?.Encoding ?? Encoding.ASCII; byte[] bytes = encoding.GetBytes(line); - log.Debug("ComPort: " + OptoComPortNr + " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes)); + logStream.Debug("ComPort: " + OptoComPortNr + " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes)); var streamingDecode = new StreamingDecoder(true); streamingDecode.DecodeMsg(line); @@ -2154,14 +2144,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (streamingDecode.DataFlowTest != null && streamingDecode.DataFlowTest.IsValid) { blockCompleted = HandleFlowMarker(); - log.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest + - " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes)); + logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Flow data: " + streamingDecode.DataFlowTest + + " OPTHO RX ← " + HexFormatter.ToSerialHex(bytes)); } if (calibData != null && calibData.IsValid) { - log.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " + - HexFormatter.ToSerialHex(bytes)); + logStream.Debug("ComPort: " + OptoComPortNr + " Decoded Calib: " + calibData + " OPTHO RX ← " + + HexFormatter.ToSerialHex(bytes)); MarkCalibrationChannelSeen(calibData.Channel); } @@ -2181,7 +2171,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (optoData[bufferIx] == null) { - log.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx); + logStream.ErrorFormat("{0}: optoData[{1}] was null, recreating.", Name, bufferIx); optoData[bufferIx] = new OptoTelegramRaw(); } @@ -2194,7 +2184,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations int iChanel = calibData.Channel - 1; if (iChanel >= 0 && iChanel < iChanelsCount) { - log.Debug( + logStream.Debug( $"Before UpdateFromSmart ch={iChanel + 1}: " + $"volumeRawExtLast={volumeRawExtLast[iChanel]}, " + $"timestampExtLast={timestampExtLast[iChanel]}, " + @@ -2262,7 +2252,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations var encoding = optoSerialPort?.Encoding ?? Encoding.ASCII; byte[] bytes = encoding.GetBytes(line); received = HexFormatter.ToSerialHex(bytes); - log.Debug("RX ← " + received); + logStream.Debug("RX ← " + received); try { @@ -2271,19 +2261,19 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations CalibrationRecord data = _streamingDecode.DataCalib; if (data != null && data.IsValid) { - log.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " + - received); + logStream.Info($"OPTHO {OptoComPortNr} DataCalib Parsed opto data: " + data + " RX ← " + + received); MarkCalibrationChannelSeen(data.Channel); } FlowTestRecord dataFlow = _streamingDecode.DataFlowTest; if (dataFlow != null && dataFlow.IsValid) { - log.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received); + logStream.Info($"OPTHO {OptoComPortNr} FLOW Parsed opto data: " + dataFlow + " RX ← " + received); if (HandleFlowMarker()) { - log.Debug("ReadOptoData() completed flow block detected."); + logStream.Debug("ReadOptoData() completed flow block detected."); if (resetSerialBuffersOnCompletedFlowBlock) ResetDataBuffer(); // no ResetDataBuffer() here } @@ -2292,7 +2282,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}"); + logStream.Error($"OPTHO {OptoComPortNr} Read error: {ex.Message}"); } // string line = optoSerialPort.ReadExisting(); @@ -2337,11 +2327,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (TimeoutException) { - log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing."); + logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} timeout - continuing."); } catch (Exception ex) { - log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}"); + logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}"); } } @@ -2357,11 +2347,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations { optoSerialPort.DiscardInBuffer(); optoSerialPort.DiscardOutBuffer(); - log.Debug("-- Reaset Data Buffer --"); + logStream.Debug("-- Reaset Data Buffer --"); return; } } - log.Debug("-- Reaset Data Buffer - no serial port --"); + logStream.Debug("-- Reaset Data Buffer - no serial port --"); } void ISmartReader.SetNfcInterface() @@ -2387,17 +2377,17 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations byte[] bytes = optoSerialPort.Encoding.GetBytes(line); string received = HexFormatter.ToSerialHex(bytes); - log.Debug("RX ← " + received); + logStream.Debug("RX ← " + received); return line; } } catch (TimeoutException) { - log.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing."); + logStream.Debug($"ReadOptoData() OPTHO {OptoComPortNr} ReadLine timeout (3s) - continuing."); } catch (Exception ex) { - log.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}"); + logStream.Error($"ReadOptoData() OPTHO {OptoComPortNr} Read error: {ex.Message}"); } return string.Empty; @@ -2408,7 +2398,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (completedTask == readTask) return await readTask; - log.Debug("ReadOptoData timeout after " + timeoutMs + " ms"); + logStream.Debug("ReadOptoData timeout after " + timeoutMs + " ms"); return string.Empty; } @@ -2957,7 +2947,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (data == null || !data.IsValid) continue; - log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data); + logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data); int dch = data.Channel - 1; if (dch >= 0 && dch < iChanelsCount) @@ -2970,7 +2960,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}"); + logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}"); } } } @@ -2981,7 +2971,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } - log.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}"); + logStream.Debug($"Try get End Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr}"); if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort(); if (!Double.IsNaN(volumeLtr[channel0])) @@ -2992,12 +2982,12 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations //Solve roll over if (endWMState < beginWMState) { - log.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}"); + logStream.Debug($"Solve roll over! endWMState: {endWMState} < beginWMState: {beginWMState}"); const double VOL_RANGE_LITERS = 16777216.0 * 0.00025; // 4,194.304 l endWMState += VOL_RANGE_LITERS; volumeLtr[channel0] = endWMState; ReadPulses(); - log.Debug( + logStream.Debug( $"Solve roll over! Upgraded endWMState: {endWMState}, beginWMState: {beginWMState}"); } } @@ -3006,7 +2996,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } //} - log.Warn("Default NaN value returned! Data Opto stream reading failed!"); + logStream.Warn("Default NaN value returned! Data Opto stream reading failed!"); return Double.NaN; }).ConfigureAwait(false); } @@ -3016,14 +3006,14 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations { if (ConfigStruct == null) { - log.Debug("ConfigStruct is null - created new in ReadSerialNr()"); + logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()"); ConfigStruct = new ConfigStruct(); } return await Task.Run(() => { - log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}"); + logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}"); Start(); @@ -3044,7 +3034,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations StreamingDecoder _streamingDecode = new StreamingDecoder(true); _streamingDecode.DecodeMsg(readOptoDataWithTimeout); CalibrationRecord data = _streamingDecode.DataCalib; - log.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data); + logStream.Info($"OPTHO {OptoComPortNr} Parsed optho data:" + data); if (data == null || !data.IsValid) continue; @@ -3060,7 +3050,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } catch (Exception ex) { - log.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}"); + logStream.Warn($"Parsing DiagnosticLedState4Data: {ex.Message}"); } } } @@ -3070,7 +3060,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } } - log.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}"); + logStream.Debug($"Try get Start Volume! COM: {this.OptoComPortNr}, Volume: {volumeLtr0}"); if (optoSerialPort != null && optoSerialPort.IsOpen) CloseOptoSerialPort(); if (!Double.IsNaN(volumeLtr0[ch])) @@ -3081,7 +3071,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } //} - log.Warn("Default NaN value returned! Data Opto stream reading failed!"); + logStream.Warn("Default NaN value returned! Data Opto stream reading failed!"); return Double.NaN; }).ConfigureAwait(false); } @@ -3093,7 +3083,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations if (ConfigStruct == null) { - log.Debug("ConfigStruct is null - created new in ReadSerialNr()"); + logStream.Debug("ConfigStruct is null - created new in ReadSerialNr()"); ConfigStruct = new ConfigStruct(); } @@ -3103,11 +3093,11 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations return await Task.Run(() => { - log.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}"); + logStream.Debug($"Try get ReadSerialNr! COM: {this.RfidComPortNr}"); SerialNr = OptoHeadTest.ReadRequest_PCB(); if (string.IsNullOrEmpty(SerialNr)) { - log.Debug("ReadSerialNr successful"); + logStream.Debug("ReadSerialNr successful"); } //optoHeadTest.CloseConnection(); @@ -3933,6 +3923,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations private double[] q3CalibInitial = {Double.NaN,Double.NaN,Double.NaN}; private bool[] isChQ3CalibValid = { false,false,false}; private double[] q3CalibCh = {Double.NaN,Double.NaN,Double.NaN}; + private double[] q3DiffPercentageCalibCh = {Double.NaN,Double.NaN,Double.NaN}; public bool Q3CalibValid @@ -3950,6 +3941,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations } public double[] Q3CalibValue { get => q3CalibInitial; } + public double[] Q3CalibDiffPercentageValue { get => q3DiffPercentageCalibCh; } public bool Q3Calib_Ch1Valid { get => isChQ3CalibValid[0]; } public bool Q3Calib_Ch2Valid { get => isChQ3CalibValid[1]; } @@ -3983,10 +3975,10 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations public void CalculateQ3Calibration(double refVolume, double refTime) { - GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid, ref q3CalibCh); + GetQ3Calibration(refVolume, refTime, q3CalibInitial, ref isChQ3CalibValid,ref q3DiffPercentageCalibCh, ref q3CalibCh); } - public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] q3CalibCh) + public void GetQ3Calibration(double refVolume, double refTime, double[] initCalibFactor, ref bool[] isChQ3CalibValid, ref double[] calibDiffPercent, ref double[] q3CalibCh) { log.Debug("=== Q3 CALIBRATION START ==="); @@ -4096,9 +4088,9 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.implementations q3CalibCh[iChannel] = (refVolume / recalculatedDeltaVolume) * initCalibFactor[iChannel]; double diffPercent = Math.Abs((initCalibFactor[iChannel] - q3CalibCh[iChannel] ) / initCalibFactor[iChannel]) * 100.0; - isChQ3CalibValid[iChannel] = diffPercent <= 5.0; + isChQ3CalibValid[iChannel] = diffPercent <= 5.0 && diffPercent >= -5.0; + calibDiffPercent[iChannel] = diffPercent; log.Debug($"Calculated Q3Calib Ch[{iChannel}] ={q3CalibCh[iChannel]} DiffPercent={diffPercent}% isValid[{isChQ3CalibValid[iChannel]}] IninitCalibFactor={initCalibFactor}"); - } log.Debug("=== Q3 CALIBRATION END ==="); diff --git a/TBF/Rig/TestMethods/iPerlCommunication/communication/RadioService.cs b/TBF/Rig/TestMethods/iPerlCommunication/communication/RadioService.cs index 7a17fbf16..7e5c50734 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/communication/RadioService.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/communication/RadioService.cs @@ -50,6 +50,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.communication if (decoded.IsOk) { string asciiPayload = decoded.GetAsciiPayload(); + iHead.SerialNr = asciiPayload; if (iHead.ConfigStruct != null) // store mechanism { iHead.ConfigStruct.PCBNumberString = asciiPayload; diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index ecf9ed721..638c1a2eb 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -65,6 +65,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication FailedSetActiveMode, /// 1AH = 26 FailedWriteCalibrationFactor,/// 1BH = 27 FailedWriteRegister,/// 1CH = 28 + FailedPrepare, /// 1DH = 29 } @@ -818,7 +819,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication else if (currentActivity.ToLower().Equals(SlotSetActiveModeStr.ToLower()))error = SlotSetActiveMode(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotDisconnectStr.ToLower())) error = SlotDisconnect(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(PrepareSlotQ3CalibrationStr.ToLower())) error = PrepareSlotQ3Calibration(threadID, ihead,wm, currentTest, tests , ref resultStr); - else if (currentActivity.ToLower().Equals(WriteSlotQ3CalibrationStr.ToLower())) error = WriteSlotQ3Calibration(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(WriteSlotQ3CalibrationStr.ToLower())) error = WriteSlotQ3Calibration(threadID, ihead, wm, currentTest, tests, ref resultStr); else if (currentActivity.ToLower().Equals(CheckMeterPrepareStr.ToLower())) error = CheckMeterPrepare(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Contains(ReadSerialNrStr.ToLower())) error = ReadSerialNr(threadID, ihead, ref resultStr); @@ -876,9 +877,11 @@ namespace TBF.Rig.TestMethods.iPerlCommunication (error == CommErr.FailedSetTestMode)|| (error == CommErr.FailedSetActiveMode)|| (error == CommErr.FailedWriteRegister)|| - (error == CommErr.FailedWriteCalibrationFactor)) + (error == CommErr.FailedWriteCalibrationFactor) || + (error == CommErr.FailedPrepare) + ) { - OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr0, ihead, wm, resultStr, CommErr.FailedInit)); + OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr0, ihead, wm, resultStr, error)); } else if (ihead.CommFailed || (error == CommErr.CommFailed)) { @@ -1024,57 +1027,104 @@ namespace TBF.Rig.TestMethods.iPerlCommunication private CommErr PrepareSlotQ3Calibration(int threadId, GenesisSmartReader iHead, WaterMeter wm, Test currentTest, IList tests, ref string resultStr) { - CommErr error = CommErr.FailedLogin; + CommErr error = CommErr.FailedPrepare; //TODO BUMI get Next test method - Test NextTest = null; - bool bNextChatch = false; - foreach (Test test in tests) + log.InfoFormat("PrepareSlotQ3Calibration() threadId={0}", threadId); + + try { - if (test.Equals(currentTest)) + Test NextTest = null; + bool bNextChatch = false; + foreach (Test test in tests) { - bNextChatch = true; - continue; + if (test.Equals(currentTest)) + { + bNextChatch = true; + continue; + } + + if (bNextChatch) + { + NextTest = test; + break; + } } - if (bNextChatch) + if (NextTest == null) { - NextTest = test; - break; + log.Error("No next test method found, we use the current test method"); + NextTest = currentTest; } - } - - var gciFullLoginResult = iHead.OptoHeadTest.PrepareQ3Calibration(cfg,NextTest); - if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) + + var gciFullLoginResult = iHead.OptoHeadTest.PrepareQ3Calibration(cfg, NextTest, wm); + if (!string.IsNullOrEmpty(resultStr) && + resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) + { + log.DebugFormat("PrepareQ3Calibration successfull threadId={0}", threadId); + resultStr = string.Format($"Write Q3 Calibration: OK"); + // note Q3 calibration is done + error = CommErr.None; + } + else + { + resultStr = "Write Q3 Calibration: Failed"; + } + + return error; + }catch (Exception ex) { - log.Debug("SlotLogin successful"); - resultStr = string.Format($"Write Q3 Calibration: OK"); - // note Q3 calibration is done - error = CommErr.None; + log.ErrorFormat("PrepareSlotQ3Calibration() threadId={0}, Error: {1}", threadId, ex.Message); + return CommErr.FailedPrepare; } - else - { - resultStr = "Write Q3 Calibration: Failed"; - } - return error; } - private CommErr WriteSlotQ3Calibration(int threadId, GenesisSmartReader iHead, ref string resultStr) + private CommErr WriteSlotQ3Calibration(int threadId, GenesisSmartReader iHead, WaterMeter wm, + Test currentTest, IList tests, ref string resultStr) { CommErr error = CommErr.FailedWriteCalibrationFactor; - var gciFullLoginResult = iHead.OptoHeadTest.WriteQ3Calibration(); - if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) + log.DebugFormat("WriteSlotQ3Calibration() threadId={0}, iHead: {1}, wm: {2}, currentTest: {3}, tests: {4}", threadId, iHead?.Name, wm?.Id, currentTest?.Name, tests?.Count); + //TODO BUMI get Before test method + try { - log.Debug("SlotLogin successful"); - resultStr = string.Format($"Write Q3 Calibration: OK"); - // note Q3 calibration is done - error = CommErr.None; + Test BeforeTest = null; + + foreach (Test test in tests) + { + if (test.Equals(currentTest)) + { + break; + } + + BeforeTest = test; + } + + if (BeforeTest == null) + { + BeforeTest = currentTest; + } + + var gciFullLoginResult = iHead.OptoHeadTest.WriteQ3Calibration(cfg, BeforeTest, wm); + if (!string.IsNullOrEmpty(resultStr) && + resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) + { + log.Debug("SlotLogin successful"); + resultStr = string.Format($"Write Q3 Calibration: OK"); + // note Q3 calibration is done + error = CommErr.None; + } + else + { + resultStr = "Write Q3 Calibration: Failed"; + } + + return error; } - else + catch (Exception ex) { - resultStr = "Write Q3 Calibration: Failed"; + log.ErrorFormat("WriteSlotQ3Calibration() threadId={0}, Error: {1}", threadId, ex.Message); + return CommErr.FailedWriteCalibrationFactor; } - return error; } private CommErr SlotGroupedLogin(int threadId, GenesisSmartReader iHead, ref string resultStr) @@ -1083,8 +1133,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication var gciFullLoginResult = iHead.OptoHeadTest.GroupedLoginSlot(); if (gciFullLoginResult.Success) { - log.Debug("SlotLogin successful"); + log.Debug($"SlotLogin Head:{iHead.Name} successful, PCB: {gciFullLoginResult?.PcbResult?.Result?.PcbId}"); resultStr = string.Format($"Login OK - Serial No: {gciFullLoginResult?.PcbResult?.Result?.PcbId}"); + log.Debug($"Setting PCB: {gciFullLoginResult?.PcbResult?.Result?.PcbId} for Head: {iHead.Name}"); iHead.SerialNr = gciFullLoginResult?.PcbResult?.Result?.PcbId; if (iHead.ConfigStruct != null) { @@ -1190,8 +1241,16 @@ namespace TBF.Rig.TestMethods.iPerlCommunication PcbReadResult pcbReadSlot = iHead.OptoHeadTest.PCB_ReadSlot(); if (pcbReadSlot.Success) { - log.Debug("SlotPCBSlot successful"); - resultStr = string.Format($"SlotPCBSlot: {pcbReadSlot.PcbId}"); + var pcbId = pcbReadSlot?.PcbId; + log.Debug($"SlotPCBSlot Head:{iHead.Name} successful, PCB:{pcbId}"); + resultStr = string.Format($"SlotPCBSlot: {pcbId}"); + if (!string.IsNullOrWhiteSpace(pcbId)) + { + log.Debug($"Setting PCB: {pcbId} for Head: {iHead.Name}"); + iHead.SerialNr = pcbId; + if (iHead.ConfigStruct != null) iHead.ConfigStruct.PCBNumberString = pcbId; + } + error = CommErr.None; } else @@ -1256,7 +1315,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication CommErr error = CommErr.Read; var result = ihead.OptoHeadTest.ReadRequest_PCB(); - if (string.IsNullOrEmpty(result)) + if (!string.IsNullOrEmpty(result)) { log.Debug("ReadSerialNr successful"); resultStr = string.Format($"Serial No: {result}"); @@ -1612,6 +1671,17 @@ namespace TBF.Rig.TestMethods.iPerlCommunication checkBoxes[data.WMNr0].Checked = true; checkBoxes[data.WMNr0].Enabled = false; } + // else if (data.WMNr0 >= 0 && data.CommErr != CommErr.None) + // { + // //disable if error + // ckbState[data.WMNr0] = false; + // checkBoxes[data.WMNr0].Checked = false; + // checkBoxes[data.WMNr0].Enabled = false; + // if (data.Ihead != null) data.Ihead.Disabled = true; + // if (data.Wm != null) data.Wm.Disabled = true; + // //color + // if (counters.Length > data.WMNr0) counters[data.WMNr0].BackColor = OptoNokColor; + // } /// /// Update opto-communication indication diff --git a/TBFTests/DBTest.cs b/TBFTests/DBTest.cs index fe17d476e..1c74c06d6 100644 --- a/TBFTests/DBTest.cs +++ b/TBFTests/DBTest.cs @@ -107,6 +107,7 @@ namespace TBFTests CalibFactorIndex = 1, BaseCalibFactor = 15625, CalculatedCalibFactor = 17969, + IsCalibFactorValid = true, Stored = true, ErrorStr = "OK", TimeStart = 1.1, @@ -142,6 +143,7 @@ namespace TBFTests Assert.AreEqual(1, loadedCalib.CalibFactorIndex); Assert.AreEqual(15625, loadedCalib.BaseCalibFactor); Assert.AreEqual(17969, loadedCalib.CalculatedCalibFactor); + Assert.IsTrue(loadedCalib.IsCalibFactorValid); Assert.IsTrue(loadedCalib.Stored); Assert.AreEqual("OK", loadedCalib.ErrorStr); } diff --git a/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs index 117ffa184..73fc738e2 100644 --- a/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs +++ b/TBFTests/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTestImpelementations.cs @@ -1,14 +1,11 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; -using Config.Entities; -using GenesisCordonelInterface.API; using JetBrains.Annotations; using Microsoft.VisualStudio.TestTools.UnitTesting; -using TBF.Rig.BridgeComponents.GciBridge; +using Results.Entities; using TBF.Rig.RegisterReaders.GenesisRegReader.communication; using TBF.Rig.RegisterReaders.GenesisRegReader.implementations; -using TBF.Rig.Sequences; using TBF.Rig.TestMethods.GenesisCommunication; namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.communication @@ -91,34 +88,50 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.communication [TestMethod] public void PrepareQ3Calibration_SimulateMode_ReturnsOk() { - // ARRANGE - GenesisSmartReader reader = new GenesisSmartReader - { - DebugLevel = Common.DebugMode.Simulate - }; + Factory factory = new Factory(); + GenesisSmartReader reader = new GenesisSmartReader(factory.DefaultConfig()); + reader.DebugLevel = Common.DebugMode.Simulate; OptoHeadTest optoHeadTest = new OptoHeadTest(reader); - TestMethodCfg cfg = new TestMethodCfg(null) - { - CalibFactor6InchCh1 = 17969, - CalibFactor6InchCh2 = 17969, - CalibFactor6InchCh3 = 17969 - }; + string result = optoHeadTest.PrepareQ3Calibration(null, null, null); - Test test = new Test - { - Name = "Q3Channel", - Part = 1 - }; - - // ACT - string result = optoHeadTest.PrepareQ3Calibration(cfg, test); - - // ASSERT - Assert.AreEqual(OptoHeadTest.ResultOk, result); + Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual( + OptoHeadTest.ResultOk, + result); } - + [TestMethod] + public void PrepareQ3Calibration_TestStoreDB() + { + GenesisSmartReader reader = new GenesisSmartReader(); + + Results.Entities.TestRslt tstRslt = new Results.Entities.TestRslt(); + + Assert.IsNotNull(tstRslt.CalibFactorResultsToSave); + tstRslt.CalibFactorResultsToSave.Clear(); + + Assert.AreEqual(0, tstRslt.CalibFactorResultsToSave.Count); + + if (tstRslt?.CalibFactorResultsToSave?.Count == 0) + { + for (int i = 0; i < reader.ChannelsCount; i++) + { + tstRslt.CalibFactorResultsToSave.Add(new TestRsltCalibFactor() + { + Stored = false, + CalibFactorIndex = i + }); + } + } + + Assert.AreEqual(reader.ChannelsCount, tstRslt.CalibFactorResultsToSave.Count); + + for (int i = 0; i < reader.ChannelsCount; i++) + { + Assert.IsFalse(tstRslt.CalibFactorResultsToSave[i].Stored); + Assert.AreEqual(i, tstRslt.CalibFactorResultsToSave[i].CalibFactorIndex); + } + } } } \ No newline at end of file diff --git a/TBFTests/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader_Q3Test.cs b/TBFTests/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader_Q3Test.cs index 71830e2be..b9c998d24 100644 --- a/TBFTests/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader_Q3Test.cs +++ b/TBFTests/Rig/RegisterReaders/GenesisRegReader/implementations/GenesisSmartReader_Q3Test.cs @@ -22,12 +22,15 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(ValidInitFactors); sut.GetQ3Calibration( - refVolume: 1000.0, - refTime: 120.0, - initCalibFactor: ValidInitFactors, + 200.0, + 120.0, + ValidInitFactors, ref valid, + ref calibDiff, ref calib); Assert.IsFalse(sut.Q3CalibValid); @@ -47,12 +50,15 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(ValidInitFactors); sut.GetQ3Calibration( - refVolume: 1000.0, - refTime: 120.0, - initCalibFactor: ValidInitFactors, + 200.0, + 120.0, + ValidInitFactors, ref valid, + ref calibDiff, ref calib); Assert.IsFalse(sut.Q3CalibValid); @@ -70,13 +76,16 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; sut.GetQ3Calibration( refVolume: 0.0, refTime: 120.0, initCalibFactor: ValidInitFactors, ref valid, - ref calib); + ref calibDiff, + ref calib + ); Assert.IsFalse(sut.Q3CalibValid); CollectionAssert.AreEqual(new[] { false, false, false }, valid); @@ -93,13 +102,17 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(ValidInitFactors); sut.GetQ3Calibration( refVolume: 1000.0, refTime: 0.0, initCalibFactor: ValidInitFactors, ref valid, - ref calib); + ref calibDiff, + ref calib + ); Assert.IsFalse(sut.Q3CalibValid); CollectionAssert.AreEqual(new[] { false, false, false }, valid); @@ -117,13 +130,17 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var init = new[] { 0.0, 0.0, 0.0 }; var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(ValidInitFactors); sut.GetQ3Calibration( refVolume: 1000.0, refTime: 120.0, initCalibFactor: init, ref valid, - ref calib); + ref calibDiff, + ref calib + ); Assert.IsFalse(sut.Q3CalibValid); CollectionAssert.AreEqual(new[] { false, false, false }, valid); @@ -173,14 +190,19 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var init = new[] { 15625.0, 15625.0, 15625.0 }; var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(init); + sut.GetQ3Calibration( refVolume: 200.0, refTime: 120.0, initCalibFactor: init, ref valid, - ref calib); - + ref calibDiff, + ref calib + ); + double expectedCh1 = (200.0 / 600.0) * 15625.0; double expectedCh2 = (200.0 / 600.0) * 15625.0; double expectedCh3 = (200.0 / 560.0) * 15625.0; @@ -220,12 +242,15 @@ namespace TBFTests.Rig.RegisterReaders.GenesisRegReader.implementations var init = new[] { 15625.0, 15625.0, 15625.0 }; var valid = new bool[3]; var calib = new double[3]; + var calibDiff = new double[3]; + sut.SetQ3Calibration(init); sut.GetQ3Calibration( - refVolume: 200.0, - refTime: 120.0, - initCalibFactor: init, + 200.0, + 120.0, + init, ref valid, + ref calibDiff, ref calib); Assert.IsTrue(valid[0], $"Ch1 invalid, value={calib[0]}"); diff --git a/packages/Common/Logic.ProductionToProductMapper.dll b/packages/Common/Logic.ProductionToProductMapper.dll index 88c200382..699a1e309 100644 Binary files a/packages/Common/Logic.ProductionToProductMapper.dll and b/packages/Common/Logic.ProductionToProductMapper.dll differ diff --git a/packages/Common/Logic.ProductionToProductMapper.pdb b/packages/Common/Logic.ProductionToProductMapper.pdb index ec93fbf6c..26ff63747 100644 Binary files a/packages/Common/Logic.ProductionToProductMapper.pdb and b/packages/Common/Logic.ProductionToProductMapper.pdb differ diff --git a/packages/Common/Xylem.Common.CommonCore.Configuration.dll b/packages/Common/Xylem.Common.CommonCore.Configuration.dll index 25135f13c..76cafbdfd 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.Configuration.dll and b/packages/Common/Xylem.Common.CommonCore.Configuration.dll differ diff --git a/packages/Common/Xylem.Common.CommonCore.Configuration.pdb b/packages/Common/Xylem.Common.CommonCore.Configuration.pdb index b71cc76c9..d691b15c0 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.Configuration.pdb and b/packages/Common/Xylem.Common.CommonCore.Configuration.pdb differ diff --git a/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.dll b/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.dll index cd1e1170b..baeb443c8 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.dll and b/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.dll differ diff --git a/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.pdb b/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.pdb index 28b96a70d..4544419c6 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.pdb and b/packages/Common/Xylem.Common.CommonCore.ThreadWatcher.pdb differ diff --git a/packages/Common/Xylem.Common.CommonCore.dll b/packages/Common/Xylem.Common.CommonCore.dll index 06e35d5ef..55bcd0e2d 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.dll and b/packages/Common/Xylem.Common.CommonCore.dll differ diff --git a/packages/Common/Xylem.Common.CommonCore.pdb b/packages/Common/Xylem.Common.CommonCore.pdb index a0e848b8d..dc4c54ec9 100644 Binary files a/packages/Common/Xylem.Common.CommonCore.pdb and b/packages/Common/Xylem.Common.CommonCore.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll index fac9c774a..460d7f88c 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll and b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.pdb b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.pdb index 3fa669f90..c52e6de6e 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.pdb and b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.PortCore.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll index 7ee0cca57..f1809fa43 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll and b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.pdb b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.pdb index e7ec5ed29..9b489d72b 100644 Binary files a/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.pdb and b/packages/Common/Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll index 9f3cf8c9a..d5d3a399b 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 801938861..3fc6a4c90 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.Applications.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll index 37544ecae..c87574ee9 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.pdb index 22b667603..c7111d8ce 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Applications.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 466b38b3c..7b90d2838 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 90bae6ea6..4d0a2ca58 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.GenesisConfig.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll index 7a30bf3a3..ce7536896 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.pdb index b23a868f4..4cf677d13 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll index a6d4fb135..c55bc3e5d 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.pdb index c070c1224..0338b9302 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.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 a480b765f..5d998840f 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 fe2cfeae7..64055834c 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.GenesisPwd.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll index d5cd6d80c..a3f824943 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.dll 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 426fd7cf5..1b7b771d9 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 84822d663..33f072449 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 d92c5b2a0..7ba6b66d6 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 cdb91245f..b23250201 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.Hardware.WaterMeter.Genesis.Registers.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll index cdd002a38..dff364b13 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.pdb index 8cef354c9..0c2930a50 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.Registers.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll index 7b09f4020..b6bc3f1f0 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.pdb index d32b4e9be..97d0e8e2d 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterCore.pdb differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll index 9256f9069..7106914ec 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll and b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.dll differ diff --git a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.pdb b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.pdb index ed2fb70bd..a1029760b 100644 Binary files a/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.pdb and b/packages/Common/Xylem.Common.Hardware.WaterMeter.WaterMeterRegisters.pdb differ diff --git a/packages/Common/Xylem.Common.Logic.ProductionOrderCore.dll b/packages/Common/Xylem.Common.Logic.ProductionOrderCore.dll index 522956b23..662d87f18 100644 Binary files a/packages/Common/Xylem.Common.Logic.ProductionOrderCore.dll and b/packages/Common/Xylem.Common.Logic.ProductionOrderCore.dll differ diff --git a/packages/Common/Xylem.Common.Logic.ProductionOrderCore.pdb b/packages/Common/Xylem.Common.Logic.ProductionOrderCore.pdb index d04412073..7a96d83db 100644 Binary files a/packages/Common/Xylem.Common.Logic.ProductionOrderCore.pdb and b/packages/Common/Xylem.Common.Logic.ProductionOrderCore.pdb differ diff --git a/packages/Common/Xylem.Common.Logic.RelatePcb.dll b/packages/Common/Xylem.Common.Logic.RelatePcb.dll index b38b4c1aa..f03077b30 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 899ca2d1d..8f12868f4 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 e45eae2c7..d1ac66c31 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 de4d9e758..b44511224 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.Logic.SoftwareAccessHelper.dll b/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.dll index a1f00bc1b..16cb9fb9e 100644 Binary files a/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.dll and b/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.dll differ diff --git a/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.pdb b/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.pdb index 74d029f6f..356a73c72 100644 Binary files a/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.pdb and b/packages/Common/Xylem.Common.Logic.SoftwareAccessHelper.pdb differ diff --git a/packages/Common/Xylem.Common.Metrology.Measurements.dll b/packages/Common/Xylem.Common.Metrology.Measurements.dll index 394ad4b82..6eb5448e3 100644 Binary files a/packages/Common/Xylem.Common.Metrology.Measurements.dll and b/packages/Common/Xylem.Common.Metrology.Measurements.dll differ diff --git a/packages/Common/Xylem.Common.Metrology.Measurements.pdb b/packages/Common/Xylem.Common.Metrology.Measurements.pdb index 03d01d0fc..71e6fb631 100644 Binary files a/packages/Common/Xylem.Common.Metrology.Measurements.pdb and b/packages/Common/Xylem.Common.Metrology.Measurements.pdb differ diff --git a/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb b/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb index d7a54b8e0..275d6ba8e 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 d829df7de..01da14bff 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 c41ce5b0e..474596d0e 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/Xylem.Common.Utils.ByteArrayStyle.dll b/packages/Common/Xylem.Common.Utils.ByteArrayStyle.dll index 781af6297..6c7c24e9f 100644 Binary files a/packages/Common/Xylem.Common.Utils.ByteArrayStyle.dll and b/packages/Common/Xylem.Common.Utils.ByteArrayStyle.dll differ diff --git a/packages/Common/Xylem.Common.Utils.ByteArrayStyle.pdb b/packages/Common/Xylem.Common.Utils.ByteArrayStyle.pdb index 521955454..230852745 100644 Binary files a/packages/Common/Xylem.Common.Utils.ByteArrayStyle.pdb and b/packages/Common/Xylem.Common.Utils.ByteArrayStyle.pdb differ diff --git a/packages/Common/Xylem.Common.Utils.Crc16Ccitt.dll b/packages/Common/Xylem.Common.Utils.Crc16Ccitt.dll index f5a0be2bc..a97e259cb 100644 Binary files a/packages/Common/Xylem.Common.Utils.Crc16Ccitt.dll and b/packages/Common/Xylem.Common.Utils.Crc16Ccitt.dll differ diff --git a/packages/Common/Xylem.Common.Utils.Crc16Ccitt.pdb b/packages/Common/Xylem.Common.Utils.Crc16Ccitt.pdb index e4dbe2ca7..0359508da 100644 Binary files a/packages/Common/Xylem.Common.Utils.Crc16Ccitt.pdb and b/packages/Common/Xylem.Common.Utils.Crc16Ccitt.pdb differ diff --git a/packages/Common/Xylem.Common.Utils.Logging.dll b/packages/Common/Xylem.Common.Utils.Logging.dll index 3dfdf0851..2750d77bf 100644 Binary files a/packages/Common/Xylem.Common.Utils.Logging.dll and b/packages/Common/Xylem.Common.Utils.Logging.dll differ diff --git a/packages/Common/Xylem.Common.Utils.Logging.pdb b/packages/Common/Xylem.Common.Utils.Logging.pdb index d02503b0b..bd634de0b 100644 Binary files a/packages/Common/Xylem.Common.Utils.Logging.pdb and b/packages/Common/Xylem.Common.Utils.Logging.pdb differ diff --git a/packages/Common/Xylem.Common.Utils.ProcessExec.dll b/packages/Common/Xylem.Common.Utils.ProcessExec.dll index bc8d6ccfc..083aaff86 100644 Binary files a/packages/Common/Xylem.Common.Utils.ProcessExec.dll and b/packages/Common/Xylem.Common.Utils.ProcessExec.dll differ diff --git a/packages/Common/Xylem.Common.Utils.ProcessExec.pdb b/packages/Common/Xylem.Common.Utils.ProcessExec.pdb index f9fc22655..fa8150c9c 100644 Binary files a/packages/Common/Xylem.Common.Utils.ProcessExec.pdb and b/packages/Common/Xylem.Common.Utils.ProcessExec.pdb differ diff --git a/packages/Common/XylemCommonUiLegacyGenCtl.dll b/packages/Common/XylemCommonUiLegacyGenCtl.dll index 820e1b041..aebcf5d42 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 bdad89171..5dd6c53c4 100644 Binary files a/packages/Common/XylemCommonUiLegacyGenCtl.pdb and b/packages/Common/XylemCommonUiLegacyGenCtl.pdb differ