From f27893986e9fd647a69be8569ecd5d944f853869 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 18 Apr 2019 20:48:48 +0300 Subject: Implemented machine status animations. --- .../Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index 264f41131..3e8c6f280 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -4,12 +4,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.AppBarItems; using Tango.PPC.Jobs.AppButtons; using Tango.PPC.Jobs.Dialogs; +using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -47,10 +49,24 @@ namespace Tango.PPC.Jobs.ViewModels #endregion + #region Commands + + /// + /// Gets or sets the go to job command. + /// + /// + /// The go to job command. + /// + public RelayCommand GoToJobCommand { get; set; } + + #endregion + public JobProgressViewVM() { _stop_job_btn = new StopPrintingButton(); _stop_job_btn.Pressed += _stop_job_btn_Pressed; + + GoToJobCommand = new RelayCommand(GoToJob); } private void _stop_job_btn_Pressed() @@ -61,6 +77,12 @@ namespace Tango.PPC.Jobs.ViewModels } } + private void GoToJob() + { + NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); + NavigationManager.ClearHistoryExcept(); + } + #region Override Methods /// -- cgit v1.3.1 From 46f5f70e6055234bce3e9a105ab1ba86248b1713 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 22 Apr 2019 22:46:43 +0300 Subject: Implemented Volume color space gradients. Implemented volume gradients on PPC. Improved job running aspects on PPC. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1581 -> 1516 bytes .../ViewModels/MainViewVM.cs | 30 +++++-- .../Views/JobView.xaml | 2 +- .../Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml | 6 +- .../Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs | 2 +- .../Tango.PPC.Jobs/Views/JobProgressView.xaml | 2 +- .../PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 8 +- .../Visual_Studio/Tango.BL/Entities/BrushStop.cs | 80 +++++++++--------- .../DefaultGradientGenerationConfiguration.cs | 18 +++- .../Operation/IGradientGenerationConfiguration.cs | 5 ++ .../Tango.Integration/Operation/JobHandler.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 92 +++++++++++++++++---- 14 files changed, 174 insertions(+), 73 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index 84785d8cf..87b59afc3 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 5e10994a1..79746966d 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index bd3a3933b..19334a605 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 0299940d3..4d8ec954e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -966,9 +966,23 @@ namespace Tango.MachineStudio.Developer.ViewModels private void MachineOperator_PreparingJobProgress(object sender, PreparingJobProgressEventArgs e) { - if (_preparingTaskItem != null) + var percent = (e.Progress / e.Total * 100d); + + if (_preparingTaskItem == null && percent == 0) + { + _preparingTaskItem = _notification.PushTaskItem("Preparing job for printing..."); + } + else if (percent == 100) { - _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; + _preparingTaskItem.Pop(); + _preparingTaskItem = null; + } + else + { + if (_preparingTaskItem != null) + { + _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; + } } } @@ -1327,11 +1341,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (resumeFunc == null) { - using (var item = _notification.PushTaskItem("Preparing job for printing...")) - { - _preparingTaskItem = item; - JobHandler = await MachineOperator.Print(ActiveJob, SelectedProcessParametersTable); - } + JobHandler = await MachineOperator.Print(ActiveJob, SelectedProcessParametersTable); } else { @@ -1408,6 +1418,12 @@ namespace Tango.MachineStudio.Developer.ViewModels JobHandler.Canceled += (x, y) => { + if (_preparingTaskItem != null) + { + _preparingTaskItem.Pop(); + _preparingTaskItem = null; + } + LogManager.Log(String.Format("Job {0} has been canceled.", RunningJob.Name)); _eventLogger.Log(String.Format("Job {0} has been canceled.", RunningJob.Name)); StopRecordingIfInProgress(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index bfa951c3b..a5d137e67 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -1220,7 +1220,7 @@ - +