diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-02-09 03:49:59 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-02-09 03:49:59 +0200 |
| commit | bfcefc0cf95f3b8d5243908753129c79bad8dc8b (patch) | |
| tree | 41ff2e6f9120d3f2317c4f773547c837ce48cc14 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs | |
| parent | 1b74cee6e9073f3542b4733574ab304f40fc033b (diff) | |
| download | Tango-bfcefc0cf95f3b8d5243908753129c79bad8dc8b.tar.gz Tango-bfcefc0cf95f3b8d5243908753129c79bad8dc8b.zip | |
Implemented MultiGraph on TechView.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs | 60 |
1 files changed, 60 insertions, 0 deletions
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 new file mode 100644 index 000000000..13591fb01 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; +using Tango.Integration.Observables; +using Tango.MachineStudio.Technician.Editors; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Technician.TechItems +{ + public class MultiGraphItem : TechItem + { + private TechMonitor _techMonitor; + [XmlIgnore] + public TechMonitor TechMonitor + { + get { return _techMonitor; } + set + { + TechMonitor old = _techMonitor; + + _techMonitor = value; + RaisePropertyChangedAuto(); + RaisePropertyChanged(nameof(Data)); + + if (_techMonitor != old && Editor != null) + { + Editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame); + Editor.InnerGraph.InvalidateGraph(); + } + } + } + + [XmlIgnore] + public MultiGraphElementEditor Editor { get; set; } + + public override object Data => TechMonitor; + + public MultiGraphItem() : base() + { + Name = "Single Channel Graph"; + Description = "Single channel real-time graph"; + Image = ResourceHelper.GetImageFromResources("Images/multi-graph.png"); + } + + public MultiGraphItem(TechMonitor techMonitor) : this() + { + TechMonitor = techMonitor; + } + + public override TechItem Clone() + { + MultiGraphItem cloned = base.Clone() as MultiGraphItem; + cloned.TechMonitor = TechMonitor; + return cloned; + } + } +} |
