From 6210135b927c194fdf26c3cb728fa55c3e94fe09 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 12 Jul 2019 08:14:28 +0200 Subject: [PATCH 1/4] Send the correct action name when using local network --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 1 + plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 6 ++++++ .../src/ClusterUM3PrinterOutputController.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 8d872d33f5..8d94f41ea5 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -422,6 +422,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): return [print_job for print_job in self._print_jobs if print_job.assignedPrinter is not None and print_job.state != "queued"] + ## Set the remote print job state. def setJobState(self, print_job_uuid: str, state: str) -> None: self._api.doPrintJobAction(self._cluster.cluster_id, print_job_uuid, state) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 6fbb115601..dd69a7fe35 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -390,6 +390,12 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): data = "{\"force\": true}" self.put("print_jobs/{uuid}".format(uuid=print_job_uuid), data, on_finished=None) + # Set the remote print job state. + def setJobState(self, print_job_uuid: str, state: str) -> None: + # We rewrite 'resume' to 'print' here because we are using the old print job action endpoints. + data = "{\"action\": \"%s\"}" % "print" if state == "resume" else state + self.put("print_jobs/%s/action" % print_job_uuid, data, on_finished=None) + def _printJobStateChanged(self) -> None: username = self._getUserName() diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py b/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py index 370cfc9008..7273e01f0f 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py @@ -7,6 +7,7 @@ MYPY = False if MYPY: from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel + class ClusterUM3PrinterOutputController(PrinterOutputController): def __init__(self, output_device): super().__init__(output_device) @@ -16,5 +17,4 @@ class ClusterUM3PrinterOutputController(PrinterOutputController): self.can_send_raw_gcode = False def setJobState(self, job: "PrintJobOutputModel", state: str): - data = "{\"action\": \"%s\"}" % state - self._output_device.put("print_jobs/%s/action" % job.key, data, on_finished=None) + self._output_device.setJobState(job.key, state) From 25130b63e2a98f50f5cfc76b10f7a72a6de4c372 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Fri, 12 Jul 2019 09:19:30 +0200 Subject: [PATCH 2/4] Fix logic --- plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 3 ++- .../src/ClusterUM3PrinterOutputController.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index dd69a7fe35..5344fe2021 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -393,7 +393,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): # Set the remote print job state. def setJobState(self, print_job_uuid: str, state: str) -> None: # We rewrite 'resume' to 'print' here because we are using the old print job action endpoints. - data = "{\"action\": \"%s\"}" % "print" if state == "resume" else state + action = "print" if state == "resume" else state + data = "{\"action\": \"%s\"}" % action self.put("print_jobs/%s/action" % print_job_uuid, data, on_finished=None) def _printJobStateChanged(self) -> None: diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py b/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py index 7273e01f0f..103be8b01e 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3PrinterOutputController.py @@ -16,5 +16,5 @@ class ClusterUM3PrinterOutputController(PrinterOutputController): self.can_control_manually = False self.can_send_raw_gcode = False - def setJobState(self, job: "PrintJobOutputModel", state: str): + def setJobState(self, job: "PrintJobOutputModel", state: str) -> None: self._output_device.setJobState(job.key, state) From 20c55c09cd47bdb0d3718260cce631ec661867db Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 15 Jul 2019 11:33:41 +0200 Subject: [PATCH 3/4] Add description for smart hiding to Corner Seam Pref description --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index f4c963c876..f08c2e0840 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1426,7 +1426,7 @@ "z_seam_corner": { "label": "Seam Corner Preference", - "description": "Control whether corners on the model outline influence the position of the seam. None means that corners have no influence on the seam position. Hide Seam makes the seam more likely to occur on an inside corner. Expose Seam makes the seam more likely to occur on an outside corner. Hide or Expose Seam makes the seam more likely to occur at an inside or outside corner.", + "description": "Control whether corners on the model outline influence the position of the seam. None means that corners have no influence on the seam position. Hide Seam makes the seam more likely to occur on an inside corner. Expose Seam makes the seam more likely to occur on an outside corner. Hide or Expose Seam makes the seam more likely to occur at an inside or outside corner. Smart Hiding allows both inside and outside corners, but chooses inside corners more frequently, if appropriate.", "type": "enum", "options": { From 1e7c68238240e1ca8c977fa0a9ac50e4aee8b2e4 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 16 Jul 2019 11:24:17 +0200 Subject: [PATCH 4/4] Use default variant if empty in project loading CURA-6654 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 8a18d1b698..a9142c6d12 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -419,13 +419,17 @@ class ThreeMFWorkspaceReader(WorkspaceReader): if parser.has_option("metadata", "enabled"): extruder_info.enabled = parser["metadata"]["enabled"] if variant_id not in ("empty", "empty_variant"): - extruder_info.variant_info = instance_container_info_dict[variant_id] + if variant_id in instance_container_info_dict: + extruder_info.variant_info = instance_container_info_dict[variant_id] + if material_id not in ("empty", "empty_material"): root_material_id = reverse_material_id_dict[material_id] extruder_info.root_material_id = root_material_id + definition_changes_id = parser["containers"][str(_ContainerIndexes.DefinitionChanges)] if definition_changes_id not in ("empty", "empty_definition_changes"): extruder_info.definition_changes_info = instance_container_info_dict[definition_changes_id] + user_changes_id = parser["containers"][str(_ContainerIndexes.UserChanges)] if user_changes_id not in ("empty", "empty_user_changes"): extruder_info.user_changes_info = instance_container_info_dict[user_changes_id] @@ -905,6 +909,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): continue extruder_info = self._machine_info.extruder_info_dict[position] if extruder_info.variant_info is None: + # If there is no variant_info, try to use the default variant. Otherwise, leave it be. + node = variant_manager.getDefaultVariantNode(global_stack.definition, VariantType.NOZZLE, global_stack) + if node is not None and node.getContainer() is not None: + extruder_stack.variant = node.getContainer() continue parser = extruder_info.variant_info.parser