From ff183d99def579aeaaee06d89ad6bbbfa47c4107 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 16 Jan 2018 13:15:52 +0200 Subject: Implemented velocity graph on technician module using mouse position. --- .../ViewModels/SensorsViewVM.cs | 17 ++++++++++-- .../Views/SensorsView.xaml | 32 ++++++++++++++++++++++ .../Views/SensorsView.xaml.cs | 1 + 3 files changed, 48 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs index 5b28916ec..c3cf7386e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs @@ -82,9 +82,11 @@ namespace Tango.MachineStudio.Technician.ViewModels TemperatureController = new GraphController(); PressureController = new GraphController(); + VelocityController = new GraphController(); _controllers.Add(TemperatureController); _controllers.Add(PressureController); + _controllers.Add(VelocityController); var module = moduleLoader.UserModules.SingleOrDefault(x => x is TechnicianModule) as TechnicianModule; @@ -126,8 +128,9 @@ namespace Tango.MachineStudio.Technician.ViewModels /// The data. private void MachineOperator_SensorsDataAvailable(object sender, PushSensorsResponse data) { - TemperatureController.PushData(data.Temperature.ToArray().Select(Convert.ToDouble).ToArray()); - PressureController.PushData(data.Temperature.ToArray().Select(Convert.ToDouble).ToArray()); + TemperatureController.PushData(data.Temperature.ToArray()); + PressureController.PushData(data.Temperature.ToArray()); + VelocityController.PushData(data.Velocity.ToArray()); } #endregion @@ -174,6 +177,16 @@ namespace Tango.MachineStudio.Technician.ViewModels set { _pressureController = value; RaisePropertyChanged(nameof(PressureController)); } } + private GraphController _velocityController; + /// + /// Gets or sets the velocity sensor graph controller . + /// + public GraphController VelocityController + { + get { return _velocityController; } + set { _velocityController = value; RaisePropertyChanged(nameof(VelocityController)); } + } + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml index 2e074ec3c..63feae2f3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml @@ -129,6 +129,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs index 4727a3603..c94c26414 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs @@ -31,6 +31,7 @@ namespace Tango.MachineStudio.Technician.Views _syncManager = new SyncManager(); _syncManager.AddGraph(graphTemperature); _syncManager.AddGraph(graphPressure); + _syncManager.AddGraph(graphVelocity); _syncManager.RefreshRate = 30; _syncManager.Start(); } -- cgit v1.3.1