From 1208554e06da8aec1b074932df488769572ffcfb Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Dec 2019 18:01:01 +0200 Subject: Implemented auto thread loading. Implemented advanced settings for technician. Implemented thread loading on emulator. Removed PowerUpSelectedRML from settings. Now using LoadedRml settings for ThreadLoading and PowerUp. --- .../Tango.MachineEM.UI/ViewModels/MainViewVM.cs | 33 +++++ .../Tango.MachineEM.UI/Views/MainView.xaml | 143 ++++++++++++--------- 2 files changed, 114 insertions(+), 62 deletions(-) (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI') diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs index 1662a3ede..f42e7f161 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs @@ -20,6 +20,7 @@ namespace Tango.MachineEM.UI.ViewModels private TcpServer TcpServer; private bool _running; private LogManager logManager = LogManager.Default; + private bool _isThreadLoading; #region Properties @@ -101,6 +102,16 @@ namespace Tango.MachineEM.UI.ViewModels /// public RelayCommand ValidateCartridgeCommand { get; set; } + /// + /// Gets or sets the start thread loading sequence command. + /// + public RelayCommand StartThreadLoadingCommand { get; set; } + + /// + /// Gets or sets the finalize thread loading command. + /// + public RelayCommand FinalizeThreadLoadingCommand { get; set; } + #endregion #region Constructors @@ -131,6 +142,8 @@ namespace Tango.MachineEM.UI.ViewModels CancelCommand = new RelayCommand(Cancel, (x) => _running); ClearCommand = new RelayCommand(() => Log = String.Empty); ValidateCartridgeCommand = new RelayCommand(ValidateCartridge, (x) => Emulator.IsStarted); + StartThreadLoadingCommand = new RelayCommand(StartThreadLoading, (x) => Emulator.IsStarted && !_isThreadLoading); + FinalizeThreadLoadingCommand = new RelayCommand(FinalizeThreadLoading, (x) => Emulator.IsStarted && _isThreadLoading); Ports = new List() { @@ -218,6 +231,26 @@ namespace Tango.MachineEM.UI.ViewModels } } + private async void StartThreadLoading() + { + LogManager.Log("Starting thread loading sequence..."); + Emulator.StartThreadLoading(); + _isThreadLoading = true; + InvalidateRelayCommands(); + + await Task.Delay(10000); + _isThreadLoading = false; + InvalidateRelayCommands(); + } + + private void FinalizeThreadLoading() + { + LogManager.Log("Finalizing thread loading sequence..."); + Emulator.FinalizeThreadLoading(); + _isThreadLoading = false; + InvalidateRelayCommands(); + } + #endregion } } diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 58fbfef4c..23154aafd 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -53,17 +53,95 @@ + - + + + + + + + + + STATUS + + + + + + + + IDS Packs Levels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MACHINE STATE + + + + OVERALL TEMPERATURE + + + + + + + + + + + - + HARDWARE EVENTS - +