diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
| commit | e89f04cbdda4e34baef11d43c9f812773911a33c (patch) | |
| tree | bc7d1a8684d7e7487b80c9ab3801b3bc988cbb65 /Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | |
| parent | 2bb75ed18045f59ae694adf04439e0297f77a89f (diff) | |
| download | Tango-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/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 34 |
1 files changed, 34 insertions, 0 deletions
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 } } |
