From 064a839e731d7d96922b468330fab5c065609a01 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 25 Jul 2018 14:03:04 +0300 Subject: Implemented graphs auto range, pause & clear in tech board module. --- .../TechItems/MultiGraphItem.cs | 43 ++++++++++++++++++++++ .../TechItems/SingleGraphItem.cs | 43 ++++++++++++++++++++++ 2 files changed, 86 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs index 029580a10..072720c4b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.MachineStudio.Technician.Editors; using Tango.MachineStudio.Technician.Helpers; using Tango.SharedUI.Helpers; @@ -81,6 +82,36 @@ namespace Tango.MachineStudio.Technician.TechItems set { _useMinMax = value; RaisePropertyChangedAuto(); } } + private bool _useAutoRange; + /// + /// Gets or sets a value indicating whether [use automatic range]. + /// + public bool UseAutoRange + { + get { return _useAutoRange; } + set { _useAutoRange = value; RaisePropertyChangedAuto(); } + } + + private bool _isPaused; + /// + /// Gets or sets a value indicating whether this instance is paused. + /// + public bool IsPaused + { + get { return _isPaused; } + set + { + _isPaused = value; RaisePropertyChangedAuto(); + + if (Editor != null) + { + Editor.InnerGraph.Controller.IsPaused = _isPaused; + } + } + } + + public RelayCommand ClearCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -90,6 +121,14 @@ namespace Tango.MachineStudio.Technician.TechItems Name = "Multi Channel Graph"; Description = "Multi channel real-time graph"; Image = ResourceHelper.GetImageFromResources("Images/multi-graph.png"); + + ClearCommand = new RelayCommand(() => + { + if (Editor != null) + { + Editor.InnerGraph.Controller.Clear(); + } + }); } /// @@ -109,6 +148,10 @@ namespace Tango.MachineStudio.Technician.TechItems { MultiGraphItem cloned = base.Clone() as MultiGraphItem; cloned.TechMonitor = TechMonitor; + cloned.Min = Min; + cloned.Max = Max; + cloned.UseMinMax = UseMinMax; + cloned.UseAutoRange = UseAutoRange; return cloned; } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs index 148368881..8a88aad7a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using System.Windows.Media; using System.Xml.Serialization; using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.MachineStudio.Technician.Editors; using Tango.MachineStudio.Technician.Helpers; using Tango.SharedUI.Helpers; @@ -81,6 +82,36 @@ namespace Tango.MachineStudio.Technician.TechItems set { _useMinMax = value; RaisePropertyChangedAuto(); } } + private bool _useAutoRange; + /// + /// Gets or sets a value indicating whether [use automatic range]. + /// + public bool UseAutoRange + { + get { return _useAutoRange; } + set { _useAutoRange = value; RaisePropertyChangedAuto(); } + } + + private bool _isPaused; + /// + /// Gets or sets a value indicating whether this instance is paused. + /// + public bool IsPaused + { + get { return _isPaused; } + set + { + _isPaused = value; RaisePropertyChangedAuto(); + + if (Editor != null) + { + Editor.InnerGraph.Controller.IsPaused = _isPaused; + } + } + } + + public RelayCommand ClearCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -91,6 +122,14 @@ namespace Tango.MachineStudio.Technician.TechItems Description = "Single channel real-time graph"; Image = ResourceHelper.GetImageFromResources("Images/single-graph.png"); Color = Colors.DodgerBlue; + + ClearCommand = new RelayCommand(() => + { + if (Editor != null) + { + Editor.InnerGraph.Controller.Clear(); + } + }); } /// @@ -110,6 +149,10 @@ namespace Tango.MachineStudio.Technician.TechItems { SingleGraphItem cloned = base.Clone() as SingleGraphItem; cloned.TechMonitor = TechMonitor; + cloned.Min = Min; + cloned.Max = Max; + cloned.UseMinMax = UseMinMax; + cloned.UseAutoRange = UseAutoRange; return cloned; } } -- cgit v1.3.1