aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-02-18 09:23:15 +0200
committerRoy <roy.mail.net@gmail.com>2018-02-18 09:23:15 +0200
commit858a2b114f78c87883510e3627874c7632f81177 (patch)
tree3999c39b7ac85ec7b07cddd3b72e370e1b6e0487 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
parente332170566c295fb4ff375498867f984f1570707 (diff)
downloadTango-858a2b114f78c87883510e3627874c7632f81177.tar.gz
Tango-858a2b114f78c87883510e3627874c7632f81177.zip
Developer redesign..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs47
1 files changed, 29 insertions, 18 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 013129fc1..267f0bb0c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -32,6 +32,7 @@ using Tango.MachineStudio.Technician.ViewModels;
using Tango.MachineStudio.Common.Diagnostics;
using Tango.MachineStudio.Common.Video;
using Tango.Integration.Services;
+using Tango.MachineStudio.Developer.Navigation;
namespace Tango.MachineStudio.Developer.ViewModels
{
@@ -46,6 +47,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
private Dictionary<String, GraphControllerBase> _controllers;
private int _fullScreenGraphIndex;
private JobHandler _jobHandler;
+ private DeveloperNavigationManager _navigation;
#region Properties
@@ -148,7 +150,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
_selectedJob = value;
RaisePropertyChangedAuto();
- OnSelectedJobChanged();
}
}
@@ -427,6 +428,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
public RelayCommand ExitFullScreenCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the load job command.
+ /// </summary>
+ public RelayCommand LoadJobCommand { get; set; }
+
#endregion
#region Constructors
@@ -452,9 +458,10 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="applicationManager">The application manager.</param>
/// <param name="notificationProvider">The notification provider.</param>
[PreferredConstructor]
- public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider) : this(view)
+ public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation) : this(view)
{
_notification = notificationProvider;
+ _navigation = navigation;
ApplicationManager = applicationManager;
VideoCaptureProvider = videoCaptureProvider;
diagnosticsFrameProvider.FrameReceived += DiagnosticsFrameProvider_FrameReceived;
@@ -476,6 +483,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning);
CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar);
ExitFullScreenCommand = new RelayCommand(ExitFullScreen);
+ LoadJobCommand = new RelayCommand(LoadJob, () => SelectedJob != null);
ToggleCameraCommand = new RelayCommand<CaptureDevice>(ToggleCamera);
@@ -585,22 +593,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
/// <summary>
- /// Called when the selected job has been changed.
- /// </summary>
- protected virtual void OnSelectedJobChanged()
- {
- if (SelectedJob != null)
- {
- SelectedSegment = SelectedJob.Segments.FirstOrDefault();
-
- SelectedJob.LengthChanged -= SelectedJob_LengthChanged;
- SelectedJob.LengthChanged += SelectedJob_LengthChanged;
-
- UpdateEstimatedDuration();
- }
- }
-
- /// <summary>
/// Called when the selected group history has been changed
/// </summary>
protected virtual void OnSelectedGroupHistoryChanged()
@@ -623,6 +615,25 @@ namespace Tango.MachineStudio.Developer.ViewModels
#region Private Methods
+ private void LoadJob()
+ {
+ if (SelectedJob != null)
+ {
+ Task.Factory.StartNew(() =>
+ {
+ SelectedSegment = SelectedJob.Segments.FirstOrDefault();
+
+ SelectedJob.LengthChanged -= SelectedJob_LengthChanged;
+ SelectedJob.LengthChanged += SelectedJob_LengthChanged;
+
+ UpdateEstimatedDuration();
+ });
+
+ _navigation.NavigateTo(DeveloperNavigationView.JobView);
+
+ }
+ }
+
private void ClearGraphs()
{
_controllers.ToList().ForEach(x => x.Value.Clear());