From f4b1d1fce72c7b478d9603db8dfd66e471c9f467 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 11 Feb 2020 21:14:24 +0200 Subject: Implemented DisableRendering on RealTimeGraphX. Implemented partial rendering on tech board. --- .../ViewModels/MachineTechViewVM.cs | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 36f7940ed..90ca3c017 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -116,6 +116,8 @@ namespace Tango.MachineStudio.Technician.ViewModels { _selectedTab.IsSelected = true; } + + EnableRenderingForSelectedTabGraphs(); } } @@ -732,6 +734,81 @@ namespace Tango.MachineStudio.Technician.ViewModels #region Private Methods + private void EnableRenderingForSelectedTabGraphs() + { + if (SelectedTab != null) + { + lock (_elementsLock) + { + var elements = Tabs.SelectMany(x => x.Elements).ToList(); + + foreach (var element in elements) + { + if (SelectedTab.Elements.Contains(element)) + { + var item = element.HostedElement as TechItem; + + if (item != null) + { + if (item.GetType() == typeof(SingleGraphItem)) + { + SingleGraphItem graphItem = item as SingleGraphItem; + + TechGraphController controller = null; + + if (_singleControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = false; + } + } + else if (item.GetType() == typeof(MultiGraphItem)) + { + MultiGraphItem graphItem = item as MultiGraphItem; + + TechGraphController controller = null; + + if (_multiControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = false; + } + } + } + } + else + { + var item = element.HostedElement as TechItem; + + if (item != null) + { + if (item.GetType() == typeof(SingleGraphItem)) + { + SingleGraphItem graphItem = item as SingleGraphItem; + + TechGraphController controller = null; + + if (_singleControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = true; + } + } + else if (item.GetType() == typeof(MultiGraphItem)) + { + MultiGraphItem graphItem = item as MultiGraphItem; + + TechGraphController controller = null; + + if (_multiControllers.TryGetValue(graphItem, out controller)) + { + controller.DisableRendering = true; + } + } + } + } + } + } + } + } + /// /// Gets the last data point from a protobuf repeated field. /// -- cgit v1.3.1