From a545cde4a8ba556bf49d3cdd73de7ed20018d4c3 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 11:53:57 +0200 Subject: [PATCH 1/6] Force setting fields to update when discarding changes Textfields that have the focus don't (always) update when a new value is set. CURA-1585 --- cura/MachineManagerModel.py | 6 +++++- resources/qml/Settings/SettingItem.qml | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cura/MachineManagerModel.py b/cura/MachineManagerModel.py index f82d0e8a67..46425ba55e 100644 --- a/cura/MachineManagerModel.py +++ b/cura/MachineManagerModel.py @@ -61,7 +61,9 @@ class MachineManagerModel(QObject): activeStackChanged = pyqtSignal() globalValueChanged = pyqtSignal() # Emitted whenever a value inside global container is changed. - globalValidationChanged = pyqtSignal() # Emitted whenever a validation inside global container is changed. + globalValidationChanged = pyqtSignal() # Emitted whenever a validation inside global container is changed + + blurSettings = pyqtSignal() # Emitted to force fields in the advanced sidebar to un-focus, so they update properly @pyqtProperty("QVariantMap", notify = globalContainerChanged) def extrudersIds(self): @@ -212,6 +214,7 @@ class MachineManagerModel(QObject): if not self._active_container_stack: return + self.blurSettings.emit() user_settings = self._active_container_stack.getTop() user_settings.clear() @@ -299,6 +302,7 @@ class MachineManagerModel(QObject): new_container_id = self.duplicateContainer(self.activeQualityId) if new_container_id == "": return + self.blurSettings.emit() self.setActiveQuality(new_container_id) self.updateQualityContainerFromUserContainer() diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 4fd84759fd..e98c06329d 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -7,6 +7,7 @@ import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import UM 1.1 as UM +import Cura 1.0 as Cura import "." @@ -245,5 +246,14 @@ Item { } } + Connections + { + target: Cura.MachineManager + onBlurSettings: + { + revertButton.focus = true + } + } + UM.I18nCatalog { id: catalog; name: "cura" } } From 18e69c75808a1c9bc9c382fa078752f09a708bb7 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 13:09:52 +0200 Subject: [PATCH 2/6] Add missing "enabled" functions for support_extruder_nr children CURA-1278 --- resources/definitions/fdmprinter.def.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 6e6474053f..9675c905e9 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2751,6 +2751,7 @@ "value": "support_extruder_nr", "minimum_value": "0", "maximum_value": "machine_extruder_count - 1", + "enabled": "support_enable", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -2763,6 +2764,7 @@ "value": "support_extruder_nr", "minimum_value": "0", "maximum_value": "machine_extruder_count - 1", + "enabled": "support_enable", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -2775,6 +2777,7 @@ "value": "support_extruder_nr", "minimum_value": "0", "maximum_value": "machine_extruder_count - 1", + "enabled": "support_enable", "settable_per_mesh": false, "settable_per_extruder": false } From 33c4e861639e897dfab1af751f20ac6a7960f777 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 16:14:16 +0200 Subject: [PATCH 3/6] Change abbreviation of "seconds" to IEEE-recommended "s" (instead of "sec") --- plugins/USBPrinting/USBPrinterOutputDevice.py | 2 +- resources/definitions/bq_hephestos.def.json | 2 +- resources/definitions/bq_hephestos_xl.def.json | 2 +- resources/definitions/bq_witbox.def.json | 2 +- resources/definitions/fdmprinter.def.json | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 68c4567450..58b75c2987 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -256,7 +256,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): if not self.setBaudRate(baud_rate): continue # Could not set the baud rate, go to the next - time.sleep(1.5) # Ensure that we are not talking to the bootloader. 1.5 sec seems to be the magic number + time.sleep(1.5) # Ensure that we are not talking to the bootloader. 1.5 seconds seems to be the magic number sucesfull_responses = 0 timeout_time = time.time() + 5 self._serial.write(b"\n") diff --git a/resources/definitions/bq_hephestos.def.json b/resources/definitions/bq_hephestos.def.json index 37eac85639..4c90ae9ecd 100644 --- a/resources/definitions/bq_hephestos.def.json +++ b/resources/definitions/bq_hephestos.def.json @@ -15,7 +15,7 @@ "overrides": { "machine_start_gcode": { - "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/s\n; -- end of START GCODE --" }, "machine_end_gcode": { "default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG1 Z10 ;move extruder up 10 mm\nG90 ;set to absolute positioning\nG1 X0 Y180 F1200 ;expose the platform\nM84 ;turn off steppers\n; -- end of END GCODE --" diff --git a/resources/definitions/bq_hephestos_xl.def.json b/resources/definitions/bq_hephestos_xl.def.json index 19b6d3e1b5..2b451627a9 100644 --- a/resources/definitions/bq_hephestos_xl.def.json +++ b/resources/definitions/bq_hephestos_xl.def.json @@ -16,7 +16,7 @@ "overrides": { "machine_start_gcode": { - "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/s\n; -- end of START GCODE --" }, "machine_end_gcode": { "default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG1 Z10 ;move extruder up 10 mm\nG90 ;set to absolute positioning\nG1 X0 Y180 F1200 ;expose the platform\nM84 ;turn off steppers\n; -- end of END GCODE --" diff --git a/resources/definitions/bq_witbox.def.json b/resources/definitions/bq_witbox.def.json index 4a7dc09c3a..b8d4cbf015 100644 --- a/resources/definitions/bq_witbox.def.json +++ b/resources/definitions/bq_witbox.def.json @@ -15,7 +15,7 @@ "overrides": { "machine_start_gcode": { - "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/sec\n; -- end of START GCODE --" + "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM106 S0 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG1 Z15.0 F1200 ;move Z to position 15.0 mm\nG92 E0 ;zero the extruded length\nG1 E20 F200 ;extrude 20mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F7200 ;set feedrate to 120 mm/s\n; -- end of START GCODE --" }, "machine_end_gcode": { "default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nG91 ;set to relative positioning\nG1 E-20 F300 ;retract the filament a bit to release some of the pressure\nG90 ;set to absolute positioning\nG1 Z200 ;move the platform to the bottom\nG28 X0 Y0 ;move to the X/Y origin (Home)\nM84 ;turn off steppers\n; -- end of END GCODE --" diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 9675c905e9..c5acbd49bb 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1802,7 +1802,7 @@ { "label": "Regular/Maximum Fan Speed Threshold", "description": "The layer time which sets the threshold between regular fan speed and maximum fan speed. Layers that print slower than this time use regular fan speed. For faster layers the fan speed gradually increases towards the maximum fan speed.", - "unit": "sec", + "unit": "s", "type": "float", "default_value": 10, "minimum_value": "cool_min_layer_time", @@ -1842,7 +1842,7 @@ { "label": "Minimum Layer Time", "description": "The minimum time spent in a layer. This forces the printer to slow down, to at least spend the time set here in one layer. This allows the printed material to cool down properly before printing the next layer.", - "unit": "sec", + "unit": "s", "type": "float", "default_value": 5, "minimum_value": "0", @@ -3395,7 +3395,7 @@ { "label": "WP Top Delay", "description": "Delay time after an upward move, so that the upward line can harden. Only applies to Wire Printing.", - "unit": "sec", + "unit": "s", "type": "float", "default_value": 0, "minimum_value": "0", @@ -3409,7 +3409,7 @@ { "label": "WP Bottom Delay", "description": "Delay time after a downward move. Only applies to Wire Printing.", - "unit": "sec", + "unit": "s", "type": "float", "default_value": 0, "minimum_value": "0", @@ -3423,7 +3423,7 @@ { "label": "WP Flat Delay", "description": "Delay time between two horizontal segments. Introducing such a delay can cause better adhesion to previous layers at the connection points, while too long delays cause sagging. Only applies to Wire Printing.", - "unit": "sec", + "unit": "s", "type": "float", "default_value": 0.1, "minimum_value": "0", @@ -3553,7 +3553,7 @@ "label": "WP Roof Outer Delay", "description": "Time spent at the outer perimeters of hole which is to become a roof. Longer times can ensure a better connection. Only applies to Wire Printing.", "type": "float", - "unit": "sec", + "unit": "s", "default_value": 0.2, "minimum_value": "0", "maximum_value_warning": "2.0", From 213e20bf4b9b6b8f417406994be8c2e15ceb9d93 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 16:55:10 +0200 Subject: [PATCH 4/6] Enable per object settings for objects inside a group CURA-1054 --- plugins/PerObjectSettingsTool/PerObjectSettingsTool.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py index cb7d1766d2..416d8cce6a 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py @@ -24,19 +24,12 @@ class PerObjectSettingsTool(Tool): return False def getSelectedObjectId(self): - try: - selected_object = Selection.getSelectedObject(0) - if selected_object.getParent().callDecoration("isGroup"): - selected_object = selected_object.getParent() - except: - selected_object = None + selected_object = Selection.getSelectedObject(0) selected_object_id = id(selected_object) return selected_object_id def getContainerID(self): selected_object = Selection.getSelectedObject(0) - if selected_object.getParent().callDecoration("isGroup"): - selected_object = selected_object.getParent() try: return selected_object.callDecoration("getStack").getId() except AttributeError: From 11b120a483e22d17ae50e74445c2491a8535280a Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 18:23:53 +0200 Subject: [PATCH 5/6] Redesign extruder selection widget Adds a colorswatch instead of coloring the whole widget (which looks like a warning state) CURA-340 --- .../PerObjectSettingsPanel.qml | 19 ++++++++++++++++--- resources/qml/Settings/SettingExtruder.qml | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 920196d447..aa4a749e92 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -61,7 +61,7 @@ Item { } else { - return extruders_model.getItem(extruderSelector.currentIndex).colour; + return UM.Theme.getColor("setting_control"); } } border.width: UM.Theme.getSize("default_lining").width @@ -69,9 +69,22 @@ Item { } label: Item { + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter + + color: extruders_model.getItem(extruderSelector.currentIndex).colour + border.width: UM.Theme.getSize("default_lining").width + border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") + } Label { - anchors.left: parent.left + anchors.left: swatch.right anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.right: downArrow.left anchors.rightMargin: UM.Theme.getSize("default_lining").width @@ -79,7 +92,7 @@ Item { text: extruderSelector.currentText font: UM.Theme.getFont("default") - color: UM.Theme.getColor("setting_control_disabled_text") + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") elide: Text.ElideRight verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 0160dab7fa..8acd75c88e 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -47,7 +47,7 @@ SettingItem } else { - return extruders_model.getItem(index).colour; + return UM.Theme.getColor("setting_control"); } } border.width: UM.Theme.getSize("default_lining").width @@ -55,9 +55,22 @@ SettingItem } label: Item { + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter + + color: extruders_model.getItem(control.currentIndex).colour + border.width: UM.Theme.getSize("default_lining").width + border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") + } Label { - anchors.left: parent.left + anchors.left: swatch.right anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.right: downArrow.left anchors.rightMargin: UM.Theme.getSize("default_lining").width @@ -65,7 +78,7 @@ SettingItem text: control.currentText font: UM.Theme.getFont("default") - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : extruders_model.getItem(index).colour + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") elide: Text.ElideRight verticalAlignment: Text.AlignVCenter From 8f86a19d6be013410de88bf5e05bd991e46071e4 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 13 Jun 2016 22:12:45 +0200 Subject: [PATCH 6/6] Fix bq_hephestos_xl.def.json to valid json --- resources/definitions/bq_hephestos_xl.def.json | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/definitions/bq_hephestos_xl.def.json b/resources/definitions/bq_hephestos_xl.def.json index 2b451627a9..867f5f37aa 100644 --- a/resources/definitions/bq_hephestos_xl.def.json +++ b/resources/definitions/bq_hephestos_xl.def.json @@ -11,7 +11,6 @@ "file_formats": "text/x-code", "platform": "bq_hephestos_platform.stl", "platform_offset": [ 0, -82, 0] - } }, "overrides": {