From c5cde62cecfdd413e9902b26b30b0d4dfd05a24d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 14 Mar 2019 13:25:32 +0200 Subject: Machine Studio v4.0.10 PPC v1.0.9 --- .../PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs | 14 +++++++------- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs | 13 ++++++++----- .../PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 8 ++++++++ .../PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml | 2 +- .../Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml | 2 +- 6 files changed, 26 insertions(+), 15 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index d6770ed45..f05c05a44 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -42,13 +42,13 @@ namespace Tango.PPC.UI.Printing /// The job. /// The context. /// - public JobHandler Print(Job job, ObservablesContext context) + public async Task Print(Job job, ObservablesContext context) { #if STUBPRINT - var handler = _machineProvider.MachineOperator.PrintStub(job); + var handler = await _machineProvider.MachineOperator.PrintStub(job); #else - var handler = _machineProvider.MachineOperator.Print(job); + var handler = await _machineProvider.MachineOperator.Print(job); #endif handler.Completed += async (x, e) => @@ -104,7 +104,7 @@ namespace Tango.PPC.UI.Printing /// The job. /// The context. /// - public JobHandler PrintSample(Job job, ObservablesContext context) + public async Task PrintSample(Job job, ObservablesContext context) { LogManager.Log("Cloning job..."); Job sampleDyeJob = job.Clone(); @@ -131,7 +131,7 @@ namespace Tango.PPC.UI.Printing LogManager.Log("Executing sample dye job..."); - var handler = _machineProvider.MachineOperator.Print(sampleDyeJob); + var handler = await _machineProvider.MachineOperator.Print(sampleDyeJob); handler.Completed += async (x, e) => { try @@ -157,7 +157,7 @@ namespace Tango.PPC.UI.Printing /// The context. /// The fine tune items. /// - public JobHandler PrintFineTuning(Job job, ObservablesContext context, IEnumerable fineTuneItems) + public async Task PrintFineTuning(Job job, ObservablesContext context, IEnumerable fineTuneItems) { LogManager.Log("Cloning job..."); Job fineTuneJob = job.Clone(); @@ -172,7 +172,7 @@ namespace Tango.PPC.UI.Printing var segment = fineTuneJob.AddSolidSegment(suggestion.Color); } - var handler = _machineProvider.MachineOperator.Print(fineTuneJob); + var handler = await _machineProvider.MachineOperator.Print(fineTuneJob); handler.Completed += async (x, e) => { try diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index fa54f491e..a0db99ffb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.6.0")] +[assembly: AssemblyVersion("1.0.9.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index 83f629159..80a95d1bf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -116,12 +116,15 @@ namespace Tango.PPC.UI.ViewModels /// The instance containing the event data. private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e) { - LogManager.Log("External bridge client disconnected. Navigating to home module..."); - - InvokeUI(() => + if (IsVisible) { - NavigationManager.NavigateTo(NavigationView.HomeModule); - }); + LogManager.Log("External bridge client disconnected. Navigating to home module..."); + + InvokeUI(() => + { + NavigationManager.NavigateTo(NavigationView.HomeModule); + }); + } } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index 07da99818..f265c5dbf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -140,6 +140,14 @@ namespace Tango.PPC.UI.ViewModels _isChecking = true; IsDbUpdate = false; + await Task.Delay(2000); + if (!await ConnectivityProvider.CheckInternetConnection()) + { + _isChecking = false; + await NavigateTo(MachineUpdateView.UpdateCheckErrorView); + return; + } + var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber); if (response.IsUpdateAvailable) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml index ba7e9e019..fba8a599d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineUpdateView.xaml @@ -174,7 +174,7 @@ Update Failed - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index e4c107049..c63ef1e13 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -59,7 +59,7 @@ - + -- cgit v1.3.1