diff --git a/Common/Production/ProductionUiCordonel/App.config b/Common/Production/ProductionUiCordonel/App.config index 6d84876c..374410f9 100644 --- a/Common/Production/ProductionUiCordonel/App.config +++ b/Common/Production/ProductionUiCordonel/App.config @@ -34,7 +34,7 @@ - + diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 70c8d404..6c85da9d 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -326,8 +326,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr } SuccessMsgDispatcher(Resources.StrSuccessMsgRadioInCustomerMode); - SuccessMsgDispatcher(Resources.StrSuccessMsgRadioAlarmsReset); - + // Skip radio check by requirement if (skipRadioCheck) { diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs index 2b071f93..2c95739a 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs @@ -1,6 +1,7 @@ using System; using LaaPackages.Features.Cordonel.Models; using Xylem.Common.CommonCore.Consts; +using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes; @@ -42,6 +43,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - Moved setting of time and reset counters from to here. /// + /// + /// - Reset alarms in customer app and radio app and check it for success. + /// public override StatusReturn ExecuteProcess() { // Uncheck executed process to leave the result open needed for retries @@ -104,33 +108,69 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr var rawSeconds = RegisterConverter.ValueToByteArray(teaTime.UtcNowToSecondsSince2000); var timerSetup = new ProgrammingParameters("SYSTEM_CalendarSeconds", rawSeconds, ProgrammingSource.ProgramInternal); - // This is the manufacturing date of the Cordonel - var irdaMfgDate = new ProgrammingParameters("IRDA_MfgDate", rawSeconds, - ProgrammingSource.ProgramInternal); - // Reset reboot counter - var nullRebootCtr = new ProgrammingParameters("CUSTOMER_RebootCount", new Byte[] { 0x00 }, - ProgrammingSource.ProgramInternal); var retValBol = WriteRegisterLogAndProcessCtr(timerSetup); - retValBol &= WriteRegisterLogAndProcessCtr(irdaMfgDate); - retValBol &= WriteRegisterLogAndProcessCtr(nullRebootCtr); - if (Meter.RadioFrequencyMhz != null) - { - // Reset periodic log reset counter - var periodicLogResetCtr = new ProgrammingParameters("PERIODICLOG_ResetCounter", new Byte[] { 0x00 }, - ProgrammingSource.ProgramInternal); - retValBol &= WriteRegisterLogAndProcessCtr(periodicLogResetCtr); - // Reset sensus radio reset counter - var sensusRadioResetCtr = new ProgrammingParameters("SENSUSRADIO_ResetCounter", new Byte[] { 0x00 }, - ProgrammingSource.ProgramInternal); - retValBol &= WriteRegisterLogAndProcessCtr(sensusRadioResetCtr); - } - if (!retValBol) + // This is the manufacturing date of the Cordonel + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("IRDA_MfgDate", rawSeconds, + ProgrammingSource.ProgramInternal)); + // Reset reboot counter + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("CUSTOMER_RebootCount", new Byte[] { 0x00 }, + ProgrammingSource.ProgramInternal)); + // Reset alarms Customer + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("CUSTOMER_TriggerAlarmCancel", + new Byte[] { 0xFF, 0xFF, 0xFF, 0xFF }, ProgrammingSource.ProgramInternal)); + ActualProcessProgress++; + + // Read back CUSTOMER_TriggerAlarmCancel and ignore empty pipe + var readBackCustomerAlarmCancel = + RegisterConverter.ByteArrayToValue(Meter.ReadRegister("CUSTOMER_TriggerAlarmCancel")); + + if (!retValBol || readBackCustomerAlarmCancel != 0) { + ErrorMsgDispatcher(Resources.StrErrorMsgAlarmReset); EolProgress.RebootDoneChecked = EOLStatus.FAIL; return StatusReturn.Failed; } + if (Meter.RadioFrequencyMhz != null) + { + // Reset periodic log reset counter + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("PERIODICLOG_ResetCounter", + new Byte[] { 0x00 }, ProgrammingSource.ProgramInternal)); + + // Reset main and extended alarm mask + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_MainAlarmMask", + new Byte[] { 0 }, ProgrammingSource.ProgramInternal)); + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_ExtendedAlarmMask", + new Byte[] { 0 }, ProgrammingSource.ProgramInternal)); + + // System state sensus radio to 0xFF for re-initialize + retValBol &= WriteRegisterLogAndProcessCtr(new ProgrammingParameters("SENSUSRADIO_SystemState", + new Byte[] { 0xFF }, ProgrammingSource.ProgramInternal)); + + // Read back alarm masks + var mainAlarmMask = + RegisterConverter.ByteArrayToValue(Meter.ReadRegister("SENSUSRADIO_MainAlarmMask")); + var extendedAlarmMask = + RegisterConverter.ByteArrayToValue(Meter.ReadRegister("SENSUSRADIO_ExtendedAlarmMask")); + var finalRadioSystemState = + RegisterConverter.ByteArrayToValue(Meter.ReadRegister("SENSUSRADIO_SystemState")); + + // Reset sensus radio reset counter + var sensusRadioResetCtr = new ProgrammingParameters("SENSUSRADIO_ResetCounter", new Byte[] { 0x00 }, + ProgrammingSource.ProgramInternal); + retValBol &= WriteRegisterLogAndProcessCtr(sensusRadioResetCtr); + + if (!retValBol || mainAlarmMask != 0 || extendedAlarmMask !=0 || finalRadioSystemState != 0x02) + { + ErrorMsgDispatcher(Resources.StrErrorMsgAlarmReset); + EolProgress.RebootDoneChecked = EOLStatus.FAIL; + return StatusReturn.Failed; + } + + } + + SuccessMsgDispatcher(Resources.StrSuccessMsgAlarmReset); EolProgress.RebootDoneChecked = EOLStatus.OK; return StatusReturn.Okay; } diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs index c5938999..3137f535 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs @@ -312,6 +312,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to ERROR: Failed to reset alarms. + /// + internal static string StrErrorMsgAlarmReset { + get { + return ResourceManager.GetString("StrErrorMsgAlarmReset", resourceCulture); + } + } + /// /// Looks up a localized string similar to ERROR: At least one wrong or missing App. /// @@ -1914,6 +1923,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Success: Alarms successfully reset. + /// + internal static string StrSuccessMsgAlarmReset { + get { + return ResourceManager.GetString("StrSuccessMsgAlarmReset", resourceCulture); + } + } + /// /// Looks up a localized string similar to Success: Cordonel Calibration process execution reported . /// @@ -2004,15 +2022,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } - /// - /// Looks up a localized string similar to Success: Radio alarms successfully reset. - /// - internal static string StrSuccessMsgRadioAlarmsReset { - get { - return ResourceManager.GetString("StrSuccessMsgRadioAlarmsReset", resourceCulture); - } - } - /// /// Looks up a localized string similar to Radio successfully switched to customer mode. /// diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx index 0cb16a89..0476e829 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx @@ -520,8 +520,11 @@ Start - - Erfolg: Funkalarme erfolgreich gelöscht + + Erfolg: Alarme erfolgreich zurückgesetzt + + + FEHLER: Alarme konnten nicht zurückgesetzt werden Erfolg: Funk efolgreich in Kundenmodus geschaltet diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx index dace6dd0..db1aba7c 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx @@ -520,8 +520,11 @@ Start - - Success: Radio alarms successfully reset + + Success: Alarms successfully reset + + + ERROR: Failed to reset alarms Radio successfully switched to customer mode