From 09c1e15643f82b2187019025682b5da0bfbe1c1d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 21 Nov 2019 09:20:44 +0200 Subject: Fixed issue with machine clone and device registration. Implemented device registration details and reset in Machine Designer. --- .../ViewModels/MainViewVM.cs | 21 +++ .../Views/MachineSettingsView.xaml | 176 ++++++++++++--------- .../Views/MachinesView.xaml | 4 +- 3 files changed, 122 insertions(+), 79 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner') 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. /// public RelayCommand CloneMachineCommand { get; set; } + + /// + /// Gets or sets the reset device registration command. + /// + 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() diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index 40ce9ea08..5e3f170dd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -27,84 +27,104 @@ - - - - - - - - - Serial Number - - - Name - - - Machine Version - - - Organization - - - Default RML - - - Loaded RML - - - Default Color Space - - - Default Segment Length - - - Default Spool Type - - - OS Key - - - Device COM Port - - - - - Auto Login - - - Auto Check For Updates - - - Setup Activation - - - Setup Remote Assistance - - - Setup UWF - - - Setup Firmware - - - Setup FPGA - - - Is Demo Machine - - - Suspend Version Update - - - Force Version Update - - - Update Schema on Update - - - - + + + + + + + + + + Serial Number + + + Name + + + Machine Version + + + Organization + + + Default RML + + + Loaded RML + + + Default Color Space + + + Default Segment Length + + + Default Spool Type + + + OS Key + + + Device COM Port + + + + + Auto Login + + + Auto Check For Updates + + + Setup Activation + + + Setup Remote Assistance + + + Setup UWF + + + Setup Firmware + + + Setup FPGA + + + Is Demo Machine + + + Suspend Version Update + + + Force Version Update + + + Update Schema on Update + + + + + + + + + Device Registration + + Device ID: + + + + Device Name: + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml index 35b578b6a..a231e92a3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml @@ -15,6 +15,7 @@ d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + @@ -73,7 +74,8 @@ - + + -- cgit v1.3.1