diff --git a/Common/.shared/SharedAssemblyInfo.cs b/Common/.shared/SharedAssemblyInfo.cs index 7b653b67..c3c3da14 100644 --- a/Common/.shared/SharedAssemblyInfo.cs +++ b/Common/.shared/SharedAssemblyInfo.cs @@ -14,4 +14,4 @@ using System.Reflection; //[assembly: AssemblyVersion("1.2.*.0")] -[assembly: AssemblyVersion("2.6.14.*")] +[assembly: AssemblyVersion("2.6.15.*")] diff --git a/Common/.vs/config/applicationhost.config b/Common/.vs/config/applicationhost.config index a894c3cf..883679a3 100644 --- a/Common/.vs/config/applicationhost.config +++ b/Common/.vs/config/applicationhost.config @@ -155,7 +155,7 @@ - + diff --git a/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj b/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj index af1c5031..d83541b9 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj +++ b/Common/Production/ProductionUiCordonel.UnitTests/ProductionUiCordonel.UnitTests.csproj @@ -52,6 +52,7 @@ SpecFlowSingleFileGenerator + FinalParamSequence_Write_Store_Reboot_Verify.feature.cs SpecFlowSingleFileGenerator diff --git a/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs b/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs index 8bf7a1ac..d896dffe 100644 --- a/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs +++ b/Common/Production/ProductionUiCordonel.UnitTests/Steps/CommonProductionProcessSteps.cs @@ -646,9 +646,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps break; case "ExecRebootCordonel": - registerName = "CUSTOMER_RebootCount"; - var rebootCountBeforeReboot = RegisterConverter.ByteArrayToValue( - testCase.Meter.ReadRegister(registerName)); // Avoid reboot if failing is required if (testCase.RequiredEOLProgress.RebootDoneChecked != EOLStatus.FAIL) { @@ -663,17 +660,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel.UnitTests.Steps testResult.StatusReturn = StatusReturn.Failed; } - var rebootCountAfterReboot = RegisterConverter.ByteArrayToValue( - testCase.Meter.ReadRegister(registerName)); - - // The reboot counter will only be increased if reboot executed - if (rebootCountAfterReboot == rebootCountBeforeReboot) - { - testResult.StatusReturn = StatusReturn.Failed; - // Without reboot the RAM parameters are identical - paramsCheckWillSucceed = true; - } - if (string.IsNullOrEmpty(testResult.EOLProgress.ProductionStatusFwVersion)) testResult.EOLProgress.ProductionStatusFwVersion = testCase.Meter.FwVersion; break; diff --git a/Common/Production/ProductionUiCordonel/Docu/TBF_COM_EOL_SRSe.docx b/Common/Production/ProductionUiCordonel/Docu/TBF_COM_EOL_SRSe.docx index 045e5d8f..47160a16 100644 Binary files a/Common/Production/ProductionUiCordonel/Docu/TBF_COM_EOL_SRSe.docx and b/Common/Production/ProductionUiCordonel/Docu/TBF_COM_EOL_SRSe.docx differ diff --git a/Common/Production/ProductionUiCordonel/FinalTest.xaml.cs b/Common/Production/ProductionUiCordonel/FinalTest.xaml.cs index 25164580..1eae9842 100644 --- a/Common/Production/ProductionUiCordonel/FinalTest.xaml.cs +++ b/Common/Production/ProductionUiCordonel/FinalTest.xaml.cs @@ -417,33 +417,18 @@ namespace Xylem.Common.Production.ProductionUiCordonel // Ready for shipping if (e.State == ProcessState.ReadyForShipping) { - // Update progress bars - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.OverallProcessesSteps)); - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.ActualProcessSteps)); StoreSuccessNote(out _); BtnStop_Click(this, null); } // Print return report if (e.State == ProcessState.PrintReturnReport) { - // Update progress bars - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.OverallProcessesSteps)); - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.ActualProcessSteps)); PrintErrorNote(); BtnStop_Click(this, null); } // Print success report if (e.State == ProcessState.PrintSuccessReport) { - // Update progress bars - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.OverallProcessesSteps)); - ProcessProgress_Handler(this, new ProcessProgressArgs(0, - ProcessProgressArgs.ProcessProgressType.ActualProcessSteps)); PrintSuccessNote(); BtnStop_Click(this, null); } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs index 61d59066..b8b74ff5 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs @@ -185,6 +185,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses #endregion --------------------------------------- Init ------------------------------------------------------- #region ------------------------------------------ Tools ------------------------------------------------------ + /// + /// Set overall process to 100 % + /// + protected void SetOverallProcessTo100Percent() + { + OnProcessProgressChanged?.Invoke(this, new ProcessProgressArgs(Int32.MaxValue, + ProcessProgressArgs.ProcessProgressType.OverallProcessesSteps)); + } + /// public UserControl GetUserControl() { diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs index c1d7169d..0b4a9e2d 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckFinalParametrization.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using LaaPackages.Features.Cordonel.Models; using Xylem.Common.CommonCore.Consts; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; -using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes; -using Xylem.Common.Logic.ProductionOrderCore; +//using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes; +//using Xylem.Common.Logic.ProductionOrderCore; using Xylem.Common.Production.ProductionUiCordonel.Properties; namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolProcesses @@ -43,6 +43,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - Reset sensus radio and periodic log reset counters. /// + /// + /// - Moved setting of time and reset counters from here to . + /// public override StatusReturn ExecuteProcess() { // Uncheck executed process to leave the result open needed for retries @@ -73,37 +76,37 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr } } - // Get the time in UTC to program the time for the Cordonel in seconds since 01. Jan 2000 - // to set the new UTC after reboot - var teaTime = new TimeT(); - // Build byte array - 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); - } + //// Get the time in UTC to program the time for the Cordonel in seconds since 01. Jan 2000 + //// to set the new UTC after reboot + //var teaTime = new TimeT(); + //// Build byte array + //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); + //} // Execute final read after reboot RegisterRestorer.OnProcessUpdate += ProcessUpdate_Handler; - retValBol &= RegisterRestorer.FinalReadRegisters(); + var retValBol = RegisterRestorer.FinalReadRegisters(); retValBol &= RegisterRestorer.CompareRegisters(); RegisterRestorer.OnProcessUpdate -= ProcessUpdate_Handler; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs index 8df2acff..3d9f68fe 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckRadio.cs @@ -125,10 +125,10 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { Retry(); }; - _checkRadioUserControl.OnDoneRequested += delegate - { - SaveRssiLevelsToDb(); - }; + //_checkRadioUserControl.OnDoneRequested += delegate + //{ + // SaveRssiLevelsToDb(); + //}; } /// @@ -436,7 +436,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// private void DisableAllButtons() { - EnableBtn(_checkRadioUserControl.btnSkip, false); + //EnableBtn(_checkRadioUserControl.btnSkip, false); EnableBtn(_checkRadioUserControl.btnRetry, false); } @@ -726,7 +726,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { _dataContainer.Result = 0; // done can finish the test which is equal to abort on error - EnableBtn(_checkRadioUserControl.btnSkip, true); + //EnableBtn(_checkRadioUserControl.btnSkip, true); // reset can repeat the test as often as wanted EnableBtn(_checkRadioUserControl.btnRetry, true); _successSignalLevel = false; diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs index 9c24e47c..538c5d2f 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/ExecRebootCordonel.cs @@ -2,6 +2,9 @@ using LaaPackages.Features.Cordonel.Models; using Xylem.Common.CommonCore.Consts; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile; +using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; +using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.DataTypes; +using Xylem.Common.Logic.ProductionOrderCore; using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum; using Xylem.Common.Production.ProductionUiCordonel.Properties; @@ -36,6 +39,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr /// /// - EOL progress signaled. /// + /// + /// - Moved setting of time and reset counters from to here. + /// public override StatusReturn ExecuteProcess() { // Uncheck executed process to leave the result open needed for retries @@ -73,15 +79,60 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr var rebootSucceeded = _meterResetPsu.MeterResetPsuExecute(); _meterResetPsu.OnProcessUpdate -= ProcessUpdate_Handler; - if (rebootSucceeded) + if (!rebootSucceeded) { - EolProgress.RebootDoneChecked = EOLStatus.OK; - return StatusReturn.Okay; - + EolProgress.RebootDoneChecked = EOLStatus.FAIL; + return StatusReturn.Failed; } - EolProgress.RebootDoneChecked = EOLStatus.FAIL; - return StatusReturn.Failed; + // access to meter requires login + if (!Meter.IsLoggedOn) + { + Meter.Login(); + if (!Meter.IsLoggedOn) + { + ErrorMsgDispatcher(Resources.StrErrorMsgCordonelLogin); + EolProgress.RebootDoneChecked = EOLStatus.FAIL; + return StatusReturn.Failed; + } + } + + // Get the time in UTC to program the time for the Cordonel in seconds since 01. Jan 2000 + // to set the new UTC after reboot + var teaTime = new TimeT(); + // Build byte array + 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) + { + EolProgress.RebootDoneChecked = EOLStatus.FAIL; + return StatusReturn.Failed; + } + + EolProgress.RebootDoneChecked = EOLStatus.OK; + return StatusReturn.Okay; } catch (Exception ex) { diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs index c34fb393..92364db8 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs @@ -144,11 +144,13 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr ucDialog.SetDialogOptions(OptionList); + ActualProcessProgress = MaxActualProgressSteps; + SetOverallProcessTo100Percent(); + while (_waitOnUserFeedback && SingleProcessState != SingleProcessState.Idle) { } - ActualProcessProgress = MaxActualProgressSteps; // Always use okay to kick off ForcedSuccessExitState return StatusReturn.Okay; } diff --git a/Common/Production/ProductionUiCordonel/UserAccessWindow.xaml b/Common/Production/ProductionUiCordonel/UserAccessWindow.xaml index b7d4c56f..de60498d 100644 --- a/Common/Production/ProductionUiCordonel/UserAccessWindow.xaml +++ b/Common/Production/ProductionUiCordonel/UserAccessWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Height="400" Width="250" Closing="Window_Closing" ResizeMode="NoResize" WindowStyle="SingleBorderWindow" - WindowStartupLocation="CenterScreen"> + WindowStartupLocation="CenterScreen" Topmost="True"> diff --git a/Common/Production/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml b/Common/Production/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml index 2b7b74fa..b5ae1c73 100644 --- a/Common/Production/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml +++ b/Common/Production/ProductionUiCordonel/UserControls/FinalTest/UcRadioCheck.xaml @@ -35,7 +35,7 @@