From 68ec47fb04c19139f8e39343689201a9f089ad8c Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 1 Dec 2020 19:26:32 +0200 Subject: Implemented machine events emulation via FSE. Added support for event 5099. Updated event rev to 28. Added 3 & 4 dancer types for X4. --- .../EventLogging/DefaultEventLogger.cs | 34 ++++++++++++++++++++++ .../Tango.PPC.Common/EventLogging/IEventLogger.cs | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs index e9bcd4246..ee96a77a5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs @@ -17,6 +17,9 @@ using Tango.PPC.Common.Application; using Tango.PPC.Common.Authentication; using Tango.PPC.Common.Connection; using Tango.Transport; +using Tango.PPC.Common.ExternalBridge; +using Tango.PPC.Shared.Events; +using Tango.Core.DI; namespace Tango.PPC.Common.EventLogging { @@ -52,6 +55,21 @@ namespace Tango.PPC.Common.EventLogging #endregion + private IPPCExternalBridgeService _externalBridge; + [TangoInject(Mode = TangoInjectMode.WhenAvailable)] + public IPPCExternalBridgeService ExternalBridgeService + { + get { return _externalBridge; } + set + { + if (_externalBridge != value) + { + _externalBridge = value; + _externalBridge.RegisterRequestHandler(this); + } + } + } + #region Constructors /// @@ -396,5 +414,21 @@ namespace Tango.PPC.Common.EventLogging } #endregion + + #region External Bridge Handler + + [ExternalBridgeRequestHandlerMethod(typeof(PushEmulatedEventRequest), RequestHandlerLoggingMode.LogRequestNameAndContent)] + public async Task OnStartPerformanceUpdatesRequest(PushEmulatedEventRequest request, String token, ExternalBridgeReceiver receiver) + { + _machineProvider.MachineOperator.PushEmulatedEvent(request.Event, request.Timeout); + await receiver.SendGenericResponse(new PushEmulatedEventResponse(), token); + } + + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + { + + } + + #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs index 10560e034..81cce927d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; using Tango.BL.Enumerations; +using Tango.Integration.ExternalBridge; using Tango.PMR.Diagnostics; namespace Tango.PPC.Common.EventLogging @@ -12,7 +13,7 @@ namespace Tango.PPC.Common.EventLogging /// /// Represents a database events logger. /// - public interface IEventLogger + public interface IEventLogger : IExternalBridgeRequestHandler { /// /// Occurs when a new machine event has been received. -- cgit v1.3.1