From bf96be3ab26eb720b6ce7e6ee563b35697a7047e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 14 Sep 2017 16:40:20 +0200 Subject: [PATCH 01/20] Improve titles for slice failure messages a bit The previous ones were very vague. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index ea1f8c39b4..62e3703a3f 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -278,7 +278,7 @@ class CuraEngineBackend(QObject, Backend): if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible: if Application.getInstance().platformActivity: self._error_message = Message(catalog.i18nc("@info:status", - "The selected material is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Material Details")) + "The selected material is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Incompatible material")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: @@ -306,7 +306,7 @@ class CuraEngineBackend(QObject, Backend): error_labels = ", ".join(error_labels) self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. The following settings have errors: {0}".format(error_labels)), - title = catalog.i18nc("@info:title", "Setting Details")) + title = catalog.i18nc("@info:title", "Invalid settings")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: From 4aa8d38bd3f7b6582d6fac72d29d71e6a88aa8c6 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 14 Sep 2017 17:06:26 +0200 Subject: [PATCH 02/20] CURA-4321 make sidebar a tad smaller --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index fb6e43d0be..9a6e6c19eb 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -295,7 +295,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [35.0, 10.0], + "sidebar": [32.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From a4ebedee830ca40d68ee4c89e0b9074fc0c6fd44 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 14 Sep 2017 17:40:44 +0200 Subject: [PATCH 03/20] CURA-4321 make print button blue when available, slight color changes on hover and pressed --- resources/qml/SaveButton.qml | 18 +++++++++--------- resources/themes/cura-light/theme.json | 8 ++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index 616017ebf6..2b7930793f 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -238,22 +238,22 @@ Item { if(!control.enabled) return UM.Theme.getColor("action_button_disabled_border"); else if(control.pressed) - return UM.Theme.getColor("action_button_active_border"); + return UM.Theme.getColor("print_button_ready_pressed_border"); else if(control.hovered) - return UM.Theme.getColor("action_button_hovered_border"); + return UM.Theme.getColor("print_button_ready_hovered_border"); else - return UM.Theme.getColor("action_button_border"); + return UM.Theme.getColor("print_button_ready_border"); } color: { if(!control.enabled) return UM.Theme.getColor("action_button_disabled"); else if(control.pressed) - return UM.Theme.getColor("action_button_active"); + return UM.Theme.getColor("print_button_ready_pressed"); else if(control.hovered) - return UM.Theme.getColor("action_button_hovered"); + return UM.Theme.getColor("print_button_ready_hovered"); else - return UM.Theme.getColor("action_button"); + return UM.Theme.getColor("print_button_ready"); } Behavior on color { ColorAnimation { duration: 50; } } @@ -268,11 +268,11 @@ Item { if(!control.enabled) return UM.Theme.getColor("action_button_disabled_text"); else if(control.pressed) - return UM.Theme.getColor("action_button_active_text"); + return UM.Theme.getColor("print_button_ready_text"); else if(control.hovered) - return UM.Theme.getColor("action_button_hovered_text"); + return UM.Theme.getColor("print_button_ready_text"); else - return UM.Theme.getColor("action_button_text"); + return UM.Theme.getColor("print_button_ready_text"); } font: UM.Theme.getFont("action_button") text: control.text; diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 9a6e6c19eb..92d51ae7d2 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -143,6 +143,14 @@ "action_button_disabled_text": [127, 127, 127, 255], "action_button_disabled_border": [245, 245, 245, 255], + "print_button_ready": [12, 169, 227, 255], + "print_button_ready_border": [12, 169, 227, 255], + "print_button_ready_text": [255, 255, 255, 255], + "print_button_ready_hovered": [12, 169, 255, 255], + "print_button_ready_hovered_border": [12, 169, 227, 255], + "print_button_ready_pressed": [12, 169, 220, 255], + "print_button_ready_pressed_border": [12, 169, 227, 255], + "scrollbar_background": [255, 255, 255, 255], "scrollbar_handle": [24, 41, 77, 255], "scrollbar_handle_hover": [12, 159, 227, 255], From 98ab5714831e0eb23682544ef38c3bef52887326 Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Thu, 14 Sep 2017 18:03:31 +0200 Subject: [PATCH 04/20] Removed 14bitVoid code accord to a new LGPL license CURA-4232 --- cura/BuildVolume.py | 4 +- cura/PrintInformation.py | 94 +++++++++++++------ .../CuraEngineBackend/CuraEngineBackend.py | 71 +++++++------- resources/qml/Sidebar.qml | 79 ++++++++-------- 4 files changed, 143 insertions(+), 105 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 1c9a0708fd..4e55528f5d 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -956,14 +956,14 @@ class BuildVolume(SceneNode): if adhesion_type == "skirt": skirt_distance = self._getSettingFromAdhesionExtruder("skirt_gap") skirt_line_count = self._getSettingFromAdhesionExtruder("skirt_line_count") - bed_adhesion_size = skirt_distance + (skirt_line_count * self._getSettingFromAdhesionExtruder("skirt_brim_line_width")) * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 + bed_adhesion_size = skirt_distance + (self._getSettingFromAdhesionExtruder("skirt_brim_line_width") * skirt_line_count) * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 if len(used_extruders) > 1: for extruder_stack in used_extruders: bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0 #We don't create an additional line for the extruder we're printing the skirt with. bed_adhesion_size -= self._getSettingFromAdhesionExtruder("skirt_brim_line_width", "value") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor", "value") / 100.0 elif adhesion_type == "brim": - bed_adhesion_size = self._getSettingFromAdhesionExtruder("brim_line_count") * self._getSettingFromAdhesionExtruder("skirt_brim_line_width") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 + bed_adhesion_size = self._getSettingFromAdhesionExtruder("skirt_brim_line_width") * self._getSettingFromAdhesionExtruder("brim_line_count") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1: for extruder_stack in used_extruders: bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0 diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 2b7a35995b..209d95d616 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty @@ -51,20 +51,7 @@ class PrintInformation(QObject): def __init__(self, parent = None): super().__init__(parent) - self._current_print_time = Duration(None, self) - self._print_times_per_feature = { - "none": Duration(None, self), - "inset_0": Duration(None, self), - "inset_x": Duration(None, self), - "skin": Duration(None, self), - "support": Duration(None, self), - "skirt": Duration(None, self), - "infill": Duration(None, self), - "support_infill": Duration(None, self), - "travel": Duration(None, self), - "retract": Duration(None, self), - "support_interface": Duration(None, self) - } + self.initializeCuraMessagePrintTimeProperties() self._material_lengths = [] self._material_weights = [] @@ -91,6 +78,33 @@ class PrintInformation(QObject): self._material_amounts = [] + + # Crate cura message translations and using translation keys initialize empty time Duration object for total time + # and time for each feature + def initializeCuraMessagePrintTimeProperties(self): + self._current_print_time = Duration(None, self) + + self._print_time_message_translations = { + "inset_0": catalog.i18nc("@tooltip", "Outer Wall"), + "inset_x": catalog.i18nc("@tooltip", "Inner Walls"), + "skin": catalog.i18nc("@tooltip", "Skin"), + "infill": catalog.i18nc("@tooltip", "Infill"), + "support_infill": catalog.i18nc("@tooltip", "Support Infill"), + "support_interface": catalog.i18nc("@tooltip", "Support Interface"), + "support": catalog.i18nc("@tooltip", "Support"), + "skirt": catalog.i18nc("@tooltip", "Skirt"), + "travel": catalog.i18nc("@tooltip", "Travel"), + "retract": catalog.i18nc("@tooltip", "Retractions"), + "none": catalog.i18nc("@tooltip", "Other") + } + + self._print_time_message_values = {} + + # Full fill message values using keys from _print_time_message_translations + for key in sorted(self._print_time_message_translations.keys()): + self._print_time_message_values[key] = Duration(None, self) + + currentPrintTimeChanged = pyqtSignal() preSlicedChanged = pyqtSignal() @@ -107,10 +121,6 @@ class PrintInformation(QObject): def currentPrintTime(self): return self._current_print_time - @pyqtProperty("QVariantMap", notify = currentPrintTimeChanged) - def printTimesPerFeature(self): - return self._print_times_per_feature - materialLengthsChanged = pyqtSignal() @pyqtProperty("QVariantList", notify = materialLengthsChanged) @@ -129,22 +139,28 @@ class PrintInformation(QObject): def materialCosts(self): return self._material_costs - def _onPrintDurationMessage(self, time_per_feature, material_amounts): - total_time = 0 - for feature, time in time_per_feature.items(): - if time != time: # Check for NaN. Engine can sometimes give us weird values. - self._print_times_per_feature[feature].setDuration(0) - Logger.log("w", "Received NaN for print duration message") - continue - total_time += time - self._print_times_per_feature[feature].setDuration(time) - self._current_print_time.setDuration(total_time) + def _onPrintDurationMessage(self, print_time, material_amounts): + self._updateTotalPrintTimePerFeature(print_time) self.currentPrintTimeChanged.emit() self._material_amounts = material_amounts self._calculateInformation() + def _updateTotalPrintTimePerFeature(self, print_time): + total_estimated_time = 0 + + for feature, time in print_time.items(): + if time != time: # Check for NaN. Engine can sometimes give us weird values. + self._print_time_message_values.get(feature).setDuration(0) + Logger.log("w", "Received NaN for print duration message") + continue + + total_estimated_time += time + self._print_time_message_values.get(feature).setDuration(time) + + self._current_print_time.setDuration(total_estimated_time) + def _calculateInformation(self): if Application.getInstance().getGlobalContainerStack() is None: return @@ -294,3 +310,23 @@ class PrintInformation(QObject): ## Utility method that strips accents from characters (eg: รข -> a) def _stripAccents(self, str): return ''.join(char for char in unicodedata.normalize('NFD', str) if unicodedata.category(char) != 'Mn') + + @pyqtSlot(result = "QVariantMap") + def getFeaturePrintTimes(self): + result = {} + for feature, time in self._print_time_message_values.items(): + if feature in self._print_time_message_translations: + result[self._print_time_message_translations[feature]] = time + else: + result[feature] = time + return result + + # Simulate message with zero time duration + def setToZeroPrintInformation(self): + temp_message = {} + for key in self._print_time_message_values.keys(): + temp_message[key] = 0 + + temp_material_amounts = [0] + self._onPrintDurationMessage(temp_message, temp_material_amounts) + diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index ea1f8c39b4..fc443daaa3 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Backend.Backend import Backend, BackendState @@ -196,19 +196,7 @@ class CuraEngineBackend(QObject, Backend): Logger.log("w", "Slice unnecessary, nothing has changed that needs reslicing.") return - self.printDurationMessage.emit({ - "none": 0, - "inset_0": 0, - "inset_x": 0, - "skin": 0, - "support": 0, - "skirt": 0, - "infill": 0, - "support_infill": 0, - "travel": 0, - "retract": 0, - "support_interface": 0 - }, [0]) + Application.getInstance().getPrintInformation().setToZeroPrintInformation() self._stored_layer_data = [] self._stored_optimized_layer_data = [] @@ -514,29 +502,6 @@ class CuraEngineBackend(QObject, Backend): def _onGCodePrefixMessage(self, message): self._scene.gcode_list.insert(0, message.data.decode("utf-8", "replace")) - ## Called when a print time message is received from the engine. - # - # \param message The protobuf message containing the print time per feature and - # material amount per extruder - def _onPrintTimeMaterialEstimates(self, message): - material_amounts = [] - for index in range(message.repeatedMessageCount("materialEstimates")): - material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount) - feature_times = { - "none": message.time_none, - "inset_0": message.time_inset_0, - "inset_x": message.time_inset_x, - "skin": message.time_skin, - "support": message.time_support, - "skirt": message.time_skirt, - "infill": message.time_infill, - "support_infill": message.time_support_infill, - "travel": message.time_travel, - "retract": message.time_retract, - "support_interface": message.time_support_interface - } - self.printDurationMessage.emit(feature_times, material_amounts) - ## Creates a new socket connection. def _createSocket(self): super()._createSocket(os.path.abspath(os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "Cura.proto"))) @@ -555,6 +520,38 @@ class CuraEngineBackend(QObject, Backend): else: self._change_timer.start() + ## Called when a print time message is received from the engine. + # + # \param message The protobuf message containing the print time per feature and + # material amount per extruder + def _onPrintTimeMaterialEstimates(self, message): + material_amounts = [] + for index in range(message.repeatedMessageCount("materialEstimates")): + material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount) + + times = self._parseMessagePrintTimes(message) + self.printDurationMessage.emit(times, material_amounts) + + ## Called for parsing message to retrieve estimated time per feature + # + # \param message The protobuf message containing the print time per feature + def _parseMessagePrintTimes(self, message): + + result = { + "inset_0": message.time_inset_0, + "inset_x": message.time_inset_x, + "skin": message.time_skin, + "infill": message.time_infill, + "support_infill": message.time_support_infill, + "support_interface": message.time_support_interface, + "support": message.time_support, + "skirt": message.time_skirt, + "travel": message.time_travel, + "retract": message.time_retract, + "none": message.time_none + } + return result + ## Called when the back-end connects to the front-end. def _onBackendConnected(self): if self._restart: diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index ba357f40a5..ba1a05b828 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -26,7 +26,6 @@ Rectangle property bool monitoringPrint: false property variant printDuration: PrintInformation.currentPrintTime - property variant printDurationPerFeature: PrintInformation.printTimesPerFeature property variant printMaterialLengths: PrintInformation.materialLengths property variant printMaterialWeights: PrintInformation.materialWeights property variant printMaterialCosts: PrintInformation.materialCosts @@ -388,54 +387,60 @@ Rectangle anchors.bottom: parent.bottom anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height - height: childrenRect.height + height: timeDetails.height + timeSpecDescription.height + lengthSpec.height visible: !monitoringPrint - UM.TooltipArea + Text { - id: timeSpecPerFeatureTooltipArea - width: timeSpec.width - height: timeSpec.height + id: timeDetails anchors.left: parent.left anchors.bottom: timeSpecDescription.top + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text_subtext") + text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) - text: { - var order = ["inset_0", "inset_x", "skin", "infill", "support_infill", "support_interface", "support", "travel", "retract", "none"]; - var visible_names = { - "inset_0": catalog.i18nc("@tooltip", "Outer Wall"), - "inset_x": catalog.i18nc("@tooltip", "Inner Walls"), - "skin": catalog.i18nc("@tooltip", "Skin"), - "infill": catalog.i18nc("@tooltip", "Infill"), - "support_infill": catalog.i18nc("@tooltip", "Support Infill"), - "support_interface": catalog.i18nc("@tooltip", "Support Interface"), - "support": catalog.i18nc("@tooltip", "Support"), - "travel": catalog.i18nc("@tooltip", "Travel"), - "retract": catalog.i18nc("@tooltip", "Retractions"), - "none": catalog.i18nc("@tooltip", "Other") - }; - var result = ""; - for(var feature in order) + MouseArea + { + id: infillMouseArea + anchors.fill: parent + hoverEnabled: true + //enabled: base.settingsEnabled + + onEntered: { - feature = order[feature]; - if(base.printDurationPerFeature[feature] && base.printDurationPerFeature[feature].totalSeconds > 0) + + if(base.printDuration.valid && !base.printDuration.isTotalDurationZero) { - result += "
" + visible_names[feature] + ": " + base.printDurationPerFeature[feature].getDisplayString(UM.DurationFormat.Short); + var print_time = PrintInformation.getFeaturePrintTimes() + + var valid_data = []; + for(var feature in print_time) + { + if(!print_time[feature].isTotalDurationZero) + { + valid_data.push(feature + ": " + print_time[feature].getDisplayString(UM.DurationFormat.Short)) + } + } + + var output = "" + for(var counter = 0; counter < valid_data.length; counter++) + { + output += valid_data[counter]; + if(counter + 1 != valid_data.length) + output += "\n" + } + + var content = catalog.i18nc("@tooltip",output) + base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content) } } - result = result.replace(/^\/, ""); // remove newline before first item - return result; - } - - Text - { - id: timeSpec - anchors.left: parent.left - anchors.bottom: parent.bottom - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text_subtext") - text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) + onExited: + { + base.hideTooltip(); + } } } + Text { id: timeSpecDescription From 0e1b9d8c5de573cc1dec0ed787421762cfbef5f3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 15 Sep 2017 10:46:01 +0200 Subject: [PATCH 05/20] Changed the way in which print times are shown in Sidebar - CURA-4232 --- resources/qml/Sidebar.qml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 6d417fa011..2db3bed7c4 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -337,27 +337,20 @@ Rectangle if(base.printDuration.valid && !base.printDuration.isTotalDurationZero) { + // All the time information for the different features is achieved var print_time = PrintInformation.getFeaturePrintTimes() - var valid_data = []; + // A message is created and displayed when the user hover the time label + var content = catalog.i18nc("@tooltip", "Time information") for(var feature in print_time) { if(!print_time[feature].isTotalDurationZero) { - valid_data.push(feature + ": " + print_time[feature].getDisplayString(UM.DurationFormat.Short)) + content += "
" + feature + ": " + print_time[feature].getDisplayString(UM.DurationFormat.Short) } } - var output = "" - for(var counter = 0; counter < valid_data.length; counter++) - { - output += valid_data[counter]; - if(counter + 1 != valid_data.length) - output += "\n" - } - - var content = catalog.i18nc("@tooltip",output) - base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content) + base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content) } } onExited: From e092b908a0a80b9816c6899e1b6dc47ec7f93755 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Sep 2017 11:06:20 +0200 Subject: [PATCH 06/20] Add message content for WriteRequestFailedErrors The content of the exception is directly put inside a message, so we should give the exception a message. --- .../RemovableDriveOutputDevice/RemovableDriveOutputDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index 4b6a6e8071..e9ee47e810 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -60,7 +60,7 @@ class RemovableDriveOutputDevice(OutputDevice): if len(file_formats) == 0: Logger.log("e", "There are no file formats available to write with!") - raise OutputDeviceError.WriteRequestFailedError() + raise OutputDeviceError.WriteRequestFailedError(catalog.i18nc("There are no file formats available to write with!")) # Just take the first file format available. if file_handler is not None: @@ -115,7 +115,7 @@ class RemovableDriveOutputDevice(OutputDevice): name = child.getName() if name: return name - raise OutputDeviceError.WriteRequestFailedError("Could not find a file name when trying to write to {device}.".format(device = self.getName())) + raise OutputDeviceError.WriteRequestFailedError(catalog.i18nc("@info:status Don't translate the tag {device}!", "Could not find a file name when trying to write to {device}.").format(device = self.getName())) def _onProgress(self, job, progress): self.writeProgress.emit(self, progress) From 83e5c5c0532b5aba6a2b8adc8a8f67e39cd9d2a0 Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Fri, 15 Sep 2017 13:27:09 +0200 Subject: [PATCH 07/20] Removed unused tags from cura-light theme.json CURA-4321 --- resources/themes/cura-light/theme.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 92d51ae7d2..98626d3d45 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -116,20 +116,6 @@ "sync_button_text": [120, 120, 120, 255], "sync_button_text_hovered": [0, 0, 0, 255], - "tab_checked": [255, 255, 255, 255], - "tab_checked_border": [255, 255, 255, 255], - "tab_checked_text": [24, 41, 77, 255], - "tab_unchecked": [245, 245, 245, 255], - "tab_unchecked_border": [245, 245, 245, 255], - "tab_unchecked_text": [127, 127, 127, 255], - "tab_hovered": [245, 245, 245, 255], - "tab_hovered_border": [245, 245, 245, 255], - "tab_hovered_text": [32, 166, 219, 255], - "tab_active": [255, 255, 255, 255], - "tab_active_border": [255, 255, 255, 255], - "tab_active_text": [24, 41, 77, 255], - "tab_background": [245, 245, 245, 255], - "action_button": [255, 255, 255, 255], "action_button_text": [0, 0, 0, 255], "action_button_border": [127, 127, 127, 255], From b39fece86a3919aff0872137ad0b8315e6f42ac5 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 15:53:20 +0200 Subject: [PATCH 08/20] Tweak sidbar size so text is not cut off CURA-4321 --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 98626d3d45..8cec4d1d03 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -289,7 +289,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [32.0, 10.0], + "sidebar": [34.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From 6484df3e60d194e0d31f7704865b552e50423591 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Sep 2017 16:01:02 +0200 Subject: [PATCH 09/20] Install to correct site-packages on non-Debian computers Because dist-packages is a Debian thing only. Contributes to issue CURA-3368. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7870759cd1..bea0092456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,15 @@ if(NOT APPLE AND NOT WIN32) DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE RENAME cura) - install(DIRECTORY cura + if(EXISTS /etc/debian_version) + install(DIRECTORY cura DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages FILES_MATCHING PATTERN *.py) + else() + install(DIRECTORY cura + DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura + FILES_MATCHING PATTERN *.py) + endif() install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages/cura) install(FILES ${CMAKE_BINARY_DIR}/cura.desktop From fa266969eb034a5e6a5a4895658540faa8de5948 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Sep 2017 16:03:07 +0200 Subject: [PATCH 10/20] Don't install to /cura subdirectory of site-packages That's already done by the directory name itself. Contributes to issue CURA-3368. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bea0092456..36c4a1b1ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ if(NOT APPLE AND NOT WIN32) FILES_MATCHING PATTERN *.py) else() install(DIRECTORY cura - DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura + DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages FILES_MATCHING PATTERN *.py) endif() install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py From e8691d29a7f45bd73dd22e0a8b3161fde7a1795d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Sep 2017 16:05:10 +0200 Subject: [PATCH 11/20] Install CuraVersion.py also to site-packages on non-Debian Similar to the rest of Cura. Contributes to issue CURA-3368. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c4a1b1ce..1c372ffa55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,13 +49,15 @@ if(NOT APPLE AND NOT WIN32) install(DIRECTORY cura DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages FILES_MATCHING PATTERN *.py) + install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py + DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages/cura) else() install(DIRECTORY cura DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages FILES_MATCHING PATTERN *.py) + install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py + DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura) endif() - install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py - DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages/cura) install(FILES ${CMAKE_BINARY_DIR}/cura.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png From f139bbe3f1cee2be091380dd855b932573f0d2e3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 15 Sep 2017 16:05:24 +0200 Subject: [PATCH 12/20] Fixed some missed references to the previous variables - CURA-4232 --- cura/PrintInformation.py | 2 +- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 209d95d616..155d0a6d02 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -101,7 +101,7 @@ class PrintInformation(QObject): self._print_time_message_values = {} # Full fill message values using keys from _print_time_message_translations - for key in sorted(self._print_time_message_translations.keys()): + for key in self._print_time_message_translations.keys(): self._print_time_message_values[key] = Duration(None, self) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 09373d0c2f..a4859f6d7f 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -162,7 +162,7 @@ class SliceInfo(Extension): data["models"].append(model) - print_times = print_information.printTimesPerFeature + print_times = print_information._print_time_message_values data["print_times"] = {"travel": int(print_times["travel"].getDisplayString(DurationFormat.Format.Seconds)), "support": int(print_times["support"].getDisplayString(DurationFormat.Format.Seconds)), "infill": int(print_times["infill"].getDisplayString(DurationFormat.Format.Seconds)), From 37869a8b14c4505ac4f7d3bf61f20532d09fbe7d Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Fri, 15 Sep 2017 16:36:00 +0200 Subject: [PATCH 13/20] Removed unused code. Shifted the last print quality number a bit to the left CURA-4182 --- resources/qml/SidebarSimple.qml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index bbfd8a424a..a219789c3c 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -349,23 +349,12 @@ Item } else if (i == total_tick_count - 1) { - start_x = current_start_x - offset * 2; + start_x = current_start_x - offset * 2.5; } ctx.fillText(resolutionSlider.model.getItem(i).layer_height_without_unit, start_x, text_top); current_start_x += step_size; } - - // print currently selected quality text - if (resolutionSlider.showQualityText && resolutionSlider.currentQualityIndex != undefine) - { - const text_top = parent.height / 2 + tick_height + tick_text_height * 2; - total_tick_count = resolutionSlider.totalTickCount; - const step_size = resolutionSlider.tickStepSize; - current_start_x = (tick_left_right_margin) + step_size * (resolutionSlider.currentQualityIndex - resolutionSlider.fullRangeMin); - ctx.fillStyle = UM.Theme.getColor("quality_slider_text"); - ctx.fillText(resolutionSlider.model.getItem(resolutionSlider.currentQualityIndex).name, current_start_x - 6, text_top); - } } MouseArea From 854c91550264b7d848564414a8731e7beb7f8604 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:48:49 +0200 Subject: [PATCH 14/20] Tweaked margins and cleanup CURA-4182 --- resources/qml/SidebarSimple.qml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index bbfd8a424a..c4edb8de92 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -44,10 +44,8 @@ Item { id: resolutionLabel anchors.top: resolutionSlider.top - anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.2 anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width - width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width text: catalog.i18nc("@label", "Layer Height") font: UM.Theme.getFont("default") @@ -57,10 +55,9 @@ Item Text { id: speedLabel - anchors.top: resolutionLabel.bottom + anchors.bottom: resolutionSlider.bottom anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width - anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.5 text: catalog.i18nc("@label", "Print Speed") font: UM.Theme.getFont("default") @@ -70,7 +67,7 @@ Item Text { id: speedLabelSlower - anchors.top: speedLabel.top + anchors.bottom: speedLabel.bottom anchors.left: resolutionSlider.left text: catalog.i18nc("@label", "Slower") @@ -82,7 +79,7 @@ Item Text { id: speedLabelFaster - anchors.top: speedLabel.top + anchors.bottom: speedLabel.bottom anchors.right: resolutionSlider.right text: catalog.i18nc("@label", "Faster") @@ -95,11 +92,11 @@ Item { id: resolutionSlider anchors.top: parent.top - anchors.left: infillCellRight.left anchors.right: infillCellRight.right + width: UM.Theme.getSize("sidebar").width * .55 - height: UM.Theme.getSize("quality_slider_bar").height * 30 + height: UM.Theme.getSize("quality_slider_bar").height * 20 property var model: Cura.ProfilesModel From 74c24652e9824a659a6b67eb331bf35b007def0b Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:50:48 +0200 Subject: [PATCH 15/20] Revert "Tweak sidbar size so text is not cut off" This reverts commit b39fece86a3919aff0872137ad0b8315e6f42ac5. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 8cec4d1d03..98626d3d45 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -289,7 +289,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [34.0, 10.0], + "sidebar": [32.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From 2502038f76623bf8a81b9441c5308d97dbf2150f Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:51:38 +0200 Subject: [PATCH 16/20] Revert "CURA-4321 make sidebar a tad smaller" This reverts commit 4aa8d38bd3f7b6582d6fac72d29d71e6a88aa8c6. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 98626d3d45..8624760e3a 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -289,7 +289,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [32.0, 10.0], + "sidebar": [35.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From 176fef8dbe5887d5091e8449c32fd2db9e755ac0 Mon Sep 17 00:00:00 2001 From: Taz8du29 <13140104+Taz8du29@users.noreply.github.com> Date: Sun, 17 Sep 2017 17:46:11 +0200 Subject: [PATCH 17/20] Minor formatting change in README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3fa497933..f8d809df16 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ Dependencies Configuring Cura ---------------- -* Link your CuraEngine backend by inserting the following line in home/.config/cura/config.cfg : +Link your CuraEngine backend by inserting the following lines in `$HOME/.config/cura/config.cfg` : +``` [backend] location = /[path_to_the..]/CuraEngine/build/CuraEngine +``` Build scripts ------------- From 86e5a1ed974b3e18dffd7fb5745d7afe96021705 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 09:39:08 +0200 Subject: [PATCH 18/20] CURA-4182 tweak slider height to fix text cut off --- resources/qml/SidebarSimple.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 20a00bca96..728501e5ef 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -96,7 +96,7 @@ Item anchors.right: infillCellRight.right width: UM.Theme.getSize("sidebar").width * .55 - height: UM.Theme.getSize("quality_slider_bar").height * 20 + height: UM.Theme.getSize("quality_slider_bar").height * 25 property var model: Cura.ProfilesModel From 4ca5987ca8fbf89cdf938c82dc6ff65e9ebc2942 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 10:50:52 +0200 Subject: [PATCH 19/20] 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 20/20] 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