diff options
| author | Avi Levkovich <avi@twine-s.com> | 2019-11-28 18:00:04 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2019-11-28 18:00:04 +0200 |
| commit | bac355d83fbd8628336bfa763e9a8b7f1db164e2 (patch) | |
| tree | 037112c61a06eba04610f01b9c9e559b49cf5777 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs | |
| parent | 09b91aa98f10b7109cb97312021de8925a4b5339 (diff) | |
| parent | 8276e5eb7c56b58ed86f611ca5bd9b1dc56b25b9 (diff) | |
| download | Tango-bac355d83fbd8628336bfa763e9a8b7f1db164e2.tar.gz Tango-bac355d83fbd8628336bfa763e9a8b7f1db164e2.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index 5f2dcd00d..5fd086198 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -188,6 +188,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels /// Gets or sets the clone machine command. /// </summary> public RelayCommand CloneMachineCommand { get; set; } + + /// <summary> + /// Gets or sets the reset device registration command. + /// </summary> + public RelayCommand ResetDeviceRegistrationCommand { get; set; } + #endregion #region Constructors @@ -218,7 +224,9 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels AddSpoolCommand = new RelayCommand(AddNewSpool); RemoveSpoolCommand = new RelayCommand(RemoveSpool, () => SelectedSpool != null); CloneMachineCommand = new RelayCommand(CloneMachine, () => SelectedMachine != null); + ResetDeviceRegistrationCommand = new RelayCommand(ResetDeviceRegistration); } + #endregion #region Application Ready @@ -430,6 +438,9 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels ActiveMachine = ActiveMachine.Clone(); ActiveMachine.Name = ""; ActiveMachine.SerialNumber = ""; + ActiveMachine.IsDeviceRegistered = false; + ActiveMachine.DeviceId = null; + ActiveMachine.DeviceName = null; ActiveMachineAdapter.Context.Machines.Add(ActiveMachine); } } @@ -690,6 +701,16 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels } } + private void ResetDeviceRegistration() + { + if (_notification.ShowQuestion("Are you sure you wish to reset this machine device registration?")) + { + ActiveMachine.IsDeviceRegistered = false; + ActiveMachine.DeviceId = null; + ActiveMachine.DeviceName = null; + } + } + #endregion private void CloneMachine() |
