aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 17:45:53 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 17:45:53 +0200
commitc43439d0c4b7f4434eaf277c0f60c5e3c0494ac2 (patch)
tree62988fdea921b80df2ab45e78b18cc24a2e10fdd /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
parenteb2c264422b98458979bc96504ce8830a527d48c (diff)
downloadTango-c43439d0c4b7f4434eaf277c0f60c5e3c0494ac2.tar.gz
Tango-c43439d0c4b7f4434eaf277c0f60c5e3c0494ac2.zip
Removed Shlomo PMR Messages.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs16
1 files changed, 13 insertions, 3 deletions
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 7086cfb4d..52d67a141 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
@@ -30,6 +30,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
private INotificationProvider _notification;
private TimeSpan _runningJobEstimatedDuration;
+ private Dictionary<String, GraphControllerBase> _controllers;
#region Properties
@@ -393,6 +394,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
Graphs = new ObservableCollection<IRealTimeGraph>();
+ _controllers = new Dictionary<String, GraphControllerBase>();
}
/// <summary>
@@ -846,19 +848,22 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (Graphs.Count < 8)
{
IRealTimeGraph graphControl = null;
+ GraphControllerBase controller = null;
if (!sensor.MultiChannel)
{
graphControl = new RealTimeGraphControl();
+ controller = new GraphController();
+ graphControl.Controller = controller;
}
else
{
graphControl = new RealTimeGraphMultiControl();
- GraphMultiController controller = new GraphMultiController();
+ controller = new GraphMultiController();
for (int i = 0; i < sensor.ChannelCount; i++)
{
- controller.AddSeries(new DataYSeries()
+ (controller as GraphMultiController).AddSeries(new DataYSeries()
{
Name = sensor.Description.First().ToString() + (i + 1),
UseFillAndStroke = true,
@@ -881,6 +886,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
};
Graphs.Add(graphControl);
AvailableSensors.Remove(sensor);
+
+ _controllers.Add(sensor.Name, controller);
}
else
{
@@ -908,8 +915,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="graph">The graph.</param>
public void RemoveGraph(IRealTimeGraph graph)
{
+ var sensor = graph.Tag as Sensor;
+ _controllers.Remove(sensor.Name);
+ graph.InnerGraph.Dispose();
Graphs.Remove(graph);
- AvailableSensors.Insert(0, graph.Tag as Sensor);
+ AvailableSensors.Insert(0, sensor);
}
#endregion