diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-13 13:58:45 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-13 13:58:45 +0300 |
| commit | 4cc4089f36b0a9b9d754e33acb49da930f846699 (patch) | |
| tree | 314c77ca012d10ff1440a112893072943e479066 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs | |
| parent | 8d58d0b03648069600f8abf39dbe68b16c90559b (diff) | |
| download | Tango-4cc4089f36b0a9b9d754e33acb49da930f846699.tar.gz Tango-4cc4089f36b0a9b9d754e33acb49da930f846699.zip | |
Some fixed to TCC mobile design.
Implemented DFU reset on Machine Operator.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index 47d5835f5..b2f93c29d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -17,6 +17,7 @@ namespace Tango.PPC.Technician.ViewModels { private IOperationSystemManager _os; private Timer _statsTimer; + private bool _resettingDevice; private float _cpu; public float CPU @@ -39,6 +40,8 @@ namespace Tango.PPC.Technician.ViewModels set { _temperature = value; RaisePropertyChangedAuto(); } } + public RelayCommand ResetDeviceCommand { get; set; } + public RelayCommand RestartCommand { get; set; } public RelayCommand ShutdownCommand { get; set; } @@ -58,6 +61,27 @@ namespace Tango.PPC.Technician.ViewModels ShutdownCommand = new RelayCommand(ShutdownSystem); FactoryResetCommand = new RelayCommand(FactoryReset); ExitToExplorerCommand = new RelayCommand(ExitToExplorer); + ResetDeviceCommand = new RelayCommand(ResetDevice, () => !_resettingDevice); + } + + private async void ResetDevice() + { + try + { + _resettingDevice = true; + ResetDeviceCommand.RaiseCanExecuteChanged(); + await MachineProvider.MachineOperator.ResetDFU(); + await NotificationProvider.ShowInfo("Embedded device has been reset successfully."); + } + catch (Exception ex) + { + await NotificationProvider.ShowError(ex.FlattenMessage()); + } + finally + { + _resettingDevice = false; + ResetDeviceCommand.RaiseCanExecuteChanged(); + } } private async void FactoryReset() |
