From d9d009df1da8630ec6726ed506865ca9818d1eff Mon Sep 17 00:00:00 2001 From: Roy Date: Thu, 27 Jul 2023 04:09:45 +0300 Subject: More advanced job resume. --- .../Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 27 ++++++++++++++++++---- .../Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 11 +++++---- 2 files changed, 30 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 65ffca36a..46898210e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -101,7 +101,7 @@ namespace Tango.PPC.Jobs.ViewModels public bool CanEdit { - get { return !MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob == null || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid; } + get { return (!MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob == null || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid) && !HasResumeModel; } } private ICollectionView _segmentsCollectionView; @@ -291,7 +291,7 @@ namespace Tango.PPC.Jobs.ViewModels public JobResumeModel ResumeModel { get { return _resumeModel; } - set { _resumeModel = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasResumeModel)); } + set { _resumeModel = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasResumeModel)); RaisePropertyChanged(nameof(CanEdit)); } } public bool HasResumeModel @@ -355,6 +355,8 @@ namespace Tango.PPC.Jobs.ViewModels public RelayCommand NavigateBackToJobs { get; set; } + public RelayCommand DropResumeCommand { get; set; } + #endregion #region collapsed mode commands @@ -427,6 +429,8 @@ namespace Tango.PPC.Jobs.ViewModels CopyCommand = new RelayCommand(Copy); UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); } RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();} + DropResumeCommand = new RelayCommand(DropResume); + NavigateBackToJobs = new RelayCommand(NavigateBack); IsFullMode = true; @@ -537,7 +541,7 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(SelectedRML)); await LoadRML(_selectedRML); - if(BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1) + if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1) { IsBasicMode = true; } @@ -1780,7 +1784,10 @@ namespace Tango.PPC.Jobs.ViewModels RaisePropertyChanged(nameof(CanEdit)); - UpdateJobResume(e); + if (BuildProvider.IsEureka) + { + UpdateJobResume(e); + } } @@ -1839,6 +1846,18 @@ namespace Tango.PPC.Jobs.ViewModels } } + private async void DropResume() + { + if (Job != null && HasResumeModel) + { + if (await NotificationProvider.ShowQuestion("Drop resume information and enable job editing?")) + { + JobResumeDB.Default.Delete(Job.Guid); + ResumeModel = null; + } + } + } + #endregion } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml index aa54beb9a..811bd5c9a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml @@ -823,13 +823,13 @@ - + - + @@ -943,7 +943,7 @@ - + @@ -1348,7 +1348,7 @@ --> - +