aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-12-26 21:33:29 +0200
committerRoy <Roy.mail.net@gmail.com>2022-12-26 21:33:29 +0200
commite89f04cbdda4e34baef11d43c9f812773911a33c (patch)
treebc7d1a8684d7e7487b80c9ab3801b3bc988cbb65 /Software/Visual_Studio/Tango.Integration
parent2bb75ed18045f59ae694adf04439e0297f77a89f (diff)
downloadTango-e89f04cbdda4e34baef11d43c9f812773911a33c.tar.gz
Tango-e89f04cbdda4e34baef11d43c9f812773911a33c.zip
Implemented Waste Replace Handling.
Implemented Job Stop on Out Of Range on MachineOperator. Implemented job upload error on Volumes out of range.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs11
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs34
2 files changed, 45 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
index 873e024fd..ca00f2891 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
@@ -262,6 +262,11 @@ namespace Tango.Integration.Operation
event EventHandler<InkFillingStatusChangedEventArgs> InkFillingStatusChanged;
/// <summary>
+ /// Occurs when waste replacement is required.
+ /// </summary>
+ event EventHandler WasteReplacementRequired;
+
+ /// <summary>
/// Gets or sets a value indicating whether direct the embedded device to send diagnostics messages.
/// </summary>
bool EnableDiagnostics { get; set; }
@@ -576,5 +581,11 @@ namespace Tango.Integration.Operation
/// </summary>
/// <param name="spoolType">Type of the spool.</param>
Task SetSpoolType(JobSpoolType spoolType);
+
+ /// <summary>
+ /// Completes the waste replacement sequence.
+ /// </summary>
+ /// <param name="approved">Approve or decline the sequence.</param>
+ Task CompleteWasteReplacement(bool approved);
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 6b79fa5bc..005121b88 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -89,6 +89,7 @@ namespace Tango.Integration.Operation
private List<Event> _emulatedEvents;
private List<BitResultComposition> _bitResults;
private JobSpoolType _currentSpoolType;
+ private String _lastWasteReplaceRequestToken;
public static String EmbeddedLogsFolder { get; private set; }
public static String EmbeddedLogsTag { get; private set; }
@@ -303,6 +304,11 @@ namespace Tango.Integration.Operation
/// </summary>
public event EventHandler<InkFillingStatusChangedEventArgs> InkFillingStatusChanged;
+ /// <summary>
+ /// Occurs when waste replacement is required.
+ /// </summary>
+ public event EventHandler WasteReplacementRequired;
+
#endregion
#region Properties
@@ -1207,6 +1213,11 @@ namespace Tango.Integration.Operation
e.Handled = true;
OnUpdateStatusRequestReceived(container.Token, MessageFactory.ExtractMessageFromContainer<UpdateStatusRequest>(container));
}
+ else if (container.Type == MessageType.WasteReplaceRequest)
+ {
+ e.Handled = true;
+ OnWasteReplacementRequired(container.Token, MessageFactory.ExtractMessageFromContainer<WasteReplaceRequest>(container));
+ }
}
/// <summary>
@@ -1388,6 +1399,12 @@ namespace Tango.Integration.Operation
});
}
+ protected virtual void OnWasteReplacementRequired(string token, WasteReplaceRequest wasteReplaceRequest)
+ {
+ _lastWasteReplaceRequestToken = token;
+ WasteReplacementRequired?.Invoke(this, new EventArgs());
+ }
+
#endregion
#region Override Methods
@@ -2638,6 +2655,11 @@ namespace Tango.Integration.Operation
{
throw new InvalidOperationException($"Error processing the coordinates of stop '{stop.StopIndex}' of segment '{stop.Segment.SegmentIndex}'.", ex);
}
+
+ if (stop.IsLiquidVolumesOutOfRange)
+ {
+ throw new InvalidOperationException($"The specified ink volumes at segment {segment.SegmentIndex} exceeds the maximum allowed total volume for the current thread.");
+ }
}
}
}
@@ -4473,6 +4495,18 @@ namespace Tango.Integration.Operation
}
}
+ /// <summary>
+ /// Completes the waste replacement sequence.
+ /// </summary>
+ /// <param name="approved">Approve or decline the sequence.</param>
+ public async Task CompleteWasteReplacement(bool approved)
+ {
+ if (_lastWasteReplaceRequestToken != null)
+ {
+ await SendResponse<WasteReplaceResponse>(new WasteReplaceResponse() { Approved = approved }, _lastWasteReplaceRequestToken);
+ }
+ }
+
#endregion
}
}