From 4ef2caddf5198cc10c04926c8289cd445d10c426 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Oct 2016 13:24:57 +0200 Subject: [PATCH 1/7] Remove debug prints Oops. Contributes to issue CURA-2692. --- cura/Settings/MachineNameValidator.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cura/Settings/MachineNameValidator.py b/cura/Settings/MachineNameValidator.py index d859e85343..c4cab243c3 100644 --- a/cura/Settings/MachineNameValidator.py +++ b/cura/Settings/MachineNameValidator.py @@ -56,14 +56,11 @@ class MachineNameValidator(QObject): def updateValidation(self, new_name): is_valid = self.validate(new_name, 0) if is_valid == QValidator.Acceptable: - print("VALID") self.validation_regex = "^.*$" #Matches anything. else: - print("BROKEN!") self.validation_regex = "a^" #Never matches (unless you manage to get "a" before the start of the string... good luck). self.validationChanged.emit() @pyqtProperty("QRegExp", notify=validationChanged) def machineNameRegex(self): - print(self.machine_name_regex) return QRegExp(self.machine_name_regex) \ No newline at end of file From d33f6d2e44da83a4a3e655b847b835edf4e55964 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Oct 2016 13:32:49 +0200 Subject: [PATCH 2/7] Make regex match exactly on entire string The carot indicates start of string, the dollar the end of string. So it must match on the entire string, not a piece of it. Contributes to issue CURA-2692. --- cura/Settings/MachineNameValidator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/MachineNameValidator.py b/cura/Settings/MachineNameValidator.py index c4cab243c3..34b6351144 100644 --- a/cura/Settings/MachineNameValidator.py +++ b/cura/Settings/MachineNameValidator.py @@ -28,7 +28,7 @@ class MachineNameValidator(QObject): # special character, and that up to [machine_name_max_length / 12] times. maximum_special_characters = int(machine_name_max_length / 12) unescaped = r"[a-zA-Z0-9_\-\.\/]" - self.machine_name_regex = r"((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}" + self.machine_name_regex = r"^((" + unescaped + "){0,12}|.){0," + str(maximum_special_characters) + r"}$" validationChanged = pyqtSignal() From 9f43a740a6a3146d32ef1684a69fa34a3c5a0f87 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Oct 2016 13:33:26 +0200 Subject: [PATCH 3/7] Also validate machine name in rename dialogue Otherwise you could still circumvent the length limitation. Contributes to issue CURA-2692. --- resources/qml/Preferences/MachinesPage.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 78553bb37f..e6ddef7979 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -251,6 +251,8 @@ UM.ManagementPage { id: renameDialog; object: base.currentItem && base.currentItem.name ? base.currentItem.name : ""; + property var machine_name_validator: Cura.MachineNameValidator { } + validName: renameDialog.newName.match(renameDialog.machine_name_validator.machineNameRegex) != null; onAccepted: { Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim()); From af10438277cf412563b41c536f999c3c05a20f20 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 28 Oct 2016 14:49:42 +0200 Subject: [PATCH 4/7] Fixed blurSetting CURA-2835 --- cura/Settings/MachineManager.py | 1 - resources/qml/Cura.qml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 5b57d7ec4a..0ce25c1438 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -248,7 +248,6 @@ class MachineManager(QObject): def _onActiveExtruderStackChanged(self): self.blurSettings.emit() # Ensure no-one has focus. - old_active_container_stack = self._active_container_stack if self._active_container_stack and self._active_container_stack != self._global_container_stack: diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 59e4848851..5c56abcc12 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -539,7 +539,7 @@ UM.MainWindow target: Cura.MachineManager onBlurSettings: { - contentItem.focus = true + forceActiveFocus() } } From d5ba89a026178fb87a38a59d2d0023c0ddb2b393 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Oct 2016 15:18:10 +0200 Subject: [PATCH 5/7] Add function to get other properties than values from all extruders I've made sure that the behaviour of getAllExtruderValues remains the same, so that this function may still be used by other pieces of code. It is now just a special case of getAllExtruderSettings. Please suggest a better naming scheme, if you like. Contributes to issue CURA-2823. --- cura/Settings/ExtruderManager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 0236f158aa..b127f6575d 100644 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -268,18 +268,22 @@ class ExtruderManager(QObject): container_registry.addContainer(container_stack) def getAllExtruderValues(self, setting_key): + return self.getAllExtruderSettings(setting_key, "value") + + ## Gets a + def getAllExtruderSettings(self, setting_key, property): global_container_stack = UM.Application.getInstance().getGlobalContainerStack() - multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1 - if not multi_extrusion: - return [global_container_stack.getProperty(setting_key, "value")] + if global_container_stack.getProperty("machine_extruder_count", "value") <= 1: + return [global_container_stack.getProperty(setting_key, property)] result = [] for index in self.extruderIds: extruder_stack_id = self.extruderIds[str(index)] - stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id=extruder_stack_id)[0] - result.append(stack.getProperty(setting_key, "value")) + stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0] + result.append(stack.getProperty(setting_key, property)) return result + ## Removes the container stack and user profile for the extruders for a specific machine. # # \param machine_id The machine to remove the extruders for. From 2760055e89b28d46f123855675d28cced9d55747 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 28 Oct 2016 15:19:54 +0200 Subject: [PATCH 6/7] Use settings from all extruders for radius of moves from walls It computes the maximum move distance from the outer walls for all extruders, not just the platform adhesion extruder. Contributes to issue CURA-2823. --- cura/BuildVolume.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index e0153b4905..26f8a282a2 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -481,6 +481,15 @@ class BuildVolume(SceneNode): def _getSettingFromAdhesionExtruder(self, setting_key, property = "value"): return self._getSettingFromExtruder(setting_key, "adhesion_extruder_nr", property) + ## Private convenience function to get a setting from every extruder. + # + # For single extrusion machines, this gets the setting from the global + # stack. + # + # \return A sequence of setting values, one for each extruder. + def _getSettingFromAllExtruders(self, setting_key, property = "value"): + return ExtruderManager.getInstance().getAllExtruderSettings(setting_key, property) + ## Private convenience function to get a setting from the support infill # extruder. # @@ -563,10 +572,12 @@ class BuildVolume(SceneNode): farthest_shield_distance = max(farthest_shield_distance, container_stack.getProperty("ooze_shield_dist", "value")) move_from_wall_radius = 0 # Moves that start from outer wall. - if self._getSettingFromAdhesionExtruder("infill_wipe_dist"): - move_from_wall_radius = max(move_from_wall_radius, self._getSettingFromAdhesionExtruder("infill_wipe_dist")) - if self._getSettingFromAdhesionExtruder("travel_avoid_distance") and self._getSettingFromAdhesionExtruder("travel_avoid_other_parts"): - move_from_wall_radius = max(move_from_wall_radius, self._getSettingFromAdhesionExtruder("travel_avoid_distance")) + move_from_wall_radius = max(move_from_wall_radius, max(self._getSettingFromAllExtruders("infill_wipe_dist"))) + avoid_enabled_per_extruder = self._getSettingFromAllExtruders(("travel_avoid_other_parts")) + avoid_distance_per_extruder = self._getSettingFromAllExtruders("travel_avoid_distance") + for index, avoid_other_parts_enabled in enumerate(avoid_enabled_per_extruder): #For each extruder (or just global). + if avoid_other_parts_enabled: + move_from_wall_radius = max(move_from_wall_radius, avoid_distance_per_extruder[index]) #Index of the same extruder. #Now combine our different pieces of data to get the final border size. #Support expansion is added to the bed adhesion, since the bed adhesion goes around support. From 00890abe303a07cae15686860983d2d58a446407 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 31 Oct 2016 10:55:08 +0100 Subject: [PATCH 7/7] Set horizontal expansion to -0.14mm The material team observed that the size of prints was slightly too big. They decided that this adjustment was the best solution. Contributes to issue CURA-2845. --- resources/definitions/ultimaker3.def.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 8be8751d68..ff3c7eb943 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -154,6 +154,7 @@ "travel_avoid_distance": { "value": "3" }, "wall_0_inset": { "value": "0" }, "wall_line_width_x": { "value": "round(line_width * 0.3 / 0.35, 2)" }, - "wall_thickness": { "value": "1" } + "wall_thickness": { "value": "1" }, + "xy_offset": { "value": "-0.14" } } }