diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index a33146063..fd14b048f 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.3095.1")] -[assembly: AssemblyFileVersion("3.9.3095.1")] +[assembly: AssemblyVersion("3.9.3097.1")] +[assembly: AssemblyFileVersion("3.9.3097.1")] diff --git a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs index e0d1c0360..8a3e13479 100644 --- a/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs +++ b/TBF/Rig/RegisterReaders/GenesisRegReader/communication/OptoHeadTest.cs @@ -1260,6 +1260,80 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication return ex.Message; } } + + public BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult GroupedLoginSlot() + { + if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) + { + log.Debug("Connect() - Simulated response"); + return new BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult + { + SlotId = genesisHead.GetSlotNr, + Success = true, + Message = "Simulated Connect", + ConnectResult = null, + PcbResult = null, + PasswordResult = null, + SetPasswordResult = null, + LoginResult = null, + }; + } + + var gciFullLoginResult = Task.Run(() => GroupedLoginSlot_Async(genesisHead)) + .GetAwaiter() + .GetResult(); + + return gciFullLoginResult; + } + + public string GroupedLoginSlotStr() + { + if (genesisHead != null && genesisHead.DebugLevel == DebugMode.Simulate) + { + log.Debug("Connect() - Simulated response"); + return "Simulated Connect"; + } + + var gciFullLoginResult = Task.Run(() => GroupedLoginSlot_Async(genesisHead)) + .GetAwaiter() + .GetResult(); + + return gciFullLoginResult.Success ? ResultOk : ResultNok; + } + + private async Task GroupedLoginSlot_Async(GenesisSmartReader genesisSmartReader) + { + try + { + log.Debug("GroupedLoginSlot_Async called for iHead: " + genesisHead); + + var gciFullLoginResult = new BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult() + { + Success = false, + }; + + if (genesisHead == null) return gciFullLoginResult; + if (string.IsNullOrEmpty(genesisHead.CommInterface)) return gciFullLoginResult; + if (genesisHead.CommInterfaceBridge == null) return gciFullLoginResult; + + CancellationToken token = default; + + log.Debug($"GroupedLoginSlot_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start"); + BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult connectFullPassLoginWithRetryAsync = await genesisSmartReader.CommInterfaceBridge.ConnectFullPassLoginWithRetryAsync(genesisSmartReader.GetSlotNr, token); + log.Debug($"GroupedLoginSlot_Async( Slot: {genesisSmartReader.GetSlotNr}) - Result: " + connectFullPassLoginWithRetryAsync); + + return connectFullPassLoginWithRetryAsync; + } + catch (Exception ex) + { + log.Error($"GroupedLoginSlot_Async({genesisHead.GetSlotNr}) - Exception:", ex); + return new BridgeComponents.GciBridge.Interfaces.PublicModels.GciFullLoginResult() + { + Success = false, + Message = ex.Message + }; + } + } public string SetTestModeSlot() { @@ -1291,7 +1365,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication byte valueLed = (ledMode == LedState.active) ? (byte)6 : (byte)0; log.Debug($"SetTestModeSlot_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set Led Mode: {valueLed}"); - var registerWriteResult = await gciBridge.WriteRegisterAsync(genesisSmartReader.GetSlotNr, RadioService.LedMode, valueLed, false, false, token); + var registerWriteResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.LedMode, valueLed, false, false, token); if (registerWriteResult == null || !registerWriteResult.Success) { @@ -1342,7 +1416,7 @@ namespace TBF.Rig.RegisterReaders.GenesisRegReader.communication log.Debug( $"SetActiveModeSlot_Async( Slot: {genesisSmartReader.GetSlotNr}) - Start - Set Led Mode: {valueLed}"); - var registerWriteResult = await gciBridge.WriteRegisterAsync(genesisSmartReader.GetSlotNr, + var registerWriteResult = await gciBridge.WriteRegisterWithRetryAsync(genesisSmartReader.GetSlotNr, RadioService.LedMode, valueLed, false, false, token); if (registerWriteResult == null || !registerWriteResult.Success) diff --git a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs index 707655dc5..f7df5b824 100644 --- a/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs +++ b/TBF/Rig/TestMethods/GenesisCommunication/iPerlCommunicationParams.cs @@ -57,6 +57,7 @@ namespace TBF.Rig.TestMethods.GenesisCommunication retVal.Add(iPerlCommunicationForm.SlotPCBSlotStr); retVal.Add(iPerlCommunicationForm.SlotSetPasswordStr); retVal.Add(iPerlCommunicationForm.SlotLoginStr); + retVal.Add(iPerlCommunicationForm.SlotGroupedLoginStr); retVal.Add(iPerlCommunicationForm.SlotSetTestModeStr); retVal.Add(iPerlCommunicationForm.SlotSetActiveModeStr); retVal.Add(iPerlCommunicationForm.SlotDisconnectStr); diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index c17db2c1c..e784a4e34 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -83,6 +83,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication public const string SlotPCBSlotStr = "PCB Slot"; public const string SlotSetPasswordStr = "Set Password"; public const string SlotLoginStr = "Login"; + public const string SlotGroupedLoginStr = "Login (Combined workflow)"; public const string SlotSetTestModeStr = "Switch to Test Mode"; public const string SlotSetActiveModeStr ="Switch to Active Mode"; public const string SlotDisconnectStr = "Disconnect Slot"; @@ -752,6 +753,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication else if (currentActivity.ToLower().Equals(SlotPCBSlotStr.ToLower())) error = SlotPCBSlot(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotSetPasswordStr.ToLower())) error = SlotSetPassword(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotLoginStr.ToLower())) error = SlotLogin(threadID, ihead, ref resultStr); + else if (currentActivity.ToLower().Equals(SlotGroupedLoginStr.ToLower())) error = SlotGroupedLogin(threadID, ihead, ref resultStr); else if (currentActivity.ToLower().Equals(SlotSetTestModeStr.ToLower())) error = SlotSetTestMode(threadID, ihead, ref resultStr); 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); @@ -853,6 +855,28 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } } + private CommErr SlotGroupedLogin(int threadId, GenesisSmartReader iHead, ref string resultStr) + { + CommErr error = CommErr.FailedLogin; + var gciFullLoginResult = iHead.OptoHeadTest.GroupedLoginSlot(); + if (gciFullLoginResult.Success) + { + log.Debug("SlotLogin successful"); + resultStr = string.Format($"Login OK - Serial No: {gciFullLoginResult?.PcbResult?.Result?.PcbId}"); + iHead.SerialNr = gciFullLoginResult?.PcbResult?.Result?.PcbId; + if (iHead.ConfigStruct != null) + { + iHead.ConfigStruct.PCBNumberString = gciFullLoginResult?.PcbResult?.Result?.PcbId; + } + error = CommErr.None; + } + else + { + resultStr = "Failed Combined Login"; + } + return error; + } + private CommErr SlotDisconnect(int threadId, GenesisSmartReader iHead, ref string resultStr) { CommErr error = CommErr.FailedSetActiveMode; @@ -894,12 +918,12 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) { log.Debug("SlotSetTestMode successful"); - resultStr = string.Format($"Serial No: {resultStr}"); + resultStr = string.Format($"SlotSetTestMode: {resultStr}"); error = CommErr.None; } else { - resultStr = "Failed Read Serial No"; + resultStr = "Failed Set Test Mode"; } return error; } @@ -911,12 +935,12 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) { log.Debug("SlotLogin successful"); - resultStr = string.Format($"Serial No: {resultStr}"); + resultStr = string.Format($"SlotLogin: {resultStr}"); error = CommErr.None; } else { - resultStr = "Failed Read Serial No"; + resultStr = "Failed SlotLogin"; } return error; } @@ -928,7 +952,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (!string.IsNullOrEmpty(resultStr) && resultStr.Equals(TBF.Rig.RegisterReaders.GenesisRegReader.communication.OptoHeadTest.ResultOk)) { log.Debug("SlotSetPassword successful"); - resultStr = string.Format($"Serial No: {resultStr}"); + resultStr = string.Format($"SlotSetPassword: {resultStr}"); error = CommErr.None; } else @@ -944,13 +968,13 @@ namespace TBF.Rig.TestMethods.iPerlCommunication PcbReadResult pcbReadSlot = iHead.OptoHeadTest.PCB_ReadSlot(); if (pcbReadSlot.Success) { - log.Debug("SlotSetPassword successful"); - resultStr = string.Format($"Serial No: {pcbReadSlot.PcbId}"); + log.Debug("SlotPCBSlot successful"); + resultStr = string.Format($"SlotPCBSlot: {pcbReadSlot.PcbId}"); error = CommErr.None; } else { - resultStr = "Failed Read Serial No"; + resultStr = "Failed SlotPCBSlot"; } return error; } @@ -961,8 +985,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication resultStr = iHead.OptoHeadTest.ConnectSlot(); if (!string.IsNullOrEmpty(resultStr)) { - log.Debug("SlotSetPassword successful"); - resultStr = string.Format($"Serial No: {resultStr}"); + log.Debug("SlotConnect successful"); + resultStr = string.Format($"SlotConnect: {resultStr}"); error = CommErr.None; } else @@ -984,8 +1008,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication resultStr = iHead.OptoHeadTest.InitialiseSlot(); if (!string.IsNullOrEmpty(resultStr)) { - log.Debug("SlotSetPassword successful"); - resultStr = string.Format($"Serial No: {resultStr}"); + log.Debug("SlotInitialize successful"); + resultStr = string.Format($"SlotInitialize: {resultStr}"); error = CommErr.None; } else diff --git a/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll b/packages/Common/Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol.dll index 38b146974..6a3337e89 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 e0c2c3cbf..ed19fdfc9 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 e7ddaaec0..57f25b3e7 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 61581c582..e9e956721 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.GenesisCore.dll b/packages/Common/Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll index 5b706b52e..17f1fc536 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 4a5e51bd9..3ab9a2360 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 3c816347f..f1c6ed379 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 70f52750b..131e0bccb 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 4a6874bcb..f630f685d 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 8ac02a928..ef168cf95 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 64bd3235a..bd1bf3aba 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 9b492357f..dc9ac5ff9 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 3ea15355e..411a9d3d8 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 a4fe7e9e0..787b490e2 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.Ui.CordonelPreadjustmentUi.pdb b/packages/Common/Xylem.Common.Ui.CordonelPreadjustmentUi.pdb index 883016268..4371bda5b 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 97264edff..15dcc8ebb 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 37fdcfa86..5c5e7b563 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.Logging.dll b/packages/Common/Xylem.Common.Utils.Logging.dll index 59815adab..4a5559fbd 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 1520bd936..6821d10f0 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/XylemCommonUiLegacyGenCtl.dll b/packages/Common/XylemCommonUiLegacyGenCtl.dll index 7ddc6f44d..0bb9c7f7b 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 8ff580c00..c5e9ebef7 100644 Binary files a/packages/Common/XylemCommonUiLegacyGenCtl.pdb and b/packages/Common/XylemCommonUiLegacyGenCtl.pdb differ