aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-08-29 16:32:02 +0300
committerAvi Levkovich <avi@twine-s.com>2019-08-29 16:32:02 +0300
commitb3107df005ae6d2bf7ca108494cab77d0c093399 (patch)
treefc7a66cb1801e458b5e7719dbe22f309ec931be3 /Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels
parent8dd7b8d63adf21c2f872074f140d9908c0925fc4 (diff)
parente3d237fb089078315149ab02fa8450522d9cc6d1 (diff)
downloadTango-b3107df005ae6d2bf7ca108494cab77d0c093399.tar.gz
Tango-b3107df005ae6d2bf7ca108494cab77d0c093399.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs20
1 files changed, 20 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 8e5393eda..1662a3ede 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs
@@ -96,6 +96,11 @@ namespace Tango.MachineEM.UI.ViewModels
/// </summary>
public RelayCommand ClearCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the validate cartridge command.
+ /// </summary>
+ public RelayCommand ValidateCartridgeCommand { get; set; }
+
#endregion
#region Constructors
@@ -125,6 +130,7 @@ namespace Tango.MachineEM.UI.ViewModels
StopCommand = new RelayCommand(Stop, (x) => Emulator.IsStarted);
CancelCommand = new RelayCommand(Cancel, (x) => _running);
ClearCommand = new RelayCommand(() => Log = String.Empty);
+ ValidateCartridgeCommand = new RelayCommand(ValidateCartridge, (x) => Emulator.IsStarted);
Ports = new List<string>()
{
@@ -198,6 +204,20 @@ namespace Tango.MachineEM.UI.ViewModels
}
+ private async void ValidateCartridge()
+ {
+ LogManager.Log("Sending cartridge validation request...");
+ try
+ {
+ var index = await Emulator.ValidateCartridge();
+ LogManager.Log($"Cartridge validation response received: '{index}'.");
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Cartridge validation request failed.");
+ }
+ }
+
#endregion
}
}