From c14073e78d2c5b9569f91f47609d431da48ba706 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 6 May 2018 13:50:14 +0300 Subject: Added start/stop diagnostics and debugging on PMR. Added device info to connected machine view. Added enable/disable diagnostics/debugging to connected machine view. Improved transfer rate calculation. --- .../ViewModels/MainViewVM.cs | 4 ++-- .../Parsing/EmbeddedLogFileParser.cs | 2 +- .../ViewModels/MachineTechViewVM.cs | 8 ++++---- .../ViewModels/SensorsViewVM.cs | 2 +- .../Diagnostics/DefaultDiagnosticsFrameProvider.cs | 8 ++++---- .../Diagnostics/IDiagnosticsFrameProvider.cs | 4 ++-- .../Views/ConnectedMachineView.xaml | 19 ++++++++++++++++--- 7 files changed, 30 insertions(+), 17 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs index 40a407093..fdd0fed5b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs @@ -239,7 +239,7 @@ namespace Tango.MachineStudio.DataCapture.ViewModels InvalidateRelayCommands(); } - private void _frameProvider_FrameReceived(object sender, PushDiagnosticsResponse frame) + private void _frameProvider_FrameReceived(object sender, StartDiagnosticsResponse frame) { if (!_frameProvider.Disable) { @@ -358,7 +358,7 @@ namespace Tango.MachineStudio.DataCapture.ViewModels { if (_frameProvider.Disable) { - _frameProvider.PushFrame(frame.PushDiagnosticsResponse); + _frameProvider.PushFrame(frame.StartDiagnosticsResponse); CaptureDevices.First().BeginInvoke(() => { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Parsing/EmbeddedLogFileParser.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Parsing/EmbeddedLogFileParser.cs index 1a6fcc051..e97ffb249 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Parsing/EmbeddedLogFileParser.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Parsing/EmbeddedLogFileParser.cs @@ -48,7 +48,7 @@ namespace Tango.MachineStudio.Logging.Parsing var entries = Regex.Split(rest, @"\[(.*?)\]"); - EmbeddedLogItem item = new EmbeddedLogItem(new PMR.Debugging.DebugLogResponse() + EmbeddedLogItem item = new EmbeddedLogItem(new PMR.Debugging.StartDebugLogResponse() { Category = (PMR.Debugging.DebugLogCategory)Enum.Parse(typeof(PMR.Debugging.DebugLogCategory), entries[1]), FileName = entries[3], 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 4cc1852a6..4a8cd82a5 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 @@ -122,11 +122,11 @@ namespace Tango.MachineStudio.Technician.ViewModels set { _hideMenu = value; RaisePropertyChangedAuto(); } } - private PushDiagnosticsResponse _currentDiagnosticsResponse; + private StartDiagnosticsResponse _currentDiagnosticsResponse; /// /// Gets or sets the current diagnostics response. /// - public PushDiagnosticsResponse CurrentDiagnosticsResponse + public StartDiagnosticsResponse CurrentDiagnosticsResponse { get { return _currentDiagnosticsResponse; } set { _currentDiagnosticsResponse = value; RaisePropertyChanged(nameof(CurrentDiagnosticsResponse)); } @@ -221,7 +221,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// /// The sender. /// The response. - private void DiagnosticsFrameProvider_FrameReceived(object sender, PushDiagnosticsResponse response) + private void DiagnosticsFrameProvider_FrameReceived(object sender, StartDiagnosticsResponse response) { PopulateDiagnosticsData(response); } @@ -234,7 +234,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// Populates the diagnostics data to the proper elements. /// /// The data. - private void PopulateDiagnosticsData(PushDiagnosticsResponse data) + private void PopulateDiagnosticsData(StartDiagnosticsResponse data) { if (DateTime.Now > _lastDiagnosticsResponseUpdate.AddMilliseconds(MIN_DIAGNOSTICS_UPDATE_MILI)) { 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 f3f7642df..403a6d510 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 @@ -127,7 +127,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// /// The sender. /// The data. - private void MachineOperator_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse data) + private void MachineOperator_DiagnosticsDataAvailable(object sender, StartDiagnosticsResponse data) { //TemperatureController.PushData(data.Temperature.ToArray()); //PressureController.PushData(data.Temperature.ToArray()); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs index 63612d420..42eab20a5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/DefaultDiagnosticsFrameProvider.cs @@ -40,7 +40,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// /// Occurs when a new data frame is available. /// - public event EventHandler FrameReceived; + public event EventHandler FrameReceived; /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// /// The sender. /// The frame. - private void DefaultDiagnosticsFrameProvider_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse frame) + private void DefaultDiagnosticsFrameProvider_DiagnosticsDataAvailable(object sender, StartDiagnosticsResponse frame) { if (!Disable) { @@ -82,7 +82,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// Push frames manual. (Only when Disable = true) /// /// The frame. - public void PushFrame(PushDiagnosticsResponse frame) + public void PushFrame(StartDiagnosticsResponse frame) { if (Disable) { @@ -94,7 +94,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// Raises the event. /// /// The frame. - protected virtual void OnFrameReceived(PushDiagnosticsResponse frame) + protected virtual void OnFrameReceived(StartDiagnosticsResponse frame) { FrameReceived?.Invoke(this, frame); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs index 3294b341d..3944fe8cb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Diagnostics/IDiagnosticsFrameProvider.cs @@ -16,7 +16,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// /// Occurs when a new data frame is available. /// - event EventHandler FrameReceived; + event EventHandler FrameReceived; /// /// Disables the frame delivery from the current connected machine and enables the manual push frame method. @@ -27,6 +27,6 @@ namespace Tango.MachineStudio.Common.Diagnostics /// Push frames manual. (Only when Disable = true) /// /// The frame. - void PushFrame(PushDiagnosticsResponse frame); + void PushFrame(StartDiagnosticsResponse frame); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index 797d4dcb0..45f1c9b26 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -5,6 +5,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:integration="clr-namespace:Tango.Integration.Services;assembly=Tango.Integration" + xmlns:integ="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -50,17 +51,19 @@ - + - + + + @@ -72,17 +75,23 @@ + + + + - + + + @@ -96,6 +105,10 @@ + + + + -- cgit v1.3.1