diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs | 60 |
1 files changed, 60 insertions, 0 deletions
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 new file mode 100644 index 000000000..9ce559047 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.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 SingleGraphItem : 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 SingleGraphElementEditor Editor { get; set; } + + public override object Data => TechMonitor; + + public SingleGraphItem() : base() + { + Name = "Single Channel Graph"; + Description = "Single channel real-time graph"; + Image = ResourceHelper.GetImageFromResources("Images/single-graph.png"); + } + + public SingleGraphItem(TechMonitor techMonitor) : this() + { + TechMonitor = techMonitor; + } + + public override TechItem Clone() + { + MonitorItem cloned = base.Clone() as MonitorItem; + cloned.TechMonitor = TechMonitor; + return cloned; + } + } +} |
