mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Add the received slice_uuid to the print information
Contributes to CURA-9031
This commit is contained in:
parent
2e23fe84ff
commit
a712e7517a
3 changed files with 19 additions and 0 deletions
|
@ -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]]
|
||||
|
@ -132,6 +134,14 @@ class PrintInformation(QObject):
|
|||
self._updateJobName()
|
||||
self.preSlicedChanged.emit()
|
||||
|
||||
@property
|
||||
def slice_uuid(self) -> Optional[str]:
|
||||
return self._slice_uuid
|
||||
|
||||
@slice_uuid.setter
|
||||
def slice_uuid(self, value: Optional[str]) -> None:
|
||||
self._slice_uuid = value
|
||||
|
||||
@pyqtProperty(QObject, notify = currentPrintTimeChanged)
|
||||
def currentPrintTime(self) -> Duration:
|
||||
return self._current_print_time[self._active_build_plate]
|
||||
|
|
|
@ -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."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue