From 8a1e772f025eaf3bfdf17905d9e33c460993e559 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 1 Jul 2019 17:56:49 +0300 Subject: Many bug fixes !!! --- .../EventLogging/DefaultEventLogger.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging') 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 @@ -114,6 +119,46 @@ namespace Tango.PPC.Common.EventLogging #region Event Handlers + /// + /// Handles the PrintingFailed event of the MachineOperator. + /// + /// The source of the event. + /// The instance containing the event data. + private void MachineOperator_PrintingFailed(object sender, PrintingFailedEventArgs e) + { + Log(EventTypes.JOB_FAILED, e.Exception.Message); + } + + /// + /// Handles the PrintingCompleted event of the MachineOperator. + /// + /// The source of the event. + /// The instance containing the event data. + private void MachineOperator_PrintingCompleted(object sender, PrintingEventArgs e) + { + Log(EventTypes.JOB_COMPLETED, $"Job '{e.Job.Name}' completed successfully."); + } + + /// + /// Handles the PrintingAborted event of the MachineOperator. + /// + /// The source of the event. + /// The instance containing the event data. + private void MachineOperator_PrintingAborted(object sender, PrintingEventArgs e) + { + Log(EventTypes.JOB_ABORTED, $"Job '{e.Job.Name}' has been aborted."); + } + + /// + /// Handles the PrintingStarted event of the MachineOperator. + /// + /// The source of the event. + /// The instance containing the event data. + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + { + Log(EventTypes.JOB_STARTED, $"Job '{e.Job.Name}' started."); + } + /// /// Handles the machine operator state changed event. /// -- cgit v1.3.1