diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-09-20 17:48:52 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-09-20 17:48:52 +0300 |
| commit | 94b83ea6d7e62534219801dcf1d53ee6e187837d (patch) | |
| tree | 30d58cddd475c1aad99a41166fc545918d11a84e /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer | |
| parent | ee8ed1c7638a5b2d997655594d5b9a51cb12e30d (diff) | |
| download | Tango-94b83ea6d7e62534219801dcf1d53ee6e187837d.tar.gz Tango-94b83ea6d7e62534219801dcf1d53ee6e187837d.zip | |
Implemented reset process parameters from research module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
2 files changed, 35 insertions, 0 deletions
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 bf6a6ecbc..ff4f47471 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 @@ -657,6 +657,12 @@ namespace Tango.MachineStudio.Developer.ViewModels /// Gets or sets to running job command. /// </summary> public RelayCommand ToRunningJobCommand { get; set; } + + /// <summary> + /// Gets or sets the reset process parameters command. + /// </summary> + public RelayCommand ResetProcessParametersCommand { get; set; } + #endregion #region Constructors @@ -713,6 +719,7 @@ namespace Tango.MachineStudio.Developer.ViewModels ImportEmbroideryFileCommand = new RelayCommand(ImportEmbroideryFile, () => SelectedMachine != null && CanWork); DisplayJobEmbroideryFileCommand = new RelayCommand<Job>(DisplayJobEmbroideryFile, () => CanWork); ReloadMachinesCommand = new RelayCommand(() => LoadMachine(), () => CanWork && SelectedMachine != null); + ResetProcessParametersCommand = new RelayCommand(ResetProcessParameters); ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; @@ -1491,6 +1498,29 @@ namespace Tango.MachineStudio.Developer.ViewModels CanWork = true; } + /// <summary> + /// Resets the process parameters. + /// </summary> + private async void ResetProcessParameters() + { + if (_notification.ShowQuestion("This will reset the process parameters. Are you sure?")) + { + using (_notification.PushTaskItem("Resetting process parameters...")) + { + try + { + await ApplicationManager.ConnectedMachine.UploadProcessParameters(new ProcessParametersTable()); + _notification.ShowInfo("Heaters are turned off."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resetting process parameters."); + _notification.ShowError("Error resetting process parameters." + Environment.NewLine + ex.Message); + } + } + } + } + #endregion #region Active Job Management 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 4733ebf07..627e4d63e 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 @@ -1520,6 +1520,11 @@ </ListBox> <StackPanel Margin="10 20" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="#202020" Foreground="#202020" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> + <TextBlock TextWrapping="Wrap" TextAlignment="Center"> + RESET + </TextBlock> + </Button> <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon> |
