diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-07-27 04:09:45 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-07-27 04:09:45 +0300 |
| commit | d9d009df1da8630ec6726ed506865ca9818d1eff (patch) | |
| tree | 46db9f8310e8525e51f6ac1865fe622da61b966b /Software/Visual_Studio/PPC/Modules | |
| parent | 3038323fb9bb7f37bf0cb35f3b7e08adae075b99 (diff) | |
| download | Tango-d9d009df1da8630ec6726ed506865ca9818d1eff.tar.gz Tango-d9d009df1da8630ec6726ed506865ca9818d1eff.zip | |
More advanced job resume.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 27 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml | 11 |
2 files changed, 30 insertions, 8 deletions
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 @@ </UserControl.Resources> - <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False" IsEnabled="{Binding CanEdit}"> + <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> - <touch:TouchLoadingPanel x:Name="GeneralSettings" Grid.Row="1" IsLoading="{Binding IsBusy}" Margin="10 7 10 0"> + <touch:TouchLoadingPanel x:Name="GeneralSettings" Grid.Row="1" IsLoading="{Binding IsBusy}" Margin="10 7 10 0" IsEnabled="{Binding CanEdit}"> <Border Grid.Row="1" x:Name="jobDetailsBorder" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="2" BorderBrush="{StaticResource TangoLightBorderBrush}" Margin="0 7 0 7"> <Grid x:Name="job_details" HorizontalAlignment="Stretch" > @@ -943,7 +943,7 @@ </Border> </touch:TouchLoadingPanel> - <touch:TouchLoadingPanel Grid.Row="2" IsLoading="{Binding IsBusy}" > + <touch:TouchLoadingPanel Grid.Row="2" IsLoading="{Binding IsBusy}" IsEnabled="{Binding CanEdit}"> <Grid > <Grid.RowDefinitions> <RowDefinition Height="1*"/> @@ -1348,7 +1348,7 @@ </Style> </touch:TouchIconButton.Style> </touch:TouchIconButton>--> - <touch:TouchTextBox Margin="20 6 240 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox> + <touch:TouchTextBox IsEnabled="{Binding CanEdit}" Margin="20 6 240 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox> <!--<touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center" Width="50" Height="50" HorizontalAlignment="Left" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding EditJobDetailsCommand}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}" components:TransformationHelper.TransformWhenPressed ="False"> <Border Height="24" Width="24" Margin="0 0 0 0" BorderThickness="0" Background="Transparent" HorizontalAlignment="Center"> @@ -1370,6 +1370,9 @@ </Style> </touch:TouchButton.Style> </touch:TouchButton> + <touch:TouchIconButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Icon="DeleteSweep" VerticalAlignment="Center" BorderThickness="0 0 1 0" BorderBrush="White" Height="55" Canvas.Left="-75" Canvas.Top="10" Background="{StaticResource TangoMidAccentBrush}" Padding="15" Width="100" CornerRadius="30 0 0 30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DropResumeCommand}"> + + </touch:TouchIconButton> </Canvas> </Grid> </Border> |
