diff options
author | j.spijker@ultimaker.com <jelle spijker> | 2022-07-27 19:12:25 +0300 |
---|---|---|
committer | jspijker <j.spijker@ultimaker.com> | 2022-07-27 19:12:25 +0300 |
commit | a712e7517a650580080728520c88f40cc5507211 (patch) | |
tree | 337f425b022a636cb76af3f93e72aea4659cb5ac /plugins | |
parent | 2e23fe84ff4abbd2a3f356e88d9d910609addafb (diff) |
Add the received slice_uuid to the print information
Contributes to CURA-9031
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CuraEngineBackend/Cura.proto | 4 | ||||
-rwxr-xr-x | plugins/CuraEngineBackend/CuraEngineBackend.py | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index 2eabe62366..b420a6ecc2 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -139,5 +139,9 @@ message GCodePrefix { bytes data = 2; //Header string to be prepended before the rest of the g-code sent from the engine. } +message SliceUUID { + string slice_uuid = 1; //The UUID of the slice. +} + message SlicingFinished { } diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 18088a99c6..db27f8a6a3 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -124,6 +124,7 @@ class CuraEngineBackend(QObject, Backend): self._message_handlers["cura.proto.Progress"] = self._onProgressMessage self._message_handlers["cura.proto.GCodeLayer"] = self._onGCodeLayerMessage self._message_handlers["cura.proto.GCodePrefix"] = self._onGCodePrefixMessage + self._message_handlers["cura.proto.SliceUUID"] = self._onSliceUUIDMessage self._message_handlers["cura.proto.PrintTimeMaterialEstimates"] = self._onPrintTimeMaterialEstimates self._message_handlers["cura.proto.SlicingFinished"] = self._onSlicingFinishedMessage @@ -812,6 +813,10 @@ class CuraEngineBackend(QObject, Backend): except KeyError: # Can occur if the g-code has been cleared while a slice message is still arriving from the other end. pass # Throw the message away. + def _onSliceUUIDMessage(self, message: Arcus.PythonMessage) -> None: + application = CuraApplication.getInstance() + application.getPrintInformation().slice_uuid = message.slice_uuid + def _createSocket(self, protocol_file: str = None) -> None: """Creates a new socket connection.""" |