diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-09-26 10:01:01 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-09-26 10:01:01 +0300 |
| commit | e99391a32439a4ce5f89fde8237cb68257f36ed0 (patch) | |
| tree | 0552936f6a0994b0a18600b085234b00f649a2c9 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels | |
| parent | ba1c45d36da2e15870bae36b3bdfee4271d7292f (diff) | |
| parent | 94b83ea6d7e62534219801dcf1d53ee6e187837d (diff) | |
| download | Tango-e99391a32439a4ce5f89fde8237cb68257f36ed0.tar.gz Tango-e99391a32439a4ce5f89fde8237cb68257f36ed0.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 32 |
1 files changed, 31 insertions, 1 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 e04b1539a..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 @@ -1810,7 +1840,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.LogFormat("Adding new segment to job {0}...", ActiveJob.Name); Segment seg = new Segment(); seg.Job = ActiveJob; - seg.Name = "Untitled Segment"; + seg.Name = "SEGMENT"; seg.Length = 10; if (ActiveJob.Segments.Count > 0) |
