From dd030b960235f1921f72f036627599c926c9d0ea Mon Sep 17 00:00:00 2001 From: Ruben D Date: Thu, 7 Sep 2017 16:35:38 +0200 Subject: [PATCH 1/9] Add setting to only iron the highest layer of a mesh --- resources/definitions/fdmprinter.def.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 817da65247..7a870d2c55 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -5712,6 +5712,16 @@ "limit_to_extruder": "top_bottom_extruder_nr", "settable_per_mesh": true }, + "ironing_only_highest_layer": + { + "label": "Iron Only Highest Layer", + "description": "Only perform ironing on the very last layer of the mesh. This saves time if the lower layers don't need a smooth surface finish.", + "type": "bool", + "default_value": false, + "enabled": "ironing_enabled", + "limit_to_extruder": "top_bottom_extruder_nr", + "settable_per_mesh": true + }, "ironing_pattern": { "label": "Ironing Pattern", From 3188156da30ea6e167c7a864af30fc55eb323561 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 14 Sep 2017 17:19:43 +0200 Subject: [PATCH 2/9] WIP: infill slider CURA-4303 --- resources/qml/SidebarSimple.qml | 99 ++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index bbfd8a424a..efcd2f15df 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -410,13 +410,110 @@ Item } } + // + // NEW Infill + // + Item + { + id: newInfillCellLeft + anchors.top: speedLabel.top + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.2 + anchors.left: parent.left + width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width + height: UM.Theme.getSize("sidebar_margin").height + + Text + { + id: newInfillLabel + //: Infill selection label + text: catalog.i18nc("@label", "Infill"); + font: UM.Theme.getFont("default"); + color: UM.Theme.getColor("text"); + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width + } + } + + Item + { + id: newInfillCellRight + + height: UM.Theme.getSize("sidebar_margin").height + width: UM.Theme.getSize("sidebar").width * .55 + + anchors.left: newInfillCellLeft.right + anchors.top: newInfillCellLeft.top + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height + + Text + { + id: selectedInfillRateText + anchors.top: parent.top + anchors.left: infillSlider.left + anchors.leftMargin: (infillSlider.value / infillSlider.stepSize) * (infillSlider.width / (infillSlider.maximumValue / infillSlider.stepSize)) - 9 + anchors.right: parent.right + height: UM.Theme.getSize("sidebar_margin").height / 10 + text: "10%" + horizontalAlignment: Text.AlignLeft + } + + Slider + { + id: infillSlider + anchors.top: selectedInfillRateText.bottom + anchors.left: parent.left + height: UM.Theme.getSize("sidebar_margin").height * 5 + + minimumValue: 0 + maximumValue: 100 + stepSize: 5 + tickmarksEnabled: true + + style: SliderStyle + { + groove: Rectangle { + id: groove + implicitWidth: 200 + implicitHeight: 2 + color: "gray" + radius: 1 + } + handle: Item + { + Rectangle { + id: handleButton + anchors.centerIn: parent + color: control.hovered ? UM.Theme.getColor("quality_slider_handle_hover") : UM.Theme.getColor("quality_slider_handle") + implicitWidth: 10 + implicitHeight: 10 + radius: 10 + } + } + tickmarks: Repeater { + id: repeater + model: control.maximumValue / control.stepSize + 1 + Rectangle { + anchors.verticalCenter: parent.verticalCenter + color: UM.Theme.getColor("quality_slider_available") + width: 1 + height: 6 + y: 0 + x: styleData.handleWidth / 2 + index * ((repeater.width - styleData.handleWidth) / (repeater.count-1)) + } + } + } + } + } + // // Infill // Item { id: infillCellLeft - anchors.top: speedLabel.top + anchors.top: newInfillCellRight.bottom anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.2 anchors.left: parent.left width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width From ff17b7c4171f9b307fb38add188f5dced258f349 Mon Sep 17 00:00:00 2001 From: Pieter Bos Date: Sun, 17 Sep 2017 00:04:50 +0200 Subject: [PATCH 3/9] Improve Prusa MK2 start GCode --- resources/definitions/prusa_i3_mk2.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/prusa_i3_mk2.def.json b/resources/definitions/prusa_i3_mk2.def.json index d4425728d4..ef3ef8159e 100644 --- a/resources/definitions/prusa_i3_mk2.def.json +++ b/resources/definitions/prusa_i3_mk2.def.json @@ -41,7 +41,7 @@ "machine_max_jerk_e": { "default_value": 2.5 }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default_value": "G21 ; set units to millimeters\nG90 ; use absolute positioning\nM82 ; absolute extrusion mode\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nM104 S{material_print_temperature} ; set extruder temp\nM140 S{material_bed_temperature} ; set bed temp\nM190 S{material_bed_temperature} ; wait for bed temp\nM109 S{material_print_temperature} ; wait for extruder temp\nG92 E0.0 ; reset extruder distance position\nG1 Y-3.0 F1000.0 ; go outside print area\nG1 X60.0 E9.0 F1000.0 ; intro line\nG1 X100.0 E21.5 F1000.0 ; intro line\nG92 E0.0 ; reset extruder distance position" + "default_value": "G21 ; set units to millimeters\nG90 ; use absolute positioning\nM82 ; absolute extrusion mode\nM104 S{material_print_temperature} ; set extruder temp\nM140 S{material_bed_temperature} ; set bed temp\nM190 S{material_bed_temperature} ; wait for bed temp\nM109 S{material_print_temperature} ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG92 E0.0 ; reset extruder distance position\nG1 Y-3.0 F1000.0 ; go outside print area\nG1 X60.0 E9.0 F1000.0 ; intro line\nG1 X100.0 E21.5 F1000.0 ; intro line\nG92 E0.0 ; reset extruder distance position" }, "machine_end_gcode": { "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X0 Y210; home X axis and push Y forward\nM84 ; disable motors" From 2901b832a5f7115ead68a1b663c148926b7c7493 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Sep 2017 09:00:39 +0200 Subject: [PATCH 4/9] Sync setting visibility with XmlMaterialProfile This is why we shouldn't do double-data. --- cura/Settings/MaterialSettingsVisibilityHandler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/Settings/MaterialSettingsVisibilityHandler.py b/cura/Settings/MaterialSettingsVisibilityHandler.py index a533a0cabd..b97987a18e 100644 --- a/cura/Settings/MaterialSettingsVisibilityHandler.py +++ b/cura/Settings/MaterialSettingsVisibilityHandler.py @@ -11,6 +11,7 @@ class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHand "default_material_print_temperature", "material_bed_temperature", "material_standby_temperature", + "material_flow_temp_graph", "cool_fan_speed", "retraction_amount", "retraction_speed", From 4ca5987ca8fbf89cdf938c82dc6ff65e9ebc2942 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 10:50:52 +0200 Subject: [PATCH 5/9] CURA-4269 added a flag to determine wether auto drop should be executed or not --- cura/PlatformPhysics.py | 14 +++++++++----- plugins/3MFReader/ThreeMFReader.py | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index dc5594dc7b..3db681eb06 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -9,6 +9,7 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Scene.Selection import Selection from UM.Preferences import Preferences +from UM.Logger import Logger from cura.ConvexHullDecorator import ConvexHullDecorator @@ -41,10 +42,12 @@ class PlatformPhysics: def _onSceneChanged(self, source): self._change_timer.start() - def _onChangeTimerFinished(self): + def _onChangeTimerFinished(self, was_triggered_by_tool=False): if not self._enabled: return + Logger.log("d", "was_triggered_by_tool=%s", was_triggered_by_tool) + root = self._controller.getScene().getRoot() # Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the @@ -71,14 +74,15 @@ class PlatformPhysics: # Check if this is the first time a project file node was loaded (disable auto drop in that case), defaults to True should_auto_drop = node.getSetting("auto_drop", True) + # This should NOT happen if the scene change was triggered by a tool (like translate), only on project load + if was_triggered_by_tool: + should_auto_drop = True + # If a node is grouped or it's loaded from a project file (auto-drop disabled), don't move it down if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup")) and node.isEnabled() and should_auto_drop: z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0 move_vector = move_vector.set(y=-bbox.bottom + z_offset) - # Enable auto-drop after processing the project file node for the first time - node.setSetting("auto_drop", False) - # If there is no convex hull for the node, start calculating it and continue. if not node.getDecorator(ConvexHullDecorator): node.addDecorator(ConvexHullDecorator()) @@ -167,4 +171,4 @@ class PlatformPhysics: node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) self._enabled = True - self._onChangeTimerFinished() + self._onChangeTimerFinished(True) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 66dfb6130e..b947c4eb39 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -77,7 +77,10 @@ class ThreeMFReader(MeshReader): # \returns Uranium SceneNode. def _convertSavitarNodeToUMNode(self, savitar_node): um_node = SceneNode() - um_node.setSetting("auto_drop", False) # Disable the auto-drop feature when loading a project file and processing the nodes for the first time + + # Disable the auto-drop feature when loading a project file and processing the nodes for the first time + um_node.setSetting("auto_drop", False) + transformation = self._createMatrixFromTransformationString(savitar_node.getTransformation()) um_node.setTransformation(transformation) mesh_builder = MeshBuilder() From f07f7a2f1273267ea9c7855f79848fe6bc91adeb Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 10:51:32 +0200 Subject: [PATCH 6/9] Remove logging --- cura/PlatformPhysics.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 3db681eb06..aca91f866a 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -9,7 +9,6 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Scene.Selection import Selection from UM.Preferences import Preferences -from UM.Logger import Logger from cura.ConvexHullDecorator import ConvexHullDecorator @@ -46,8 +45,6 @@ class PlatformPhysics: if not self._enabled: return - Logger.log("d", "was_triggered_by_tool=%s", was_triggered_by_tool) - root = self._controller.getScene().getRoot() # Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the From 6c2bd10a20f8d79743b942bda27d6b22a1dad1aa Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Sep 2017 11:18:50 +0200 Subject: [PATCH 7/9] Remove redundant feedrate override The default in ultimaker.def.json is also 45, so this is not necessary. --- resources/definitions/ultimaker2.def.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index 1931e5f8e3..0a9a7bf7ce 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -89,9 +89,6 @@ "machine_max_feedrate_z": { "default_value": 40 }, - "machine_max_feedrate_e": { - "default_value": 45 - }, "machine_acceleration": { "default_value": 3000 }, From e8553e8e6962fae2583470a4caa2299dcc8d4384 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 18 Sep 2017 11:47:23 +0200 Subject: [PATCH 8/9] Fixed double messages and rearrange some code - CURA-4224 --- .../FirmwareUpdateCheckerJob.py | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 108cfa4c0d..31ce137ed7 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -54,30 +54,32 @@ class FirmwareUpdateCheckerJob(Job): # Nothing to parse, just get the string # TODO: In the future may be done by parsing a JSON file with diferent version for each printer model current_version = reader(current_version_file).readline().rstrip() - Logger.log("i", "Reading firmware version of %s: %s", machine_name, current_version) - # If it is the first time the version is checked, the checked_version is None + # If it is the first time the version is checked, the checked_version is '' checked_version = Preferences.getInstance().getValue("info/latest_checked_firmware") # If the checked_version is '', it's because is the first time we check firmware and in this case # we will not show the notification, but we will store it for the next time + Preferences.getInstance().setValue("info/latest_checked_firmware", current_version) + Logger.log("i", "Reading firmware version of %s: checked = %s - latest = %s", machine_name, checked_version, current_version) + + # The first time we want to store the current version, the notification will not be shown, + # because the new version of Cura will be release before the firmware and we don't want to + # notify the user when no new firmware version is available. if (checked_version != "") and (checked_version != current_version): - message = Message(i18n_catalog.i18nc("@info", "New %s firmware available

To ensure that your " - "%s is equiped with the latest features it is recommended " - "to update the firmware regularly. This can be done on the " - "%s (when connected to the network) or via USB." - % (machine_name, machine_name, machine_name))) + Logger.log("i", "SHOWING FIRMWARE UPDATE MESSAGE") + message = Message(i18n_catalog.i18nc("@info", "To ensure that your %s is equipped with the latest " + "features it is recommended to update the firmware " + "regularly. This can be done on the %s (when connected " + "to the network) or via USB." + % (machine_name, machine_name)), + title = i18n_catalog.i18nc("@info:title", "New %s firmware available" % machine_name)) message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]") # If we do this in a cool way, the download url should be available in the JSON file self._download_url = "https://ultimaker.com/en/resources/20500-upgrade-firmware" message.actionTriggered.connect(self.actionTriggered) - Application.getInstance().showMessage(message) - - # The first time we want to store the current version, the notification will not be shown, - # because the new version of Cura will be release before the firmware and we don't want to - # notify the user when no new firmware version is available. - Preferences.getInstance().setValue("info/latest_checked_firmware", current_version) + message.show() except Exception as e: Logger.log("w", "Failed to check for new version: %s", e) From 9553235b42a8c3e9e4a8d840b57f2326ebfcda94 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 15:15:59 +0200 Subject: [PATCH 9/9] CURA-4303 finish infill slider, images, gradual checkbox, bindings --- resources/qml/SidebarSimple.qml | 365 ++++++++++++-------------------- 1 file changed, 137 insertions(+), 228 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index f4dc04b2c8..f65b436acc 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -397,24 +397,26 @@ Item } // - // NEW Infill + // Infill // Item { - id: newInfillCellLeft + id: infillCellLeft + anchors.top: speedLabel.top - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.2 + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.2 // FIXME better margin value anchors.left: parent.left + width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width height: UM.Theme.getSize("sidebar_margin").height Text { - id: newInfillLabel - //: Infill selection label - text: catalog.i18nc("@label", "Infill"); - font: UM.Theme.getFont("default"); - color: UM.Theme.getColor("text"); + id: infillLabel + text: catalog.i18nc("@label", "Infill") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + anchors.top: parent.top anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.left: parent.left @@ -424,65 +426,81 @@ Item Item { - id: newInfillCellRight + id: infillCellRight - height: UM.Theme.getSize("sidebar_margin").height + height: infillSlider.height + enableGradualInfillCheckBox.height + (UM.Theme.getSize("sidebar_margin").height * 2) width: UM.Theme.getSize("sidebar").width * .55 - anchors.left: newInfillCellLeft.right - anchors.top: newInfillCellLeft.top + anchors.left: infillCellLeft.right + anchors.top: infillCellLeft.top anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - Text - { + Text { id: selectedInfillRateText + anchors.top: parent.top anchors.left: infillSlider.left - anchors.leftMargin: (infillSlider.value / infillSlider.stepSize) * (infillSlider.width / (infillSlider.maximumValue / infillSlider.stepSize)) - 9 + anchors.leftMargin: (infillSlider.value / infillSlider.stepSize) * (infillSlider.width / (infillSlider.maximumValue / infillSlider.stepSize)) - 10 anchors.right: parent.right - height: UM.Theme.getSize("sidebar_margin").height / 10 - text: "10%" + + text: infillSlider.value + "%" horizontalAlignment: Text.AlignLeft + + color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") } Slider { id: infillSlider + anchors.top: selectedInfillRateText.bottom - anchors.left: parent.left - height: UM.Theme.getSize("sidebar_margin").height * 5 + anchors.left: parent.left + UM.Theme.getSize("sidebar_margin").widt + + height: UM.Theme.getSize("sidebar_margin").height + width: infillCellRight.width - infillIcon.width - UM.Theme.getSize("sidebar_margin").width minimumValue: 0 maximumValue: 100 - stepSize: 5 + stepSize: 10 tickmarksEnabled: true + // disable slider when gradual support is enabled + enabled: parseInt(infillSteps.properties.value) == 0 + + // set initial value from stack + value: parseInt(infillDensity.properties.value) + + onValueChanged: { + infillDensity.setPropertyValue("value", infillSlider.value) + } + style: SliderStyle { groove: Rectangle { id: groove implicitWidth: 200 implicitHeight: 2 - color: "gray" + color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") radius: 1 } - handle: Item - { + + handle: Item { Rectangle { id: handleButton anchors.centerIn: parent - color: control.hovered ? UM.Theme.getColor("quality_slider_handle_hover") : UM.Theme.getColor("quality_slider_handle") + color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") implicitWidth: 10 implicitHeight: 10 radius: 10 } } + tickmarks: Repeater { id: repeater model: control.maximumValue / control.stepSize + 1 Rectangle { anchors.verticalCenter: parent.verticalCenter - color: UM.Theme.getColor("quality_slider_available") + color: control.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") width: 1 height: 6 y: 0 @@ -491,242 +509,161 @@ Item } } } - } - // - // Infill - // - Item - { - id: infillCellLeft - anchors.top: newInfillCellRight.bottom - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 1.2 - anchors.left: parent.left - width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width - height: childrenRect.height - - Text + Item { - id: infillLabel - //: Infill selection label - text: catalog.i18nc("@label", "Infill"); - font: UM.Theme.getFont("default"); - color: UM.Theme.getColor("text"); - anchors.top: parent.top - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width - } - } + width: (infillCellRight.width / 5) - (UM.Theme.getSize("sidebar_margin").width) + height: width - Row - { - id: infillCellRight + anchors.right: infillCellRight.right + anchors.top: infillSlider.top - height: childrenRect.height; - width: UM.Theme.getSize("sidebar").width * .55 - - spacing: UM.Theme.getSize("sidebar_margin").width - - anchors.left: infillCellLeft.right - anchors.top: infillCellLeft.top - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - - Repeater - { - id: infillListView - property int activeIndex: + // we loop over all density icons and only show the one that has the current density and steps + Repeater { - for(var i = 0; i < infillModel.count; ++i) - { - var density = parseInt(infillDensity.properties.value); - var steps = parseInt(infillSteps.properties.value); - if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax) - { - return i; + id: infillIconList + model: infillModel + + property int activeIndex: { + for (var i = 0; i < infillModel.count; i++) { + var density = parseInt(infillDensity.properties.value) + var steps = parseInt(infillSteps.properties.value) + var infillModelItem = infillModel.get(i) + + if (density >= infillModelItem.percentageMin + && density <= infillModelItem.percentageMax + && steps >= infillModelItem.stepsMin + && steps <= infillModelItem.stepsMax){ + return i + } } + return -1 } - return -1; - } - model: infillModel; + Item { + anchors.fill: parent - Item - { - width: childrenRect.width; - height: childrenRect.height; - - Rectangle - { - id: infillIconLining - - width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("sidebar_margin").width)) / (infillModel.count); - height: width - - border.color: - { - if(!base.settingsEnabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - else if(infillListView.activeIndex == index) - { - return UM.Theme.getColor("setting_control_selected") - } - else if(infillMouseArea.containsMouse) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - border.width: UM.Theme.getSize("default_lining").width - color: - { - if(infillListView.activeIndex == index) - { - if(!base.settingsEnabled) - { - return UM.Theme.getColor("setting_control_disabled_text") - } - return UM.Theme.getColor("setting_control_selected") - } - return "transparent" - } - - UM.RecolorImage - { - id: infillIcon - anchors.fill: parent; - anchors.margins: 2 - - sourceSize.width: width - sourceSize.height: width - source: UM.Theme.getIcon(model.icon); - color: { - if(infillListView.activeIndex == index) - { - return UM.Theme.getColor("text_emphasis") - } - if(!base.settingsEnabled) - { - return UM.Theme.getColor("setting_control_disabled_text") - } - return UM.Theme.getColor("setting_control_disabled_text") - } - } - - MouseArea - { - id: infillMouseArea + Rectangle { anchors.fill: parent - hoverEnabled: true - enabled: base.settingsEnabled - onClicked: { - if (infillListView.activeIndex != index) - { - infillDensity.setPropertyValue("value", model.percentage) - infillSteps.setPropertyValue("value", model.steps) - } - } - onEntered: - { - base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, 0), model.text); - } - onExited: - { - base.hideTooltip(); + visible: infillIconList.activeIndex == index + + UM.RecolorImage { + id: infillIcon + anchors.fill: parent + sourceSize.width: width + sourceSize.height: width + source: UM.Theme.getIcon(model.icon) + color: UM.Theme.getColor("quality_slider_available") } } } - Text - { - id: infillLabel - width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("sidebar_margin").width)) / (infillModel.count); - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap - font: UM.Theme.getFont("default") - anchors.top: infillIconLining.bottom - anchors.horizontalCenter: infillIconLining.horizontalCenter - color: infillListView.activeIndex == index ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_border") - text: name - } } } + // Gradual Support Infill Checkbox + CheckBox { + id: enableGradualInfillCheckBox + property alias _hovered: enableGradualInfillMouseArea.containsMouse + + anchors.top: infillSlider.bottom + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height + anchors.left: infillCellRight.left + + style: UM.Theme.styles.checkbox + enabled: base.settingsEnabled + checked: parseInt(infillSteps.properties.value) > 0 + + MouseArea { + id: enableGradualInfillMouseArea + + anchors.fill: parent + hoverEnabled: true + enabled: true + + onClicked: { + infillSteps.setPropertyValue("value", (parseInt(infillSteps.properties.value) == 0) ? 5 : 0) + infillDensity.setPropertyValue("value", 90) + } + + onEntered: { + base.showTooltip(enableGradualInfillCheckBox, Qt.point(-infillCellRight.x, 0), + catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.")) + } + + onExited: { + base.hideTooltip() + } + } + + Text { + id: gradualInfillLabel + anchors.left: enableGradualInfillCheckBox.right + anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width / 2 // FIXME better margin value + text: catalog.i18nc("@label", "Enable gradual") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + } + + // Infill list model for mapping icon ListModel { id: infillModel - Component.onCompleted: { infillModel.append({ - name: catalog.i18nc("@label", "0%"), - percentage: 0, - steps: 0, percentageMin: -1, percentageMax: 0, stepsMin: -1, stepsMax: 0, - text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength."), icon: "hollow" }) infillModel.append({ - name: catalog.i18nc("@label", "20%"), - percentage: 20, - steps: 0, percentageMin: 0, - percentageMax: 30, + percentageMax: 40, stepsMin: -1, stepsMax: 0, - text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength."), icon: "sparse" }) infillModel.append({ - name: catalog.i18nc("@label", "50%"), - percentage: 50, - steps: 0, - percentageMin: 30, - percentageMax: 70, + percentageMin: 40, + percentageMax: 89, stepsMin: -1, stepsMax: 0, - text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength."), icon: "dense" }) infillModel.append({ - name: catalog.i18nc("@label", "100%"), - percentage: 100, - steps: 0, - percentageMin: 70, + percentageMin: 90, percentageMax: 9999999999, stepsMin: -1, stepsMax: 0, - text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid."), icon: "solid" }) infillModel.append({ - name: catalog.i18nc("@label", "Gradual"), - percentage: 90, - steps: 5, percentageMin: 0, percentageMax: 9999999999, - stepsMin: 0, + stepsMin: 1, stepsMax: 9999999999, - infill_layer_height: 1.5, - text: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top."), icon: "gradual" }) } } } + // + // Enable support + // Text { id: enableSupportLabel visible: enableSupportCheckBox.visible + + anchors.top: infillCellRight.bottom + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.verticalCenter: enableSupportCheckBox.verticalCenter + text: catalog.i18nc("@label", "Generate Support"); font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); @@ -942,7 +879,6 @@ Item anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width anchors.top: parent.top wrapMode: Text.WordWrap - //: Tips label text: catalog.i18nc("@label", "Need help improving your prints?
Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting") font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); @@ -961,35 +897,9 @@ Item storeIndex: 0 } - Binding - { - target: infillDensity - property: "containerStackId" - value: - { - var activeMachineId = Cura.MachineManager.activeMachineId; - if (machineExtruderCount.properties.value > 1) - { - var infillExtruderNr = parseInt(infillExtruderNumber.properties.value); - if (infillExtruderNr >= 0) - { - activeMachineId = ExtruderManager.extruderIds[infillExtruderNumber.properties.value]; - } - else if (ExtruderManager.activeExtruderStackId) - { - activeMachineId = ExtruderManager.activeExtruderStackId; - } - } - - infillSteps.containerStackId = activeMachineId; - return activeMachineId; - } - } - UM.SettingPropertyProvider { id: infillDensity - containerStackId: Cura.MachineManager.activeStackId key: "infill_sparse_density" watchedProperties: [ "value" ] @@ -999,10 +909,9 @@ Item UM.SettingPropertyProvider { id: infillSteps - containerStackId: Cura.MachineManager.activeStackId key: "gradual_infill_steps" - watchedProperties: [ "value" ] + watchedProperties: ["value"] storeIndex: 0 }