ProductionUiCordonel: - reboot counter check skipped on retry if passed at first run

This commit is contained in:
Thomas Wiedebusch 2026-02-12 15:39:57 +01:00
parent bd2daa9f31
commit ea35d1ee75
4 changed files with 43 additions and 12 deletions

View File

@ -77,6 +77,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
public GenesisMeter()
{
SetLogger();
CheckRebootCtr = true;
}
//initially do not signal event
@ -100,6 +101,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
Logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{slot}", "Slot", "Meter", "MeterBase", "MeterBase");
SetupGenesisMeter(slot, requestPort, streamingPort, ignoreCorruptedData, password);
CheckRebootCtr = true;
}
#endregion
@ -195,6 +198,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
get; protected set;
}
/// <inheritdoc />
public Boolean CheckRebootCtr
{
get;
set;
}
/// <inheritdoc />
public List<MeterApplications> MeterAppListVersion
{

View File

@ -25,6 +25,17 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
get;
}
/// <summary>
/// A new meter has to be checked for the reboot counter. On retries the reboot counter
/// may have increased on unsuccessfully after-reboot procedure. This would force failing
/// the 'ConnectCordonel'.
/// </summary>
Boolean CheckRebootCtr
{
get;
set;
}
/// <summary>
/// Interface information
/// </summary>

View File

@ -73,18 +73,27 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Gener
// Read reboot count and compare with hardcoded maximum value
var rebootCount =
RegisterConverter.ByteArrayToValue<UInt32>(Meter.ReadRegister("CUSTOMER_RebootCount"));
if (rebootCount > MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW)
if (Meter.CheckRebootCtr)
{
ErrorMsgDispatcher(Resources.StrErrorMsgTooManyReboots +
$" - {Resources.StrProcessStateAllowed}: {MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW}" +
$" - {Resources.StrProcessStateDetected}: {rebootCount}");
return StatusReturn.Failed;
if (rebootCount > MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW)
{
ErrorMsgDispatcher(Resources.StrErrorMsgTooManyReboots +
$" - {Resources.StrProcessStateAllowed}: {MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW}" +
$" - {Resources.StrProcessStateDetected}: {rebootCount}");
return StatusReturn.Failed;
}
// Skip reboot counter check on reties as it passed here the initial phase as a retry may follow an
// unsuccessfully hardware-reboot-procedure
Meter.CheckRebootCtr = false;
SuccessMsgDispatcher(Resources.StrSuccessMsgRebootCounts +
$" - {Resources.StrProcessStateAllowed}: {MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW}" +
$" - {Resources.StrProcessStateDetected}: {rebootCount}");
}
SuccessMsgDispatcher(Resources.StrSuccessMsgRebootCounts +
$" - {Resources.StrProcessStateAllowed}: {MeterResetPsu.MAX_REBOOTS_FOR_HEALTHY_HW}" +
$" - {Resources.StrProcessStateDetected}: {rebootCount}");
// If interface is outdated
if (!Meter.InterfaceSupportsFwVersion)
{

View File

@ -38,6 +38,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
private ProcessState _lockedStateMachineState;
// sender of state change event to evaluate in e.g. error process
private IProductionProcess _stateChangeRequestProcess;
// List of production processes
public List<IProductionProcess> Processes
{
@ -147,7 +148,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
{
// Timer for cyclic call of state machine
_processCtrlTimer = new Timer(TmrProcessCtrlCycle_Elapsed, null, ProcessTimerCycleMs, ProcessTimerCycleMs);
// Delay timer between final-param-exec finished and start of 'StoreConfiguration'
_paramExeFinishedToStoreConfigDelayTimer = new DispatcherTimer();
_paramExeFinishedToStoreConfigDelayTimer.Tick += TmrParamExeFinishedToStoreConfigCycle_Tick;
@ -281,7 +282,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
break;
}
// Delay timer init and start if parametrization exec finished but only for 'EMEA' region
if (pp != null &&
if (pp != null &&
pp.ProcessName != null &&
pp.Meter != null &&
pp.Meter.Region.Equals("EMEA") &&
@ -834,7 +835,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
_stateMachineState = (ProcessState)processStateStruct.NextStateOnSuccess;
return;
}
// Process is waiting for execution after init, this overrides the eventually abort state
processStateStruct.ProductionProcess.InitProcess();