diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-06-19 01:54:33 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-06-19 01:54:33 +0300 |
| commit | d100f0eab0fa25c861cbae2ced60afc5dfa8da6b (patch) | |
| tree | c9f5f37b59528def11fab39476ce451627a8e869 /Software/Visual_Studio/PPC/Tango.PPC.Common | |
| parent | 238beb908fc205fd30b97894095b8f1c1a4fb50b (diff) | |
| download | Tango-d100f0eab0fa25c861cbae2ced60afc5dfa8da6b.tar.gz Tango-d100f0eab0fa25c861cbae2ced60afc5dfa8da6b.zip | |
Job Failed Event Impl.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs | 14 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs | 2 |
2 files changed, 10 insertions, 6 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 4e00474f4..59c56ed42 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs @@ -155,18 +155,17 @@ namespace Tango.PPC.Common.EventLogging /// <param name="e">The <see cref="PrintingFailedEventArgs"/> instance containing the event data.</param> private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e) { - String eventInfo = String.Empty; + EventTypes? relatedEventType = null; if (e.Exception is Transport.ResponseErrorException responseError) { if (responseError.Container.EventCode > 0) { - EventTypes evType = (EventTypes)responseError.Container.EventCode; - eventInfo = "\n#" + responseError.Container.EventCode + " " + evType.ToDescription(); + relatedEventType = (EventTypes)responseError.Container.EventCode; } } - Log(EventTypes.JOB_FAILED, e.Exception.Message + eventInfo); + Log(EventTypes.JOB_FAILED, e.Exception.Message, relatedEventType); } /// <summary> @@ -330,7 +329,7 @@ namespace Tango.PPC.Common.EventLogging /// </summary> /// <param name="eventType">Type of the event.</param> /// <param name="message">The message.</param> - public void Log(EventTypes eventType, string message) + public void Log(EventTypes eventType, string message, EventTypes? relatedEventType = null) { Init(); @@ -340,6 +339,11 @@ namespace Tango.PPC.Common.EventLogging machineEvent.EventType = _eventTypesGuids[eventType]; machineEvent.EventTypeGuid = machineEvent.EventType.Guid; + if (relatedEventType != null) + { + machineEvent.RelatedEventType = _eventTypesGuids[relatedEventType.Value]; + } + Log(machineEvent); } 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 81cce927d..a39f36cc1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/IEventLogger.cs @@ -36,7 +36,7 @@ namespace Tango.PPC.Common.EventLogging /// </summary> /// <param name="eventType">Type of the event.</param> /// <param name="message">The message.</param> - void Log(EventTypes eventType, String message); + void Log(EventTypes eventType, String message, EventTypes? relatedEventType = null); /// <summary> /// Logs the specified hardware event. |
