aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-07-01 17:56:49 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-07-01 17:56:49 +0300
commit8a1e772f025eaf3bfdf17905d9e33c460993e559 (patch)
treeb6d705cca71033cd6c5f814596ceb9abc849bf50 /Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging
parentc0fd8dcc53e45aa5aa0095cc2c8c5f39a34f7886 (diff)
downloadTango-8a1e772f025eaf3bfdf17905d9e33c460993e559.tar.gz
Tango-8a1e772f025eaf3bfdf17905d9e33c460993e559.zip
Many bug fixes !!!
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs45
1 files changed, 45 insertions, 0 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 7ccb76858..f9674e409 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs
@@ -80,6 +80,11 @@ namespace Tango.PPC.Common.EventLogging
_machineProvider.MachineOperator.RequestFailed += Machine_RequestFailed;
_machineProvider.MachineOperator.ResponseReceived += Machine_ResponseReceived;
_machineProvider.MachineOperator.StateChanged += MachineOperator_StateChanged;
+ _machineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
+ _machineProvider.MachineOperator.PrintingAborted += MachineOperator_PrintingAborted;
+ _machineProvider.MachineOperator.PrintingCompleted += MachineOperator_PrintingCompleted;
+ _machineProvider.MachineOperator.PrintingFailed += MachineOperator_PrintingFailed;
+
}
#endregion
@@ -115,6 +120,46 @@ namespace Tango.PPC.Common.EventLogging
#region Event Handlers
/// <summary>
+ /// Handles the PrintingFailed event of the MachineOperator.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="PrintingFailedEventArgs"/> instance containing the event data.</param>
+ private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e)
+ {
+ Log(EventTypes.JOB_FAILED, e.Exception.Message);
+ }
+
+ /// <summary>
+ /// Handles the PrintingCompleted event of the MachineOperator.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param>
+ private void MachineOperator_PrintingCompleted(object sender, PrintingEventArgs e)
+ {
+ Log(EventTypes.JOB_COMPLETED, $"Job '{e.Job.Name}' completed successfully.");
+ }
+
+ /// <summary>
+ /// Handles the PrintingAborted event of the MachineOperator.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param>
+ private void MachineOperator_PrintingAborted(object sender, PrintingEventArgs e)
+ {
+ Log(EventTypes.JOB_ABORTED, $"Job '{e.Job.Name}' has been aborted.");
+ }
+
+ /// <summary>
+ /// Handles the PrintingStarted event of the MachineOperator.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="PrintingEventArgs"/> instance containing the event data.</param>
+ private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e)
+ {
+ Log(EventTypes.JOB_STARTED, $"Job '{e.Job.Name}' started.");
+ }
+
+ /// <summary>
/// Handles the machine operator state changed event.
/// </summary>
/// <param name="sender">The sender.</param>