mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 17:45:56 +08:00
Merge branch 'CURA-9031_add_slice_id_to_griffin_gcode_header'
This commit is contained in:
commit
9bb3b1a375
@ -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]]
|
||||
|
@ -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 {
|
||||
}
|
||||
|
@ -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."""
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user