Merge branch '4.6'

This commit is contained in:
Ghostkeeper 2020-04-09 11:29:27 +02:00
commit c79d7d89b3
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 36 additions and 30 deletions

View file

@ -1254,7 +1254,11 @@ class MachineManager(QObject):
return return
Logger.log("i", "Attempting to switch the printer type to [%s]", machine_name) Logger.log("i", "Attempting to switch the printer type to [%s]", machine_name)
# Get the definition id corresponding to this machine name # Get the definition id corresponding to this machine name
machine_definition_id = CuraContainerRegistry.getInstance().findDefinitionContainers(name = machine_name)[0].getId() definitions = CuraContainerRegistry.getInstance().findDefinitionContainers(name=machine_name)
if not definitions:
Logger.log("e", "Unable to switch printer type since it could not be found!")
return
machine_definition_id = definitions[0].getId()
# Try to find a machine with the same network key # Try to find a machine with the same network key
metadata_filter = {"group_id": self._global_container_stack.getMetaDataEntry("group_id")} metadata_filter = {"group_id": self._global_container_stack.getMetaDataEntry("group_id")}
new_machine = self.getMachine(machine_definition_id, metadata_filter = metadata_filter) new_machine = self.getMachine(machine_definition_id, metadata_filter = metadata_filter)

View file

@ -38,9 +38,11 @@ class RetractContinue(Script):
current_x = self.getValue(line, "X", current_x) current_x = self.getValue(line, "X", current_x)
current_y = self.getValue(line, "Y", current_y) current_y = self.getValue(line, "Y", current_y)
if self.getValue(line, "G") == 1: if self.getValue(line, "G") == 1:
if self.getValue(line, "E"): if not self.getValue(line, "E"): # Either None or 0: Not a retraction then.
continue
new_e = self.getValue(line, "E") new_e = self.getValue(line, "E")
if new_e >= current_e: # Not a retraction. if new_e - current_e >= -0.0001: # Not a retraction. Account for floating point rounding errors.
current_e = new_e
continue continue
# A retracted travel move may consist of multiple commands, due to combing. # A retracted travel move may consist of multiple commands, due to combing.
# This continues retracting over all of these moves and only unretracts at the end. # This continues retracting over all of these moves and only unretracts at the end.