diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 12:03:55 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-03 12:03:55 +0300 |
| commit | c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694 (patch) | |
| tree | 3b92b537099625fd2d29a4e08378194c3c62f3c4 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | |
| parent | 5ab2e8a2edf1ce487976da347a5e03d18ff307b1 (diff) | |
| download | Tango-c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694.tar.gz Tango-c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694.zip | |
Machine Studio.
Implemented upload hardware configuration from connected machine view.
Implemented process parameters dragging through developer module settings :/
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 27 |
1 files changed, 25 insertions, 2 deletions
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 aa0eedefb..45ae68cc5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -502,9 +502,32 @@ namespace Tango.MachineStudio.UI.ViewModels } else { - _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>((x) => + _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>(async (x) => { - DisconnectFromMachine(); + if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Disconnect) + { + DisconnectFromMachine(); + } + else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.UploadHardwareConfig) + { + if (NotificationProvider.ShowQuestion("This will reset the machine hardware configuration to the database configuration. Are you sure?")) + { + using (NotificationProvider.PushTaskItem("Uploading hardware configuration...")) + { + try + { + var configuration = ApplicationManager.ConnectedMachine.Machine.Configuration; + await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(configuration.HardwareVersion, configuration); + NotificationProvider.ShowInfo("Hardware configuration uploaded successfully."); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error upload hardware configuration."); + NotificationProvider.ShowError("Error upload hardware configuration." + Environment.NewLine + ex.Message); + } + } + } + } }); } |
