From c9d3c1a7408f6f7a4814c1a8f5cf58a2d13e1694 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 3 Jul 2018 12:03:55 +0300 Subject: Machine Studio. Implemented upload hardware configuration from connected machine view. Implemented process parameters dragging through developer module settings :/ --- .../ViewModels/MainViewVM.cs | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs') 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((x) => + _notificationProvider.ShowModalDialog(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); + } + } + } + } }); } -- cgit v1.3.1