diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-19 15:34:54 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-19 15:34:54 +0300 |
| commit | 3cb25038b7742c7599a0e1059a7ca280fae57e9a (patch) | |
| tree | 77f37ef9cefa42a03db5852716d9915e35be1e1f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | c4feba445987d33c7bfcc304a3be368e8458d408 (diff) | |
| download | Tango-3cb25038b7742c7599a0e1059a7ca280fae57e9a.tar.gz Tango-3cb25038b7742c7599a0e1059a7ca280fae57e9a.zip | |
Machine Studio v1.0.0.18
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
4 files changed, 31 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 625616f0e..43f0c081d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Thu 07/19/2018 14:46:09.13 +Thu 07/19/2018 15:24:26.26 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); + } + } + } + } }); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index a4f253de3..39c42392d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -117,6 +117,7 @@ <Grid Grid.Row="1"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Height="40" VerticalAlignment="Bottom"> + <Button Height="Auto" Width="140" Command="{Binding ResetCommand}" Background="#FF5454" BorderBrush="#FF5454" Margin="0 0 10 0" ToolTip="Reset the embedded device">RESET</Button> <Button Height="Auto" Command="{Binding UploadHardwareConfigurationCommand}" ToolTip="Upload the current hardware configuration stored for this machine"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center">UPLOAD HW CONFIG</TextBlock> |
