diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-23 11:37:09 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-23 11:37:09 +0300 |
| commit | 8a84d33ab8d8a44b1036bb8c5707858d7a25b123 (patch) | |
| tree | 26658a7d67adade1389a4d71ded4d9a56c0e7e04 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels | |
| parent | 81dd84b2749ee06fa592ac64075c0d8195972aa5 (diff) | |
| parent | 87444d2a16e63e9b992c25a9e9fbaf3bb5b91025 (diff) | |
| download | Tango-8a84d33ab8d8a44b1036bb8c5707858d7a25b123.tar.gz Tango-8a84d33ab8d8a44b1036bb8c5707858d7a25b123.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels')
2 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs index 76e138e0e..8034ceb69 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectedMachineViewVM.cs @@ -18,6 +18,7 @@ namespace Tango.MachineStudio.UI.ViewModels Cancel, Disconnect, UploadHardwareConfig, + Reset, } private IStudioApplicationManager _applicationManager; @@ -33,11 +34,20 @@ namespace Tango.MachineStudio.UI.ViewModels public RelayCommand UploadHardwareConfigurationCommand { get; set; } + public RelayCommand ResetCommand { get; set; } + public ConnectedMachineViewVM(IStudioApplicationManager application) { ApplicationManager = application; DisconnectCommand = new RelayCommand(Disconnect); UploadHardwareConfigurationCommand = new RelayCommand(UploadHardwareConfiguration); + ResetCommand = new RelayCommand(Reset); + } + + private void Reset() + { + Result = ConnectedMachineVMResult.Reset; + Accept(); } private void UploadHardwareConfiguration() diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index a7762a5e6..278926de9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -545,6 +545,25 @@ namespace Tango.MachineStudio.UI.ViewModels } } } + else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Reset) + { + if (NotificationProvider.ShowQuestion("This will reset the embedded device. Are you sure?")) + { + using (NotificationProvider.PushTaskItem("Uploading hardware configuration...")) + { + try + { + await ApplicationManager.ConnectedMachine.Reset(); + NotificationProvider.ShowInfo("Embedded device has been restarted."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resetting embedded device."); + NotificationProvider.ShowError("Error resetting embedded device." + Environment.NewLine + ex.Message); + } + } + } + } }); } |
