aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-05-01 15:57:23 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-05-01 15:57:23 +0300
commitaeac0422cb4e989426f3367113627f6c86bcecfb (patch)
tree234b08b60f5d6add3e45ece81bff3a3bdc8a67ef /Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
parentf650a242fa4a56a6fb9c55d745075e49df523c21 (diff)
downloadTango-aeac0422cb4e989426f3367113627f6c86bcecfb.tar.gz
Tango-aeac0422cb4e989426f3367113627f6c86bcecfb.zip
Added logs to try catch progress error on PPC.
Prevent job progress after completion on MachineOperator. Added lubricant = 100 on volume jobs PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
index b7f55cc18..1195713cb 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.Core;
+using Tango.Logging;
using Tango.PMR.Printing;
namespace Tango.Integration.Operation
@@ -22,6 +23,7 @@ namespace Tango.Integration.Operation
private int _last_unit;
private bool _finalizing;
private JobHandlerModes _mode;
+ private double _last_progress;
#region Events
@@ -275,9 +277,26 @@ namespace Tango.Integration.Operation
private void InvalidateJobProgress(JobStatus s)
{
+ if (s.Progress < 0)
+ {
+ LogManager.Log($"Negative job progress received '{s.Progress}'.", LogCategory.Error);
+ }
+
+ if (s.Progress > Status.TotalProgress)
+ {
+ LogManager.Log($"Invalid job progress received '{s.Progress}' while total progress is '{Status.TotalProgress}'.", LogCategory.Error);
+ }
+
s.Progress = Math.Max(0, s.Progress); //Make sure the progress is not negative.
s.Progress = Math.Min(s.Progress, Status.TotalProgress); //Make sure the progress is less than total.
+ if (s.Progress < _last_progress)
+ {
+ LogManager.Log($"Invalid job progress received '{s.Progress}' while last progress was '{_last_progress}'.");
+ }
+
+ _last_progress = s.Progress;
+
//Job Status
if (IsCanceled)
{