diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-01 19:26:32 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-01 19:26:32 +0200 |
| commit | 68ec47fb04c19139f8e39343689201a9f089ad8c (patch) | |
| tree | e23dd24478a97faa373a2a58ae4d865882447f4d /Software/Visual_Studio/PPC | |
| parent | 45a7a7319bbae1a2ab5cfc93d7a2507cccd8770e (diff) | |
| download | Tango-68ec47fb04c19139f8e39343689201a9f089ad8c.tar.gz Tango-68ec47fb04c19139f8e39343689201a9f089ad8c.zip | |
Implemented machine events emulation via FSE.
Added support for event 5099.
Updated event rev to 28.
Added 3 & 4 dancer types for X4.
Diffstat (limited to 'Software/Visual_Studio/PPC')
6 files changed, 71 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index f7269e0b1..c0dc61150 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -147,7 +147,7 @@ namespace Tango.PPC.Maintenance.ViewModels } else { - return true; + return MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DYEING_HEAD_COVER_IS_OPEN); } }); 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 /// <summary> @@ -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 /// <summary> /// Represents a database events logger. /// </summary> - public interface IEventLogger + public interface IEventLogger : IExternalBridgeRequestHandler { /// <summary> /// Occurs when a new machine event has been received. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventRequest.cs new file mode 100644 index 000000000..3546c285f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventRequest.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR.Diagnostics; + +namespace Tango.PPC.Shared.Events +{ + public class PushEmulatedEventRequest + { + public Event Event { get; set; } + public TimeSpan Timeout { get; set; } + + public PushEmulatedEventRequest() + { + Timeout = TimeSpan.FromSeconds(5); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventResponse.cs new file mode 100644 index 000000000..2fb3a2a70 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Events/PushEmulatedEventResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.PPC.Shared.Events +{ + public class PushEmulatedEventResponse + { + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj index bfd4d587b..8c3908bba 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/Tango.PPC.Shared.csproj @@ -62,6 +62,8 @@ <Compile Include="..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Events\PushEmulatedEventRequest.cs" /> + <Compile Include="Events\PushEmulatedEventResponse.cs" /> <Compile Include="Information\GetMachineInformationRequest.cs" /> <Compile Include="Information\GetMachineInformationResponse.cs" /> <Compile Include="Information\InformationPackage.cs" /> |
