diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-06 13:50:14 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-06 13:50:14 +0300 |
| commit | c14073e78d2c5b9569f91f47609d431da48ba706 (patch) | |
| tree | 1498d47e10c6e97d28c3f45f5f9ac57276801a98 /Software/Visual_Studio/MachineStudio | |
| parent | 551ca57984c369ce6084a612c8def44e2dbc3cc8 (diff) | |
| download | Tango-c14073e78d2c5b9569f91f47609d431da48ba706.tar.gz Tango-c14073e78d2c5b9569f91f47609d431da48ba706.zip | |
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.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
7 files changed, 30 insertions, 17 deletions
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; /// <summary> /// Gets or sets the current diagnostics response. /// </summary> - public PushDiagnosticsResponse CurrentDiagnosticsResponse + public StartDiagnosticsResponse CurrentDiagnosticsResponse { get { return _currentDiagnosticsResponse; } set { _currentDiagnosticsResponse = value; RaisePropertyChanged(nameof(CurrentDiagnosticsResponse)); } @@ -221,7 +221,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// </summary> /// <param name="sender">The sender.</param> /// <param name="response">The response.</param> - 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. /// </summary> /// <param name="data">The data.</param> - 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 /// </summary> /// <param name="sender">The sender.</param> /// <param name="data">The data.</param> - 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 /// <summary> /// Occurs when a new data frame is available. /// </summary> - public event EventHandler<PushDiagnosticsResponse> FrameReceived; + public event EventHandler<StartDiagnosticsResponse> FrameReceived; /// <summary> /// Initializes a new instance of the <see cref="DefaultDiagnosticsFrameProvider"/> class. @@ -70,7 +70,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// </summary> /// <param name="sender">The sender.</param> /// <param name="frame">The frame.</param> - 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) /// </summary> /// <param name="frame">The frame.</param> - public void PushFrame(PushDiagnosticsResponse frame) + public void PushFrame(StartDiagnosticsResponse frame) { if (Disable) { @@ -94,7 +94,7 @@ namespace Tango.MachineStudio.Common.Diagnostics /// Raises the <see cref="FrameReceived"/> event. /// </summary> /// <param name="frame">The frame.</param> - 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 /// <summary> /// Occurs when a new data frame is available. /// </summary> - event EventHandler<PushDiagnosticsResponse> FrameReceived; + event EventHandler<StartDiagnosticsResponse> FrameReceived; /// <summary> /// 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) /// </summary> /// <param name="frame">The frame.</param> - 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 @@ <RowDefinition Height="50"/> </Grid.RowDefinitions> - <Grid> + <Grid d:DataContext="{d:DesignInstance Type=integ:MachineOperator, IsDesignTimeCreatable=False}"> <ContentControl Content="{Binding ApplicationManager.ConnectedMachine}"> <ContentControl.Resources> <DataTemplate DataType="{x:Type integration:ExternalBridgeTcpClient}"> - <controls:TableGrid RowHeight="30"> + <controls:TableGrid RowHeight="22"> <TextBlock FontWeight="SemiBold" Text="Serial Number:" /> <TextBlock Text="{Binding SerialNumber}" /> <TextBlock FontWeight="SemiBold" Text="Name:" /> <TextBlock Text="{Binding Machine.Name}" /> <TextBlock FontWeight="SemiBold" Text="Organization:" /> <TextBlock Text="{Binding Machine.Organization.Name}" /> + <TextBlock FontWeight="SemiBold" Text="Embedded Software Version:" /> + <TextBlock Text="{Binding DeviceInformation.Version}" /> <TextBlock FontWeight="SemiBold" Text="IP Address:" /> <TextBlock Text="{Binding IPAddress}" /> <TextBlock FontWeight="SemiBold" Text="Total Bytes Sent:" /> @@ -72,17 +75,23 @@ <Run Text="{Binding Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run> <Run Text="/ second"></Run> </TextBlock> + <TextBlock FontWeight="SemiBold" Text="Enable Diagnostics:" /> + <ToggleButton IsChecked="{Binding EnableDiagnostics}" HorizontalAlignment="Left"></ToggleButton> + <TextBlock FontWeight="SemiBold" Text="Enable Embedded Debug Logs:" /> + <ToggleButton IsChecked="{Binding EnableEmbeddedDebugging}" HorizontalAlignment="Left"></ToggleButton> </controls:TableGrid> </DataTemplate> <DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}"> - <controls:TableGrid RowHeight="30"> + <controls:TableGrid RowHeight="22"> <TextBlock FontWeight="SemiBold" Text="Serial Number:" /> <TextBlock Text="{Binding SerialNumber}" /> <TextBlock FontWeight="SemiBold" Text="Name:" /> <TextBlock Text="{Binding Machine.Name}" /> <TextBlock FontWeight="SemiBold" Text="Organization:" /> <TextBlock Text="{Binding Machine.Organization.Name}" /> + <TextBlock FontWeight="SemiBold" Text="Embedded Software Version:" /> + <TextBlock Text="{Binding DeviceInformation.Version}" /> <TextBlock FontWeight="SemiBold" Text="COM Port:" /> <TextBlock Text="{Binding ComPort}" /> <TextBlock FontWeight="SemiBold" Text="Device:" /> @@ -96,6 +105,10 @@ <Run Text="{Binding Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run> <Run Text="/ second"></Run> </TextBlock> + <TextBlock FontWeight="SemiBold" Text="Enable Diagnostics:" /> + <ToggleButton IsChecked="{Binding EnableDiagnostics}" HorizontalAlignment="Left"></ToggleButton> + <TextBlock FontWeight="SemiBold" Text="Enable Embedded Debug Logs:" /> + <ToggleButton IsChecked="{Binding EnableEmbeddedDebugging}" HorizontalAlignment="Left"></ToggleButton> </controls:TableGrid> </DataTemplate> </ContentControl.Resources> |
