From 07f2d97b91aa014f587b9ab7c0438550195dd8e2 Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Mon, 13 Oct 2025 15:08:53 +0200 Subject: [PATCH] ProductionUiCordonel: - check final params after RSSI test --- .../EolProcesses/CheckFinalParametrization.cs | 4 +++- .../EolProcesses/CheckRadio.cs | 11 +++++++--- .../EolProcesses/EolProcessStatesDef.cs | 22 +++++++++---------- .../EolProcesses/ExecFinalParametrization.cs | 2 +- .../EolProcesses/ExecPasswordFile.cs | 2 +- .../EolProcesses/ExecRebootCordonel.cs | 4 ++-- .../EolProcesses/ExecStoreConfiguration.cs | 2 +- .../ProductionProcesses/ProcessController.cs | 22 ++++++++++--------- 8 files changed, 39 insertions(+), 30 deletions(-) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs index e0a96779..0597f89e 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs @@ -70,7 +70,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // Access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); @@ -95,9 +95,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (retValBol) { EolProgress.ParametrizationCompareChecked = EOLStatus.OK; + Meter?.Logout(); return StatusReturn.Okay; } EolProgress.ParametrizationCompareChecked = EOLStatus.FAIL; + Meter?.Logout(); return StatusReturn.Failed; } catch (Exception ex) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 149a9e0f..b08247ed 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -223,7 +223,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { return SetTestFailed(Resources.StrErrorMsgCordonelLogin); @@ -328,12 +328,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr if (!SIRTServer.StartProgramming(Convert.ToInt32(freq), _radioAddressCordonel, meterEncryptionKey)) { + SIRTServer.Dispose(); return SetTestFailed(Resources.StrErrorMsgServiceSirtProgramming); } + SIRTServer.Dispose(); } catch (Exception ex) { - ErrorMsgDispatcher(ex.Message); + SIRTServer.Dispose(); + return SetTestFailed(ex.Message); } } else @@ -458,8 +461,10 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr EolProgress.RadioCheckId = _radioResultCheckId; EolProgress.FinalRadioSystemState = _finalRadioSystemState; - // Essential to logout from meter at any exit + // Essential to logout from meter at any exit to give the radio app the chance + // to access the parameters and config file Meter?.Logout(); + Thread.Sleep(1000); _stateMachine?.Stop(); _stateMachine = null; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs index 2136da04..75ad3d5e 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStatesDef.cs @@ -214,16 +214,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr processState: ProcessState.RebootCordonel, processInfo: Resources.StrStateRebootCordonel, productionProcessNo: 8, - nextStateOnSuccess: ProcessState.CheckFinalParametrization), - - // Precondition: - The reboot process including the store all configurations has to be - // completed. - // Check final configuration has to be executed exclusively with automatic - new ProcessStateStruct( - productionProcess: new CheckFinalParametrization(Resources.StrStateCheckParametrization), - processState: ProcessState.CheckFinalParametrization, - processInfo: Resources.StrStateCheckParametrization, - productionProcessNo: 9, nextStateOnSuccess: ProcessState.CheckRadio), // Precondition: - The final parametrization, reboot process including the store all @@ -234,9 +224,19 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr productionProcess: new CheckRadio(Resources.StrStateRadioCheck), processState: ProcessState.CheckRadio, processInfo: Resources.StrStateRadioCheck, + productionProcessNo: 9, + nextStateOnSuccess: ProcessState.CheckFinalParametrization), + + // Precondition: - The reboot process including the store all configurations has to be + // completed. + // Check final configuration has to be executed exclusively with automatic + new ProcessStateStruct( + productionProcess: new CheckFinalParametrization(Resources.StrStateCheckParametrization), + processState: ProcessState.CheckFinalParametrization, + processInfo: Resources.StrStateCheckParametrization, productionProcessNo: 10, nextStateOnSuccess: ProcessState.CheckOrderNumber), - + // This scans the order number, it has to be executed exclusively with automatic new ProcessStateStruct( productionProcess: new CheckOrderNumber(Resources.StrStateCheckOrderNumber), diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs index 1738e883..d72ac822 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecFinalParametrization.cs @@ -92,7 +92,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs index 19c02e65..0a0a3789 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecPasswordFile.cs @@ -186,7 +186,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr ucPwd.UpdateImage(ucPwd.imgWriteToMeter, ImgState.Active); if (!Meter.IsLoggedOn) - Meter.Login(); + Meter.ReLogin(); // Install and check password file var retryCtr = 2; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs index df0067df..c102fe5a 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs @@ -69,7 +69,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); @@ -98,7 +98,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs index b8694a26..8123bc65 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecStoreConfiguration.cs @@ -44,7 +44,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr // access to meter requires login if (!Meter.IsLoggedOn) { - Meter.Login(); + Meter.ReLogin(); if (!Meter.IsLoggedOn) { ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs index be4f394d..6fe00b63 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs @@ -457,7 +457,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses } } } - + /// /// Returns the currentGenesis information for display /// @@ -469,7 +469,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses { return _cordonelRequirements; } - + /// /// Returns the currentGenesis information for display /// @@ -481,8 +481,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses { return _genesisMeter; } - - + + /// /// Clears all collected data on new genesisMeter and reminds the detected for next /// detection and run of this comparison. @@ -526,7 +526,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses InitNewMeter(); InitProcesses(ppNo); ResetCancellationToken(); - + // Remind actual genesis for next call _lastPcbId = _genesisMeter?.PcbId; @@ -584,7 +584,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses return state; } - + /// /// Error handler /// @@ -615,6 +615,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses pp.RetryProcess(); pp = _processStateDef.GetProcessOfState(ProcessState.RebootCordonel); pp.RetryProcess(); + pp = _processStateDef.GetProcessOfState(ProcessState.CheckRadio); + pp.RetryProcess(); pp = _processStateDef.GetProcessOfState(ProcessState.CheckFinalParametrization); pp.RetryProcess(); } @@ -635,7 +637,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses OnProcessProgressChanged?.Invoke(this, new ProcessProgressArgs(_maxOverallProcessesSteps, ProcessProgressArgs.ProcessProgressType.MaxOverallProcessSteps)); } - + /// /// Calculate all processes which are completed or skipped and signal to GUI. /// @@ -682,9 +684,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses process.IdleProcess(); // All processes from and behind this process will be killed to kep the preceding as is - else if ( _processStateDef.GetProductionProcessNoOfProcess(process) >= productionProcessNo) + else if (_processStateDef.GetProductionProcessNoOfProcess(process) >= productionProcessNo) process.IdleProcess(); - + // Add process to list to feed the process window in main screen if (Processes.All(pp => pp.ProcessName != process.ProcessName)) { @@ -928,7 +930,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses if (productionProcessNo == null) pp.IdleProcess(); // All processes from and behind this process will be killed to kep the preceding as is - else if ( _processStateDef.GetProductionProcessNoOfProcess(pp) >= productionProcessNo) + else if (_processStateDef.GetProductionProcessNoOfProcess(pp) >= productionProcessNo) pp.IdleProcess(); } }