From 4e216a0ca8ad3608b845fa445b73034e1a67b8af Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 19 Aug 2020 01:45:02 +0300 Subject: DB: Changed TechMonitors HeadZone5_6HeaterCurrent => HeadZone56HeaterCurrent Working on insights and insights annotations. Added insights events. Added insights settings to PPC advanced settings. Added compression support for transport adapters. Implemented compression support on TCP/SignalR/WebRTC. Added Compression flag to ExternalBridge discovery packet. Added compression setting to PPC advanced settings. Refactored transport layer to use Bson instead of Json for Generic Messages. Added all SciChart referenced assemblies. Registered EF Extensions license for FSE. Added support for FSE PushTask notification cancel button. --- .../PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs index 86506abcf..958c1aa12 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem/DefaultFileSystemService.cs @@ -15,6 +15,7 @@ using Tango.Integration.Operation; using Tango.Logging; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Shared.Logs; +using Tango.Settings; using Tango.Transport; using Tango.Transport.Transporters; using Tango.WebRTC; @@ -33,6 +34,7 @@ namespace Tango.PPC.Common.FileSystem private FileSystemManager _manager; private Dictionary _operations; private Dictionary _webRtcClients; + private bool _enableCompression; public bool Enabled { get; set; } = true; public bool EnableWebRTC { get; set; } = true; @@ -43,6 +45,7 @@ namespace Tango.PPC.Common.FileSystem _manager = new FileSystemManager(); _operations = new Dictionary(); externalBridge.RegisterRequestHandler(this); + _enableCompression = SettingsManager.Default.GetOrCreate().EnableExternalBridgeTransportCompression; } [ExternalBridgeRequestHandlerMethod(typeof(InitWebRtcRequest), RequestHandlerLoggingMode.LogRequestNameAndContent)] @@ -66,7 +69,10 @@ namespace Tango.PPC.Common.FileSystem } LogManager.Log("Initializing WebRTC transport adapter on 'Passive' mode."); - var webRtcAdapter = new WebRtcTransportAdapter(receiver, WebRtcTransportAdapterMode.Passive, request.DataChannelName); + var webRtcAdapter = new WebRtcTransportAdapter(receiver, WebRtcTransportAdapterMode.Passive, request.DataChannelName) + { + EnableCompression = _enableCompression + }; webRtcAdapter.Ready += (x, e) => { LogManager.Log("The file system service WebRTC channel is ready."); -- cgit v1.3.1 From a9b1c4cb5c4d945565e72e80ac0f938a49da3e5f Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 22 Aug 2020 05:15:57 +0300 Subject: Implemented pre-connection protocol configuration. Improved error handling across transport layer. Improved unexpected app crash for PPC. Improved transporter request received handlers tunneling. --- Software/PMR/Messages/Common/MessageType.proto | 2 + .../Integration/ConfigureProtocolRequest.proto | 12 ++ .../Integration/ConfigureProtocolResponse.proto | 9 + .../ExternalBridgeUdpDiscoveryPacket.proto | 1 - .../Integration/GenericMessageProtocol.proto | 11 ++ .../FSE/Tango.FSE.Common/Resources/Converters.xaml | 1 + .../Connection/DefaultMachineProvider.cs | 13 +- .../FileSystem/DefaultFileSystemProvider.cs | 3 +- .../Insights/DefaultInsightsProvider.cs | 2 +- .../Tango.FSE.UI/Panes/ConnectedMachinePane.xaml | 6 +- .../Views/ConnectedMachineView.xaml | 10 ++ .../Tango.PPC.MachineSettings/Views/MainView.xaml | 6 +- .../ExternalBridge/PPCExternalBridgeService.cs | 2 +- .../FileSystem/DefaultFileSystemService.cs | 8 +- .../PPC/Tango.PPC.Common/PPCSettings.cs | 7 +- Software/Visual_Studio/PPC/Tango.PPC.UI/App.config | 4 +- .../Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs | 16 +- .../Visual_Studio/Tango.Emulations/EmulatorBase.cs | 2 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 4 +- .../Tango.Emulations/Emulators/MobileEmulator.cs | 4 +- .../ExternalBridge/ExternalBridgeReceiver.cs | 23 ++- .../ExternalBridge/ExternalBridgeScanner.cs | 4 +- .../ExternalBridge/ExternalBridgeService.cs | 86 +++++----- .../ExternalBridge/ExternalBridgeSignalRClient.cs | 43 +++-- .../ExternalBridge/ExternalBridgeTcpClient.cs | 65 ++++--- .../ExternalBridge/IExternalBridgeClient.cs | 5 - .../ExternalBridge/IExternalBridgeSecureClient.cs | 5 +- .../ExternalBridge/IExternalBridgeService.cs | 5 - .../ExternalBridge/Web/MachineInfo.cs | 3 +- .../Tango.Integration/Operation/MachineOperator.cs | 10 +- .../Tango.Logging/GlobalExceptionTrapper.cs | 1 - .../Visual_Studio/Tango.PMR/Common/MessageType.cs | 179 +++++++++---------- .../Integration/ConfigureProtocolRequest.cs | 190 +++++++++++++++++++++ .../Integration/ConfigureProtocolResponse.cs | 160 +++++++++++++++++ .../ExternalBridgeUdpDiscoveryPacket.cs | 35 +--- .../Integration/GenericMessageProtocol.cs | 47 +++++ Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 5 +- .../GenericMessageProtocolToStringConverter.cs | 42 +++++ .../Converters/StringToOneLineConverter.cs | 2 +- .../Tango.SharedUI/Tango.SharedUI.csproj | 7 +- .../Adapters/SignalRTransportAdapter.cs | 63 ++++--- .../Adapters/TcpTransportAdapter.cs | 16 +- .../Tango.Transport/GenericMessageSerializer.cs | 62 +++---- .../Visual_Studio/Tango.Transport/ITransporter.cs | 8 +- .../Tango.Transport/RequestReceivedEventArgs.cs | 25 +++ .../Tango.Transport/Tango.Transport.csproj | 3 +- .../Tango.Transport/TransportAdapterBase.cs | 7 +- .../Tango.Transport/TransporterBase.cs | 57 +++++-- .../Tango.WebRTC/WebRtcTransportAdapter.cs | 87 ++++++---- 49 files changed, 999 insertions(+), 369 deletions(-) create mode 100644 Software/PMR/Messages/Integration/ConfigureProtocolRequest.proto create mode 100644 Software/PMR/Messages/Integration/ConfigureProtocolResponse.proto create mode 100644 Software/PMR/Messages/Integration/GenericMessageProtocol.proto create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/ConfigureProtocolRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/ConfigureProtocolResponse.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Integration/GenericMessageProtocol.cs create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/GenericMessageProtocolToStringConverter.cs create mode 100644 Software/Visual_Studio/Tango.Transport/RequestReceivedEventArgs.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/FileSystem') diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index e9146cc5f..4f2147b02 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -146,6 +146,8 @@ enum MessageType UpdateStatusResponse = 1016; GenericRequest = 1017; GenericResponse = 1018; + ConfigureProtocolRequest = 1019; + ConfigureProtocolResponse = 1020; diff --git a/Software/PMR/Messages/Integration/ConfigureProtocolRequest.proto b/Software/PMR/Messages/Integration/ConfigureProtocolRequest.proto new file mode 100644 index 000000000..850df63de --- /dev/null +++ b/Software/PMR/Messages/Integration/ConfigureProtocolRequest.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "GenericMessageProtocol.proto"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +message ConfigureProtocolRequest +{ + bool EnableCompression = 1; + GenericMessageProtocol GenericProtocol = 2; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Integration/ConfigureProtocolResponse.proto b/Software/PMR/Messages/Integration/ConfigureProtocolResponse.proto new file mode 100644 index 000000000..1f32296da --- /dev/null +++ b/Software/PMR/Messages/Integration/ConfigureProtocolResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +message ConfigureProtocolResponse +{ + bool Confirmed = 1; +} \ No newline at end of file diff --git a/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto b/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto index 4a7d5b59b..d797e6de3 100644 --- a/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto +++ b/Software/PMR/Messages/Integration/ExternalBridgeUdpDiscoveryPacket.proto @@ -7,5 +7,4 @@ message ExternalBridgeUdpDiscoveryPacket { string Time = 1; string SerialNumber = 2; - bool CompressionEnabled = 3; } \ No newline at end of file diff --git a/Software/PMR/Messages/Integration/GenericMessageProtocol.proto b/Software/PMR/Messages/Integration/GenericMessageProtocol.proto new file mode 100644 index 000000000..cb6021944 --- /dev/null +++ b/Software/PMR/Messages/Integration/GenericMessageProtocol.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package Tango.PMR.Integration; +option java_package = "com.twine.tango.pmr.integration"; + +enum GenericMessageProtocol +{ + Json = 0; + Bson = 1; + Protobuf = 2; +} \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml index 922790d5e..83481a9d7 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml @@ -45,4 +45,5 @@ + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index 55866361b..f6bbaab87 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -24,6 +24,7 @@ using Tango.FSE.UI.Dialogs; using Tango.Integration.ExternalBridge; using Tango.Integration.Operation; using Tango.Logging; +using Tango.PMR.Integration; using Tango.SharedUI; using Tango.Transport; @@ -162,7 +163,7 @@ namespace Tango.FSE.UI.Connection { _machineEventsStateProvider = new FSEMachineEventsStateProvider(); - MachineOperator = new ExternalBridgeTcpClient("N/A", "N/A", false); + MachineOperator = new ExternalBridgeTcpClient("N/A", "N/A"); MachineOperator.MachineEventsStateProvider = _machineEventsStateProvider; MachineOperator.StateChanged += MachineOperator_StateChanged; MachineOperator.As().SessionClosed += DefaultMachineProvider_SessionClosed; @@ -185,7 +186,7 @@ namespace Tango.FSE.UI.Connection { try { - LogManager.Log($"Connecting to machine '{machine.GetType().Name}' => '{machine.SerialNumber}' => '{machine.Adapter?.Address}' => {(machine.CompressionEnabled ? "Compression Enabled" : "Compression Disabled")}..."); + LogManager.Log($"Connecting to machine '{machine.GetType().Name}' => '{machine.SerialNumber}' => '{machine.Adapter?.Address}'..."); IsBusy = true; @@ -214,7 +215,7 @@ namespace Tango.FSE.UI.Connection vm = await NotificationProvider.ShowDialog(new MachineConnectionSignalRViewVM(secureClient)); } - secureClient.LoginRequest = new PMR.Integration.ExternalBridgeLoginRequest() + secureClient.LoginRequest = new ExternalBridgeLoginRequest() { AppID = "Tango FSE", HostName = Environment.MachineName, @@ -225,6 +226,12 @@ namespace Tango.FSE.UI.Connection UserName = AuthenticationProvider.CurrentUser.Contact.FullName }; + secureClient.ConfigureProtocolRequest = new ConfigureProtocolRequest() + { + EnableCompression = true, + GenericProtocol = GenericMessageProtocol.Bson + }; + LogManager.Log($"Target machine requires a secure connection. Login Request:\n{secureClient.LoginRequest.ToJsonString()}"); } else diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs index e7f9772ff..2e3ffec19 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileSystem/DefaultFileSystemProvider.cs @@ -169,9 +169,10 @@ namespace Tango.FSE.UI.FileSystem _webRtcTransporter = new BasicTransporter(new WebRtcTransportAdapter(_machineProvider.MachineOperator, WebRtcTransportAdapterMode.Active, WEB_RTC_CHANNEL_NAME) { - EnableCompression = _machineProvider.MachineOperator.CompressionEnabled, + EnableCompression = _machineProvider.MachineOperator.Adapter.EnableCompression, }); _webRtcTransporter.UseKeepAlive = false; + _webRtcTransporter.GenericProtocol = _machineProvider.MachineOperator.GenericProtocol; _webRtcTransporter.ComponentName = "File System Active WebRTC Transporter"; await _webRtcTransporter.Connect(); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Insights/DefaultInsightsProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Insights/DefaultInsightsProvider.cs index 1ddf0fa22..a4958f25d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Insights/DefaultInsightsProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Insights/DefaultInsightsProvider.cs @@ -47,7 +47,7 @@ namespace Tango.FSE.UI.Insights { StartDateUTC = startDateUTC, EndDateUTC = endTimeUTC - }, new Transport.TransportRequestConfig() + }, new TransportRequestConfig() { Timeout = TimeSpan.FromMinutes(1), }); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/ConnectedMachinePane.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/ConnectedMachinePane.xaml index db2559a9d..c0c54b1b6 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/ConnectedMachinePane.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/ConnectedMachinePane.xaml @@ -8,9 +8,11 @@ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + xmlns:localConverters="clr-namespace:Tango.FSE.UI.Converters" xmlns:local="clr-namespace:Tango.FSE.UI.Panes" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="350" d:DataContext="{d:DesignInstance Type=local:ConnectedMachinePaneVM, IsDesignTimeCreatable=False}"> +