diff options
author | Ghostkeeper <rubend@tutanota.com> | 2022-07-29 17:02:39 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2022-07-29 17:02:39 +0300 |
commit | 9bb3b1a3753f41f5a3da2cf8ad9b1350259ddfd6 (patch) | |
tree | 019c350ac60460940167b832774b07be41c2409f | |
parent | c27cee8a72ebed20534b1d0b9d4829ac2b3642e5 (diff) | |
parent | a0f640586ccba13ecc2f45d9ddb0f21c2ab10073 (diff) |
Merge branch 'CURA-9031_add_slice_id_to_griffin_gcode_header'
-rw-r--r-- | cura/UI/PrintInformation.py | 2 | ||||
-rw-r--r-- | plugins/CuraEngineBackend/Cura.proto | 4 | ||||
-rwxr-xr-x | plugins/CuraEngineBackend/CuraEngineBackend.py | 5 | ||||
-rwxr-xr-x | plugins/SliceInfoPlugin/SliceInfo.py | 1 | ||||
-rw-r--r-- | plugins/SliceInfoPlugin/example_data.html | 1 |
5 files changed, 13 insertions, 0 deletions
diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py index e18fc38247..2b8e13b09f 100644 --- a/cura/UI/PrintInformation.py +++ b/cura/UI/PrintInformation.py @@ -38,6 +38,8 @@ class PrintInformation(QObject): self.initializeCuraMessagePrintTimeProperties() + self.slice_uuid: Optional[str] = None + # Indexed by build plate number self._material_lengths = {} # type: Dict[int, List[float]] self._material_weights = {} # type: Dict[int, List[float]] 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.""" diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 0bf76f8423..0c9a2e35f4 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -133,6 +133,7 @@ class SliceInfo(QObject, Extension): data["is_logged_in"] = self._application.getCuraAPI().account.isLoggedIn data["organization_id"] = org_id if org_id else None data["subscriptions"] = user_profile.get("subscriptions", []) if user_profile else [] + data["slice_uuid"] = print_information.slice_uuid active_mode = self._application.getPreferences().getValue("cura/active_mode") if active_mode == 0: diff --git a/plugins/SliceInfoPlugin/example_data.html b/plugins/SliceInfoPlugin/example_data.html index 85a9f554ff..75cc48b55c 100644 --- a/plugins/SliceInfoPlugin/example_data.html +++ b/plugins/SliceInfoPlugin/example_data.html @@ -9,6 +9,7 @@ <b>Using Custom Settings:</b> No<br/> <b>Is Logged In:</b> Yes<br/> <b>Organization ID (if any):</b> ABCDefGHIjKlMNOpQrSTUvYxWZ0-1234567890abcDE=<br/> + <b>Slice ID:</b> aBcDeF01-2345-6789-aBcD-eF0123456789<br/> <b>Subscriptions (if any):</b> <ul> <li><b>Level:</b> 10, <b>Type:</b> Enterprise, <b>Plan:</b> Basic</li> |