aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-12-19 18:01:01 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-12-19 18:01:01 +0200
commit1208554e06da8aec1b074932df488769572ffcfb (patch)
tree9858ededeb8badda5fc8b3052ef9745e419f35fd /Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
parent690604e6167bfa4fea0ab02f8b24a68142e8b546 (diff)
downloadTango-1208554e06da8aec1b074932df488769572ffcfb.tar.gz
Tango-1208554e06da8aec1b074932df488769572ffcfb.zip
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.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs33
1 files changed, 33 insertions, 0 deletions
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
/// </summary>
public RelayCommand ValidateCartridgeCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the start thread loading sequence command.
+ /// </summary>
+ public RelayCommand StartThreadLoadingCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the finalize thread loading command.
+ /// </summary>
+ 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<string>()
{
@@ -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
}
}