From 9fa032b7aea6f2fbfdae05d21c3c10db174e1662 Mon Sep 17 00:00:00 2001 From: Roy Date: Sat, 3 Feb 2018 14:31:17 +0200 Subject: Same as previous.. --- .../Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs') 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 4f045627d..08b8897d2 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 @@ -22,6 +22,7 @@ using Tango.Video.DirectCapture; using Tango.Integration.Operators; using Tango.PMR.Diagnostics; using System.Reflection; +using Tango.PMR.Common; namespace Tango.MachineStudio.Developer.ViewModels { @@ -470,7 +471,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } } - private void MachineOperator_DiagnosticsDataAvailable(object sender, StartDiagnosticsResponse response) + private void MachineOperator_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse response) { foreach (var prop in response.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { @@ -485,7 +486,8 @@ namespace Tango.MachineStudio.Developer.ViewModels } else { - //Multi Graph... + DoubleArray[] arrayOfDoubles = Enumerable.ToArray(prop.GetValue(response) as IEnumerable); + (controller as GraphMultiController).PushData(arrayOfDoubles.Select(x => x.Data.ToList()).ToList()); } } } @@ -911,11 +913,13 @@ namespace Tango.MachineStudio.Developer.ViewModels for (int i = 0; i < sensor.ChannelCount; i++) { + var randomColor = new SolidColorBrush(Core.Helpers.ColorHelper.GetRandomColor()); + (controller as GraphMultiController).AddSeries(new DataYSeries() { Name = sensor.Description.First().ToString() + (i + 1), UseFillAndStroke = true, - Stroke = new SolidColorBrush(Core.Helpers.ColorHelper.GetRandomColor()) + Stroke = randomColor }); } -- cgit v1.3.1