aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-02-09 13:41:58 +0200
committerRoy <roy.mail.net@gmail.com>2018-02-09 13:41:58 +0200
commitc8c9606e545f49aae3d9f0524775436adbdf27e9 (patch)
tree83d9fe870f652058af96f32b7159186f5b80f491 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels
parentbfcefc0cf95f3b8d5243908753129c79bad8dc8b (diff)
downloadTango-c8c9606e545f49aae3d9f0524775436adbdf27e9.tar.gz
Tango-c8c9606e545f49aae3d9f0524775436adbdf27e9.zip
Added my Controls Library !
Implemented Tech VU Item.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs23
1 files changed, 20 insertions, 3 deletions
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 8bbebdfb7..b0c899f06 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
@@ -115,6 +115,20 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
}
}
+ else if (item.GetType() == typeof(MeterItem))
+ {
+ MeterItem meterItem = item as MeterItem;
+
+ if (DateTime.Now > meterItem.LastUpdateTime.AddMilliseconds(meterItem.UpdateInterval))
+ {
+ var prop = _diagnoticsDataProperties.SingleOrDefault(x => x.Name == meterItem.TechMonitor.Name);
+
+ if (prop != null)
+ {
+ meterItem.Value = GetLastMonitorValue(meterItem.TechMonitor, prop.GetValue(data));
+ }
+ }
+ }
else if (item.GetType() == typeof(SingleGraphItem))
{
SingleGraphItem graphItem = item as SingleGraphItem;
@@ -184,7 +198,12 @@ namespace Tango.MachineStudio.Technician.ViewModels
{
var monitorItem = new MonitorItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
MonitorElementEditor editor = new MonitorElementEditor(monitorItem, bounds);
- editor.DataContext = monitorItem;
+ Elements.Add(editor);
+ }
+ else if (SelectedTechItem is MeterItem)
+ {
+ var meterItem = new MeterItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
+ MeterElementEditor editor = new MeterElementEditor(meterItem, bounds);
Elements.Add(editor);
}
else if (SelectedTechItem is SingleGraphItem)
@@ -192,7 +211,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
var graphItem = new SingleGraphItem(Adapter.TechMonitors.Where(x => !x.MultiChannel).FirstOrDefault());
SingleGraphElementEditor editor = new SingleGraphElementEditor(graphItem, bounds);
editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame);
- editor.DataContext = graphItem;
graphItem.Editor = editor;
@@ -208,7 +226,6 @@ namespace Tango.MachineStudio.Technician.ViewModels
var graphItem = new MultiGraphItem(Adapter.TechMonitors.Where(x => x.MultiChannel).FirstOrDefault());
MultiGraphElementEditor editor = new MultiGraphElementEditor(graphItem, bounds);
editor.InnerGraph.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame);
- editor.DataContext = graphItem;
graphItem.Editor = editor;