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-15 00:29:13 +0200
committerRoy <roy.mail.net@gmail.com>2018-02-15 00:29:13 +0200
commite4c917c43e90a4453c6cd5b1842a418dc0f1b514 (patch)
tree165829adcac4b2fc600640b18bb3a743a55a3bea /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
parentd5018576f325fb85983c4ad34c169d4b4e8d1a55 (diff)
downloadTango-e4c917c43e90a4453c6cd5b1842a418dc0f1b514.tar.gz
Tango-e4c917c43e90a4453c6cd5b1842a418dc0f1b514.zip
Working on Data Capture Module..
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.cs31
1 files changed, 19 insertions, 12 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 148e4375c..10c35b3b9 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
@@ -29,6 +29,7 @@ using Tango.Integration.Printing;
using Tango.Integration.Diagnostics;
using Microsoft.Win32;
using Tango.MachineStudio.Technician.ViewModels;
+using Tango.MachineStudio.Common.Diagnostics;
namespace Tango.MachineStudio.Developer.ViewModels
{
@@ -496,10 +497,11 @@ 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) : this(view)
+ public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider) : this(view)
{
_notification = notificationProvider;
ApplicationManager = applicationManager;
+ diagnosticsFrameProvider.FrameReceived += DiagnosticsFrameProvider_FrameReceived;
//Initialize Commands...
EditMachineCommand = new RelayCommand(EditMachine, () => SelectedMachine != null);
@@ -520,8 +522,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
ExitFullScreenCommand = new RelayCommand(ExitFullScreen);
MediaRecordingCommand = new RelayCommand(StartDiagnosticsRecording, () => !Recorder.IsRecording && MachineOperator != null && !Player.IsPlaying);
MediaStopCommand = new RelayCommand(StopRecorderOrPlayer, () => Recorder.IsRecording || Player.IsPlaying);
- MediaLoadCommand = new RelayCommand(LoadDiagnosticsRecordingFile,() => !Recorder.IsRecording && !Player.IsPlaying);
- MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause,() => !Recorder.IsRecording && Player.IsLoaded);
+ MediaLoadCommand = new RelayCommand(LoadDiagnosticsRecordingFile, () => !Recorder.IsRecording && !Player.IsPlaying);
+ MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause, () => !Recorder.IsRecording && Player.IsLoaded);
CaptureDevices = new ObservableCollection<CaptureDevice>();
var availableDevices = CaptureDevice.GetAvailableCaptureDevices();
@@ -549,6 +551,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
#region Event Handlers
+ private void DiagnosticsFrameProvider_FrameReceived(object sender, PushDiagnosticsResponse response)
+ {
+ PopulateDiagnosticsData(response);
+ }
+
private void Player_FrameReceived(object sender, DataFileFrame frame)
{
PopulateDiagnosticsData(frame.PushDiagnosticsResponse);
@@ -567,15 +574,15 @@ namespace Tango.MachineStudio.Developer.ViewModels
private void MachineOperator_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse response)
{
- if (Recorder.IsRecording)
- {
- Recorder.Write(response);
- }
+ //if (Recorder.IsRecording)
+ //{
+ // Recorder.Write(response);
+ //}
- if (!Player.IsPlaying)
- {
- PopulateDiagnosticsData(response);
- }
+ //if (!Player.IsPlaying)
+ //{
+ // PopulateDiagnosticsData(response);
+ //}
}
/// <summary>
@@ -1085,7 +1092,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (SelectedBrushStop != null && SelectedSegment != null)
{
SelectedSegment.BrushStops.Remove(SelectedBrushStop);
-
+
if (SelectedSegment.BrushStops.Count > 1)
{
SelectedSegment.BrushStops.Last().OffsetPercent = 100;