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/Modules/Tango.PPC.Jobs/Views/JobsView.xaml | 4 ++-- .../Connectivity/AvailableWiFiConnectionsControl.xaml | 4 ++-- .../PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs | 2 +- .../Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | 11 ++++------- .../PPC/Tango.PPC.Common/Printing/IPrintingManager.cs | 6 +++--- .../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 +- 11 files changed, 38 insertions(+), 30 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml index ace1d38af..47a3df569 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -279,8 +279,8 @@ - - + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml index 80581551e..dac37ba10 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connectivity/AvailableWiFiConnectionsControl.xaml @@ -64,8 +64,8 @@ Connect automatically - Connect - Disconnect + Connect + Disconnect diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs index 4f035d814..835a7fc4a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/HotSpot/DefaultHotSpotProvider.cs @@ -77,7 +77,7 @@ namespace Tango.PPC.Common.HotSpot { try { - CmdCommand command = new CmdCommand("netsh", $"wlan set hostednetwork mode=allow ssid='{"Tango-" + _machineProvider.Machine.SerialNumber}' key='{password}'"); + CmdCommand command = new CmdCommand("netsh", $"wlan set hostednetwork mode=allow ssid={"Tango-" + _machineProvider.Machine.SerialNumber} key={password}"); await command.Run(); command = new CmdCommand("netsh", "wlan start hosted network"); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 3fffc2045..b64b624fe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -75,13 +75,10 @@ namespace Tango.PPC.Common.MachineUpdate private Task Login(String serialNumber) { - return Task.Factory.StartNew(() => + return _client.Login(new LoginRequest() { - return _client.Login(new LoginRequest() - { - Mode = LoginMode.Machine, - SerialNumber = serialNumber, - }).Result; + Mode = LoginMode.Machine, + SerialNumber = serialNumber, }); } @@ -310,7 +307,7 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Connecting to machine service on {machineServiceAddress}..."); - Login(serialNumber).Wait(); + Login(serialNumber).GetAwaiter().GetResult(); LogManager.Log($"Checking if updates available..."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs index 37a71c965..dc097a805 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Printing/IPrintingManager.cs @@ -22,7 +22,7 @@ namespace Tango.PPC.Common.Printing /// The job. /// The context. /// - JobHandler Print(Job job, ObservablesContext context); + Task Print(Job job, ObservablesContext context); /// /// Creates a sample dye job from the specified job and prints it. @@ -31,7 +31,7 @@ namespace Tango.PPC.Common.Printing /// The job. /// The context. /// - JobHandler PrintSample(Job job, ObservablesContext context); + Task PrintSample(Job job, ObservablesContext context); /// /// Creates a fine tuning job from the specified job and fine tune items. @@ -41,6 +41,6 @@ namespace Tango.PPC.Common.Printing /// The context. /// The fine tune items. /// - JobHandler PrintFineTuning(Job job, ObservablesContext context, IEnumerable fineTuneItems); + Task PrintFineTuning(Job job, ObservablesContext context, IEnumerable fineTuneItems); } } 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