Merge branch '4.2'

This commit is contained in:
Ghostkeeper 2019-07-16 11:51:39 +02:00
commit 569765adfc
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276
5 changed files with 21 additions and 5 deletions

View File

@ -419,13 +419,17 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
if parser.has_option("metadata", "enabled"): if parser.has_option("metadata", "enabled"):
extruder_info.enabled = parser["metadata"]["enabled"] extruder_info.enabled = parser["metadata"]["enabled"]
if variant_id not in ("empty", "empty_variant"): if variant_id not in ("empty", "empty_variant"):
if variant_id in instance_container_info_dict:
extruder_info.variant_info = instance_container_info_dict[variant_id] extruder_info.variant_info = instance_container_info_dict[variant_id]
if material_id not in ("empty", "empty_material"): if material_id not in ("empty", "empty_material"):
root_material_id = reverse_material_id_dict[material_id] root_material_id = reverse_material_id_dict[material_id]
extruder_info.root_material_id = root_material_id extruder_info.root_material_id = root_material_id
definition_changes_id = parser["containers"][str(_ContainerIndexes.DefinitionChanges)] definition_changes_id = parser["containers"][str(_ContainerIndexes.DefinitionChanges)]
if definition_changes_id not in ("empty", "empty_definition_changes"): if definition_changes_id not in ("empty", "empty_definition_changes"):
extruder_info.definition_changes_info = instance_container_info_dict[definition_changes_id] extruder_info.definition_changes_info = instance_container_info_dict[definition_changes_id]
user_changes_id = parser["containers"][str(_ContainerIndexes.UserChanges)] user_changes_id = parser["containers"][str(_ContainerIndexes.UserChanges)]
if user_changes_id not in ("empty", "empty_user_changes"): if user_changes_id not in ("empty", "empty_user_changes"):
extruder_info.user_changes_info = instance_container_info_dict[user_changes_id] extruder_info.user_changes_info = instance_container_info_dict[user_changes_id]
@ -905,6 +909,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
continue continue
extruder_info = self._machine_info.extruder_info_dict[position] extruder_info = self._machine_info.extruder_info_dict[position]
if extruder_info.variant_info is None: 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 continue
parser = extruder_info.variant_info.parser parser = extruder_info.variant_info.parser

View File

@ -422,6 +422,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
return [print_job for print_job in self._print_jobs if return [print_job for print_job in self._print_jobs if
print_job.assignedPrinter is not None and print_job.state != "queued"] 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: def setJobState(self, print_job_uuid: str, state: str) -> None:
self._api.doPrintJobAction(self._cluster.cluster_id, print_job_uuid, state) self._api.doPrintJobAction(self._cluster.cluster_id, print_job_uuid, state)

View File

@ -390,6 +390,13 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
data = "{\"force\": true}" data = "{\"force\": true}"
self.put("print_jobs/{uuid}".format(uuid=print_job_uuid), data, on_finished=None) 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.
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: def _printJobStateChanged(self) -> None:
username = self._getUserName() username = self._getUserName()

View File

@ -7,6 +7,7 @@ MYPY = False
if MYPY: if MYPY:
from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel
class ClusterUM3PrinterOutputController(PrinterOutputController): class ClusterUM3PrinterOutputController(PrinterOutputController):
def __init__(self, output_device): def __init__(self, output_device):
super().__init__(output_device) super().__init__(output_device)
@ -15,6 +16,5 @@ class ClusterUM3PrinterOutputController(PrinterOutputController):
self.can_control_manually = False self.can_control_manually = False
self.can_send_raw_gcode = False self.can_send_raw_gcode = False
def setJobState(self, job: "PrintJobOutputModel", state: str): def setJobState(self, job: "PrintJobOutputModel", state: str) -> None:
data = "{\"action\": \"%s\"}" % state self._output_device.setJobState(job.key, state)
self._output_device.put("print_jobs/%s/action" % job.key, data, on_finished=None)

View File

@ -1426,7 +1426,7 @@
"z_seam_corner": "z_seam_corner":
{ {
"label": "Seam Corner Preference", "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", "type": "enum",
"options": "options":
{ {