aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-18 22:19:59 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-18 22:19:59 +0300
commit09eabd45ecf65d6f900b9d53428e7576bdc4d825 (patch)
tree5f3112901ee1c92b2d5b7f06c063b82cd2826542 /Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging
parentf27893986e9fd647a69be8569ecd5d944f853869 (diff)
downloadTango-09eabd45ecf65d6f900b9d53428e7576bdc4d825.tar.gz
Tango-09eabd45ecf65d6f900b9d53428e7576bdc4d825.zip
Implemented resume job on PPC.
Fixed resume job on emulator. Fixed an issue with PPC event logger. Added getting ready status to machine operator.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs25
1 files changed, 24 insertions, 1 deletions
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 d540e3fd3..25eb2df04 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
@@ -79,6 +79,7 @@ namespace Tango.PPC.Common.EventLogging
_machineProvider.MachineOperator.RequestSent += Machine_RequestSent;
_machineProvider.MachineOperator.RequestFailed += Machine_RequestFailed;
_machineProvider.MachineOperator.ResponseReceived += Machine_ResponseReceived;
+ _machineProvider.MachineOperator.StateChanged += MachineOperator_StateChanged;
}
#endregion
@@ -114,6 +115,20 @@ namespace Tango.PPC.Common.EventLogging
#region Event Handlers
/// <summary>
+ /// Handles the machine operator state changed event.
+ /// </summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void MachineOperator_StateChanged(object sender, Transport.TransportComponentState e)
+ {
+ if (e == Transport.TransportComponentState.Connected)
+ {
+ _events = new ConcurrentQueue<MachinesEvent>();
+ _currentEvents.Clear();
+ }
+ }
+
+ /// <summary>
/// Handles the RequestSent event of the connected machine.
/// </summary>
/// <param name="sender">The sender.</param>
@@ -212,7 +227,15 @@ namespace Tango.PPC.Common.EventLogging
machineEvent.UserGuid = _authentication.CurrentUser.Guid;
machineEvent.User = _authentication.CurrentUser;
_events.Enqueue(machineEvent);
- _currentEvents.Add(machineEvent);
+
+ if (!_currentEvents.Exists(x => x.Type == machineEvent.Type))
+ {
+ if (machineEvent.Group != EventTypeGroups.Application && machineEvent.Group != EventTypeGroups.Transport)
+ {
+ _currentEvents.Add(machineEvent);
+ }
+ }
+
EventReceived?.Invoke(this, machineEvent);
}
}