aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:25:18 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:25:18 +0200
commit6f3b655069d0adb709f4f9cdaf25eadcd353c06b (patch)
tree25beab198b398ce3eba2f6f97cddd1659369b9a2 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels
parent2e562cd2949b98a130b23772a0d6e8ba938c2cd9 (diff)
parent1d5c93a263a03b7f9af9490c1107a9eef4fe0438 (diff)
downloadTango-6f3b655069d0adb709f4f9cdaf25eadcd353c06b.tar.gz
Tango-6f3b655069d0adb709f4f9cdaf25eadcd353c06b.zip
MREGE
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs21
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()