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/Common.sln.DotSettings.user b/Common/Common.sln.DotSettings.user index d3d71323..f04ddf61 100644 --- a/Common/Common.sln.DotSettings.user +++ b/Common/Common.sln.DotSettings.user @@ -30,7 +30,7 @@ True NewVersion True - C:\Users\Thomas Müller\AppData\Local\Temp\JetBrains\ReSharperPlatformVs17\vAny_ab6433f6\CoverageData\_Common.-1885154465\Snapshot\snapshot.utdcvr + True <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> diff --git a/Common/Common.sln.DotSettings.user.bak b/Common/Common.sln.DotSettings.user.bak new file mode 100644 index 00000000..39b664b4 --- /dev/null +++ b/Common/Common.sln.DotSettings.user.bak @@ -0,0 +1,63 @@ + + DO_NOT_SHOW + 2 + True + True + True + + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="s_" Suffix="" Style="AaBb" /></Policy> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="Aa_bb" /> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Enum members"><ElementKinds><Kind Name="ENUM_MEMBER" /></ElementKinds></Descriptor><Policy Inspect="False" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Properties"><ElementKinds><Kind Name="PROPERTY" /></ElementKinds></Descriptor><Policy Inspect="False" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="Aa_bb" /></Policy> + <AssemblyExplorer> + <Assembly Path="D:\Projekte\SENSUS_tfs_workspaces\WorkBenchV2\Main\Common\Ui\IrdaFunctionalTestApp\bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll" /> + <Assembly Path="D:\Projekte\SENSUS_GitLab\laa_production\Common\Hardware\WaterMeter\Genesis\GenesisPwd\bin\Debug\Newtonsoft.Json.dll" /> +</AssemblyExplorer> + True + NewVersion + True +<<<<<<< HEAD +======= + C:\Users\Thomas Müller\AppData\Local\Temp\JetBrains\ReSharperPlatformVs17\vAny_ab6433f6\CoverageData\_Common.-1885154465\Snapshot\snapshot.utdcvr +>>>>>>> origin/main + True + + <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> + <Solution /> +</SessionState> + + + + + + + + + + + + + + + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName>D:\Workspace\WorkBenchV2\Main\ZeroFlowTool\bin\Debug\GenesisDisplayTool.exe</FileName><WorkingDirectory>D:\Workspace\WorkBenchV2\Main\ZeroFlowTool\bin\Debug</WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="PerformanceInfo"><MeasureType>Sampling</MeasureType><MeterKind>Rdtsc</MeterKind><InjectInfo><SymbolSearch><SearchPaths /></SymbolSearch><Scope><PatternFilters /><DenyAttributeFilters /></Scope></InjectInfo></Info><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data> + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="PerformanceInfo"><MeasureType>TracingInject</MeasureType><MeterKind>Rdtsc</MeterKind><InjectInfo><SymbolSearch><SearchPaths /></SymbolSearch><Scope><PatternFilters><Item /></PatternFilters><DenyAttributeFilters /></Scope></InjectInfo></Info><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data> + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath><ReprofileDisableReason>LaunchedByReSharperUnitTestRunner</ReprofileDisableReason></HostOptions></data> + True + False + False + + \ No newline at end of file diff --git a/Common/Common.sln.DotSettings.user.orig b/Common/Common.sln.DotSettings.user.orig new file mode 100644 index 00000000..39b664b4 --- /dev/null +++ b/Common/Common.sln.DotSettings.user.orig @@ -0,0 +1,63 @@ + + DO_NOT_SHOW + 2 + True + True + True + + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="s_" Suffix="" Style="AaBb" /></Policy> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="Aa_bb" /> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Enum members"><ElementKinds><Kind Name="ENUM_MEMBER" /></ElementKinds></Descriptor><Policy Inspect="False" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Properties"><ElementKinds><Kind Name="PROPERTY" /></ElementKinds></Descriptor><Policy Inspect="False" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="Aa_bb" /></Policy> + <AssemblyExplorer> + <Assembly Path="D:\Projekte\SENSUS_tfs_workspaces\WorkBenchV2\Main\Common\Ui\IrdaFunctionalTestApp\bin\Debug\Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.dll" /> + <Assembly Path="D:\Projekte\SENSUS_GitLab\laa_production\Common\Hardware\WaterMeter\Genesis\GenesisPwd\bin\Debug\Newtonsoft.Json.dll" /> +</AssemblyExplorer> + True + NewVersion + True +<<<<<<< HEAD +======= + C:\Users\Thomas Müller\AppData\Local\Temp\JetBrains\ReSharperPlatformVs17\vAny_ab6433f6\CoverageData\_Common.-1885154465\Snapshot\snapshot.utdcvr +>>>>>>> origin/main + True + + <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> + <Solution /> +</SessionState> + + + + + + + + + + + + + + + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName>D:\Workspace\WorkBenchV2\Main\ZeroFlowTool\bin\Debug\GenesisDisplayTool.exe</FileName><WorkingDirectory>D:\Workspace\WorkBenchV2\Main\ZeroFlowTool\bin\Debug</WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="PerformanceInfo"><MeasureType>Sampling</MeasureType><MeterKind>Rdtsc</MeterKind><InjectInfo><SymbolSearch><SearchPaths /></SymbolSearch><Scope><PatternFilters /><DenyAttributeFilters /></Scope></InjectInfo></Info><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data> + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="PerformanceInfo"><MeasureType>TracingInject</MeasureType><MeterKind>Rdtsc</MeterKind><InjectInfo><SymbolSearch><SearchPaths /></SymbolSearch><Scope><PatternFilters><Item /></PatternFilters><DenyAttributeFilters /></Scope></InjectInfo></Info><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath></HostOptions></data> + <data><HostParameters type="LocalHostParameters" /><Argument type="StandaloneArgument"><Arguments IsNull="False"></Arguments><FileName IsNull="False"></FileName><WorkingDirectory IsNull="False"></WorkingDirectory><Scope><ProcessFilters /></Scope></Argument><Info type="TimelineInfo" /><CoreOptions type="CoreOptions"><CoreTempPath IsNull="False"></CoreTempPath><RemoteEndPoint IsNull="False"></RemoteEndPoint><AdditionalEnvironmentVariables /></CoreOptions><HostOptions type="HostOptions"><HostTempPath IsNull="False"></HostTempPath><ReprofileDisableReason>LaunchedByReSharperUnitTestRunner</ReprofileDisableReason></HostOptions></data> + True + False + False + + \ No newline at end of file diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache index 8865d283..4163759b 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -89102b0142e574de38a9f47d370f3334e5e6c268 +8cb55c312de586b683d72cf58c13e2801d10e14b767777d98338d3e1473a1213 diff --git a/Common/Utils/ProcessExec/ProcessExec.cs b/Common/Utils/ProcessExec/ProcessExec.cs index 70bff0ea..168cfd98 100644 --- a/Common/Utils/ProcessExec/ProcessExec.cs +++ b/Common/Utils/ProcessExec/ProcessExec.cs @@ -59,6 +59,9 @@ namespace Xylem.Common.Utils.ProcessExec /// /// - CancellationToken. /// + /// + /// - Set StatusReturn.Okay if preExecFn is null. + /// public void NewProcess(VoidCallbackFunction initFn, StatusReturnCallbackFunction preExecFn, StatusReturnCallbackFunction execFn, ExitStateCallbackFunction finalFn, CultureInfo cultureInfo, Object[] exitObjects, CancellationToken cancellationToken) @@ -76,7 +79,10 @@ namespace Xylem.Common.Utils.ProcessExec Thread.CurrentThread.CurrentUICulture = cultureInfo; Thread.CurrentThread.CurrentCulture = cultureInfo; - if (preExecFn != null && !cancellationToken.IsCancellationRequested) + if (preExecFn == null) + success = StatusReturn.Okay; + + else if (!cancellationToken.IsCancellationRequested) success = (StatusReturn)preExecFn.DynamicInvoke(); if (execFn == null || success != StatusReturn.Okay || cancellationToken.IsCancellationRequested) diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/Program.cs b/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/Program.cs index 54f85a7d..352f9956 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/Program.cs +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateLoader/Program.cs @@ -1,4 +1,6 @@ using System; +using System.Runtime.CompilerServices; +using System.Threading; using System.Windows.Forms; namespace Xylem.ServiceFwUpdate.Ui.FwUpdateLoader @@ -6,12 +8,19 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateLoader [Serializable] static class Program { + private static Mutex _mutex; /// /// The main entry point for the application. /// [STAThread] static void Main() { + var assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName().FullName; + _mutex = new Mutex(true, assemblyName, out var isNotRunning); + + if (!isNotRunning) + return; + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FrmFwUpdateLoader()); diff --git a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs index 4d3bb5af..a3c47ba6 100644 --- a/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs +++ b/ServiceFwUpdate/Ui/ServiceFwUpdateSw/FrmServiceFwUpdateSw.cs @@ -72,7 +72,6 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw private DateTimeOffset _startTime; private Boolean _resetTimeMeasurement; - private Boolean _stopRequest; private readonly ILogger _logger; @@ -244,6 +243,10 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw private readonly System.Threading.Timer _tmrProgressUpdate; private const Int32 TimerInterval_ms = 200; + // cancellation token + private CancellationTokenSource _cancellationTokenSource; + private CancellationToken _cancellationToken; + #endregion --------------------------------------- Variables -------------------------------------------------- #region ------------------------------------------ State Machine ---------------------------------------------- @@ -342,10 +345,16 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Force stop on stop request. /// + /// + /// - _cancellationToken. + /// private void FwUpdateSwStateMachine() { while (!_processToken.IsCancellationRequested) { + if (_cancellationTokenSource.IsCancellationRequested) + _processState = ProcessState.Stop; + if (_lastProcessState == _processState) { Thread.Sleep(1); @@ -356,8 +365,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw try { _lastProcessState = _processState; - if (_stopRequest) - _processState = ProcessState.Stop; + switch (_processState) { case ProcessState.Init: @@ -750,6 +758,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Culture info fixed to English. /// + /// + /// - _cancellationToken. + /// public FrmServiceFwUpdateSw() { _logger = NLogHelper.CreateOrGetLogger("ServiceFwUpdateSw"); @@ -765,6 +776,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw InitializeComponent(); _cultureInfo = Thread.CurrentThread.CurrentCulture; + _cancellationTokenSource = new CancellationTokenSource(); + _cancellationToken = _cancellationTokenSource.Token; + radioBtnEnglishLanguage.Checked = true; if (_cultureInfo.IetfLanguageTag == "de-DE") { @@ -806,8 +820,21 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Release display removed. /// + /// + /// - _cancellationToken. + /// private void DisposeGenesis() { + //// Wait for cancellation + //if (_cancellationToken.IsCancellationRequested) + //{ + // Thread.Sleep(500); + // // Reset the cancellation request + // _cancellationTokenSource?.Dispose(); + // _cancellationTokenSource = new CancellationTokenSource(); + // _cancellationToken = _cancellationTokenSource.Token; + //} + _currentGenesis?.Logout(); // Batch removal disposes the meter! _meterBatch?.RemoveAllMeters(); @@ -931,8 +958,12 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Release display removed. /// + /// + /// - _cancellationToken. + /// private void FrmFwUpdate_FormClosing(Object sender, FormClosingEventArgs e) { + _cancellationTokenSource?.Dispose(); _frmHistory?.Close(); _processToken?.Cancel(); @@ -1840,7 +1871,6 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw { // restart for new device _afterUpdateConnect = false; - _stopRequest = false; if (_resetTimeMeasurement) { _startTime = DateTimeOffset.UtcNow; @@ -1880,10 +1910,12 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Initial /// + /// + /// - _cancellationToken. + /// private void BtnStop_Click(Object sender, EventArgs e) { - _processState = ProcessState.Stop; - _stopRequest = true; + _cancellationTokenSource?.Cancel(); } /// @@ -1903,7 +1935,6 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw _registerRestorer == null) return; - _stopRequest = false; _startTime = DateTimeOffset.UtcNow; _resetTimeMeasurement = false; _processState = ProcessState.ReadInfoEraseRestoreFiles; @@ -2507,10 +2538,13 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Initial. /// + /// + /// - _cancellationToken. + /// private ProcessState GetNextProcessState(ProcessState invokerProcessState, IReadOnlyList processSateSequence) { - if (_stopRequest) + if (_cancellationToken.IsCancellationRequested) return ProcessState.Stop; // The last entry is an end of list marker for (var c = 0; c < processSateSequence.Count - 1; c++) @@ -2957,7 +2991,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// - If LUT restore generates an error all processes have to be stopped as the meter is NOT functional. /// /// - /// - COmmunication error on app detection. + /// - Communication error on app detection. /// private void ErrorProcesses() { @@ -3181,6 +3215,12 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// - Enable [Connect] and [Port Scan], /// - _processState to idle. /// + /// + /// - Removed registerRestorer.StopRegisterAccess. + /// + /// + /// - _cancellationToken. + /// private void StopProcesses() { InfoProcessFailed(null, Resources.StrUserStop); @@ -3192,10 +3232,19 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw _serialPortScanner.StopPortScan = true; if (_meterFwUpdate != null) _meterFwUpdate.StopUpdateProcess = true; - if (_registerRestorer != null) - _registerRestorer.StopRegisterAccess = true; if (_meterFile != null) _meterFile.StopProcess = true; + + // Wait for cancellation + if (_cancellationToken.IsCancellationRequested) + { + Thread.Sleep(500); + // Reset the cancellation request + _cancellationTokenSource?.Dispose(); + _cancellationTokenSource = new CancellationTokenSource(); + _cancellationToken = _cancellationTokenSource.Token; + } + MessageBoxShow(Resources.StrUserStop, "Info", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); // take the invoker of the error state to generate the message and / or popup window @@ -3312,6 +3361,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Changed port scanner call using state responses after execution. /// + /// + /// - _cancellationToken. + /// private void Reboot(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -3331,7 +3383,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw var processExec = new ProcessExec(); processExec.NewProcess(InitReboot, null, ExecReboot, FinalizeReboot, _cultureInfo, - exitProcessStateObjects); + exitProcessStateObjects, _cancellationToken); } /// @@ -3447,6 +3499,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Changed port scanner call using state responses after execution. /// + /// + /// - _cancellationToken. + /// private void PortScanner(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -3460,7 +3515,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw var processExec = new ProcessExec(); processExec.NewProcess(InitPortScanner, null, ExecPortScanner, FinalizePortScanner, _cultureInfo, - exitProcessStateObjects); + exitProcessStateObjects, _cancellationToken); } /// @@ -3582,6 +3637,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Changed port scanner call using state responses after execution. /// + /// + /// - _cancellationToken. + /// private void Connect(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -3594,7 +3652,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw exitProcessStateObjects[2] = breakExitState; var processExec = new ProcessExec(); - processExec.NewProcess(InitConnect, null, ExecConnect, FinalizeConnect, _cultureInfo, exitProcessStateObjects); + processExec.NewProcess(InitConnect, null, ExecConnect, FinalizeConnect, _cultureInfo, + exitProcessStateObjects, _cancellationToken); } /// @@ -4055,6 +4114,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Changed port scanner call using state responses after execution. /// + /// + /// - _cancellationToken. + /// private void ReadRegisters(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -4074,7 +4136,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw var processExec = new ProcessExec(); processExec.NewProcess(InitReadRegister, null, ExecReadRegister, FinalReadRegisters, - _cultureInfo, exitProcessStateObjects); + _cultureInfo, exitProcessStateObjects, _cancellationToken); } /// @@ -4109,6 +4171,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// - Status unknown implemented, /// - activity message moved from InitReadRegister() /// + /// + /// - _cancellationToken. + /// private StatusReturn ExecReadRegister() { Boolean retVal; @@ -4117,7 +4182,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw case ProcessState.InitialReadRegisters: SetOverallProgressDisplayOn(Resources.StrRegisterReadoutActive); InfoProcessActive(lblRegisterReadout, Resources.StrRegisterReadoutActive); - retVal = _registerRestorer.InitialReadRegisters(); + retVal = _registerRestorer.InitialReadRegisters(_cancellationToken); break; case ProcessState.FinalReadRegisters: @@ -4125,7 +4190,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw { SetOverallProgressDisplayOn(Resources.StrRegisterReadoutActive); InfoProcessActive(lblRegisterReadout, Resources.StrRegisterReadoutActive); - retVal = _registerRestorer.FinalReadRegisters(); + retVal = _registerRestorer.FinalReadRegisters(_cancellationToken); } else { @@ -4138,7 +4203,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw { SetOverallProgressDisplayOn(Resources.StrRegisterReadoutActive); InfoProcessActive(lblRegisterReadout, Resources.StrRegisterCompareActive); - retVal = _registerRestorer.CompareRegisters(); + retVal = _registerRestorer.CompareRegisters(_cancellationToken); } else { @@ -4149,7 +4214,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw default: SetOverallProgressDisplayOn(Resources.StrRegisterReadoutActive); InfoProcessActive(lblRegisterReadout, Resources.StrRegisterReadoutActive); - retVal = _registerRestorer.ReadRegisters(); + retVal = _registerRestorer.ReadRegisters(_cancellationToken); break; } return retVal ? StatusReturn.Okay : StatusReturn.Failed; @@ -4762,6 +4827,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Initial /// + /// + /// - _cancellationToken. + /// private void RegisterRecovery(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -4781,7 +4849,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw var processExec = new ProcessExec(); processExec.NewProcess(InitRegisterRecovery, null, ExecRegisterRecovery, FinalizeRegisterRecovery, - _cultureInfo, exitProcessStateObjects); + _cultureInfo, exitProcessStateObjects, _cancellationToken); } /// @@ -4820,6 +4888,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Moved process messages from InitRegisterRecovery(). /// + /// + /// - _cancellationToken. + /// private StatusReturn ExecRegisterRecovery() { var retVal = StatusReturn.Okay; @@ -4835,7 +4906,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw InfoProcessActive(lblRegisterRestore, Resources.StrRegisterAccessActive); //set the process bars SetOverallProgressDisplayOn(Resources.StrRegisterAccessActive); - retVal = _registerRestorer.WriteRegisters(device.RecoveryRegisters); + retVal = _registerRestorer.WriteRegisters(device.RecoveryRegisters, _cancellationToken); break; } @@ -4924,6 +4995,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw /// /// - Changed port scanner call using state responses after execution. /// + /// + /// - _cancellationToken. + /// private void FwUpdate(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error, ProcessState breakExitState = ProcessState.Stop) { @@ -4944,7 +5018,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw var processExec = new ProcessExec(); processExec.NewProcess(InitFwUpdate, null, ExecFwUpdate, FinalizeFwUpdate, _cultureInfo, - exitProcessStateObjects); + exitProcessStateObjects, _cancellationToken); } ///