aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/ExternalBridge
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-01 20:08:05 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-01 20:08:05 +0200
commitc873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea (patch)
tree2b6cc3e6b75d666d968cb47aa62cc11135042732 /Software/Visual_Studio/Tango.Integration/ExternalBridge
parent5976f1749a6b00f53a38d544c4267df48bd4eef5 (diff)
downloadTango-c873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea.tar.gz
Tango-c873eb1c0324eb50428fc26cdb5f1c3d05c7d3ea.zip
Improved external bridge events notification to support emulation.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/ExternalBridge')
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
index 527320008..4218f9e9a 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs
@@ -256,6 +256,8 @@ namespace Tango.Integration.ExternalBridge
MachineOperator.StatusChanged += MachineOperator_StatusChanged;
MachineOperator.PendingResponseReceived -= MachineOperator_PendingResponseReceived;
MachineOperator.PendingResponseReceived += MachineOperator_PendingResponseReceived;
+ MachineOperator.EventsNotification -= MachineOperator_EventsNotification;
+ MachineOperator.EventsNotification += MachineOperator_EventsNotification;
}
}
@@ -339,6 +341,23 @@ namespace Tango.Integration.ExternalBridge
OnOperatorResponseReceived(container);
}
+ private void MachineOperator_EventsNotification(object sender, StartEventsNotificationResponse e)
+ {
+ try
+ {
+ MessageContainer container = new MessageContainer();
+ container.Type = MessageType.StartEventsNotificationResponse;
+ container.Continuous = true;
+ container.Data = e.ToByteString();
+
+ _receivers.ToList().Where(x => x.IsLoggedInAndRequiresDiagnostics && x.RequiresEventsNotification).ToList().ForEach(x => x.UpdateEvents(container));
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error on external bridge machine events broadcast.");
+ }
+ }
+
#endregion
#region Receiver Events Handlers
@@ -756,7 +775,7 @@ namespace Tango.Integration.ExternalBridge
_receivers.ToList().Where(x => x.IsLoggedInAndRequiresDiagnostics && x.RequiresDebugLogs).ToList().ForEach(x => x.UpdateDebugLogs(container));
break;
case MessageType.StartEventsNotificationResponse:
- _receivers.ToList().Where(x => x.IsLoggedInAndRequiresDiagnostics && x.RequiresEventsNotification).ToList().ForEach(x => x.UpdateEvents(container));
+ //_receivers.ToList().Where(x => x.IsLoggedInAndRequiresDiagnostics && x.RequiresEventsNotification).ToList().ForEach(x => x.UpdateEvents(container));
break;
case MessageType.StartMachineStatusUpdateResponse:
_receivers.ToList().Where(x => x.IsLoggedInAndRequiresDiagnostics && x.RequiresMachineStatusUpdate).ToList().ForEach(x => x.UpdateMachineStatus(container));