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. --- .../Tango.PPC.MachineSettings/Views/MainView.xaml | 27 +++++++++++++++++++++- .../ExternalBridge/PPCExternalBridgeService.cs | 1 + .../FileSystem/DefaultFileSystemService.cs | 8 ++++++- .../Insights/DefaultInsightsService.cs | 3 +++ .../PPC/Tango.PPC.Common/PPCSettings.cs | 6 +++++ .../PPC/Tango.PPC.Common/Resources/Merged.xaml | 1 + 6 files changed, 44 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 4f7385513..d436c58b7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -296,12 +296,17 @@ + + External Bridge Transport Compression + + + Enable External Bridge SignalR - + External Bridge SignalR Hub @@ -328,6 +333,26 @@ + + Enable Insights + + + + + Insights Sampling Interval (sec) + + + + + Insights Storage Cleanup Interval (min) + + + + + Insights Max Storage Duration (days) + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs index 6eaeb58a0..236c066e3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs @@ -53,6 +53,7 @@ namespace Tango.PPC.Common.ExternalBridge applicationManager.ApplicationReady += (_, __) => { var settings = SettingsManager.Default.GetOrCreate(); + EnableTransportCompression = settings.EnableExternalBridgeTransportCompression; MachineOperator = machineProvider.MachineOperator; Machine = machineProvider.Machine; SignalRConfiguration.Enabled = settings.EnableExternalBridgeSignalR; 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."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Insights/DefaultInsightsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Insights/DefaultInsightsService.cs index bfbf7114f..24852d853 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Insights/DefaultInsightsService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Insights/DefaultInsightsService.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL; using Tango.Core; using Tango.Core.DI; using Tango.Insights; @@ -74,6 +75,8 @@ namespace Tango.PPC.Common.Insights { var frames = InsightsManager.Default.GetFrames(request.StartDateUTC, request.EndDateUTC); insightsFile.Frames = frames; + insightsFile.Events = InsightsManager.Default.GetEvents(request.StartDateUTC, request.EndDateUTC); + insightsFile.ToFile(filePath); }); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs index 9afbb52b6..bd21b3bb0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs @@ -60,6 +60,11 @@ namespace Tango.PPC.Common /// public String ExternalBridgePassword { get; set; } + /// + /// Gets or sets a value indicating whether to enable transport compression for external bridge clients. + /// + public bool EnableExternalBridgeTransportCompression { get; set; } + /// /// Gets or sets a value indicating whether [enable hot spot]. /// @@ -296,6 +301,7 @@ namespace Tango.PPC.Common EmbeddedComPort = "COM10"; EmbeddedDeviceHint = "Tango USB Serial Port"; ExternalBridgePassword = "Aa123456"; + EnableExternalBridgeTransportCompression = true; HotSpotPassword = "Aa123456"; LockScreenTimeout = TimeSpan.FromMinutes(10); LockScreenPassword = "1111"; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 955a584c2..806a94bb0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -54,6 +54,7 @@ +