diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index b7f45cd6f3..7f7b992404 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -274,8 +274,8 @@ class CuraEngineBackend(Backend): # There is data and we're not slicing at the moment # if we are slicing, there is no need to re-calculate the data as it will be invalid in a moment. if self._stored_layer_data and not self._slicing: - job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data) - job.start() + self._process_layers_job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data) + self._process_layers_job.start() self._stored_layer_data = None else: self._layer_view_active = False diff --git a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py index 25530c52c2..df2e5966e9 100644 --- a/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py +++ b/plugins/CuraEngineBackend/ProcessSlicedObjectListJob.py @@ -95,6 +95,8 @@ class ProcessSlicedObjectListJob(Job): points = points.reshape((-1,2)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly. # Create a new 3D-array, copy the 2D points over and insert the right height. + # This uses manual array creation + copy rather than numpy.insert since this is + # faster. new_points = numpy.empty((len(points), 3), numpy.float32) new_points[:,0] = points[:,0] new_points[:,1] = layer.height diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py index 28677074cf..0a76a51742 100644 --- a/plugins/GCodeWriter/GCodeWriter.py +++ b/plugins/GCodeWriter/GCodeWriter.py @@ -6,6 +6,7 @@ from UM.Logger import Logger from UM.Application import Application import io import re #For escaping characters in the settings. +import copy class GCodeWriter(MeshWriter): @@ -56,17 +57,18 @@ class GCodeWriter(MeshWriter): def _serialiseProfile(self, profile): prefix = ";SETTING_" + str(GCodeWriter.version) + " " #The prefix to put before each line. prefix_length = len(prefix) - - serialised = profile.serialise() - + + #Serialise a deepcopy to remove the defaults from the profile + serialised = copy.deepcopy(profile).serialise() + #Escape characters that have a special meaning in g-code comments. pattern = re.compile("|".join(GCodeWriter.escape_characters.keys())) serialised = pattern.sub(lambda m: GCodeWriter.escape_characters[re.escape(m.group(0))], serialised) #Perform the replacement with a regular expression. - + #Introduce line breaks so that each comment is no longer than 80 characters. Prepend each line with the prefix. result = "" for pos in range(0, len(serialised), 80 - prefix_length): #Lines have 80 characters, so the payload of each line is 80 - prefix. result += prefix + serialised[pos : pos + 80 - prefix_length] + "\n" serialised = result - + return serialised \ No newline at end of file diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 385936391c..9f65a8e783 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -225,8 +225,8 @@ class _CreateTopLayersJob(Job): layer_data = None for node in DepthFirstIterator(self._scene.getRoot()): layer_data = node.callDecoration("getLayerData") - if not layer_data: - continue + if layer_data: + break if self._cancel or not layer_data: return diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index e8af832267..e1fc398da5 100644 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -8,12 +8,12 @@ import QtQuick.Controls.Styles 1.1 import UM 1.0 as UM -Item +Item { width: UM.Theme.getSize("button").width height: UM.Theme.getSize("slider_layerview_size").height - Slider + Slider { id: slider width: UM.Theme.getSize("slider_layerview_size").width @@ -34,11 +34,11 @@ Item Rectangle { - x: parent.width + UM.Theme.getSize("default_margin").width; + x: parent.width + UM.Theme.getSize("slider_layerview_background").width / 2; y: parent.height - (parent.value * parent.pixelsPerStep) - UM.Theme.getSize("slider_handle").height * 1.25; height: UM.Theme.getSize("slider_handle").height + UM.Theme.getSize("default_margin").height - width: valueLabel.width + (busyIndicator.visible ? busyIndicator.width : 0) + UM.Theme.getSize("default_margin").width + width: valueLabel.width + UM.Theme.getSize("default_margin").width Behavior on height { NumberAnimation { duration: 50; } } border.width: UM.Theme.getSize("default_lining").width; @@ -78,8 +78,8 @@ Item BusyIndicator { id: busyIndicator; - anchors.right: parent.right; - anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2; + anchors.left: parent.right; + anchors.leftMargin: UM.Theme.getSize("default_margin").width / 2; anchors.verticalCenter: parent.verticalCenter; width: UM.Theme.getSize("slider_handle").height; diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index bf3968329c..041ad160e2 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -25,7 +25,6 @@ Rectangle { property variant printDuration: PrintInformation.currentPrintTime; property real printMaterialAmount: PrintInformation.materialAmount; - width: UM.Theme.getSize("jobspecs").width height: childrenRect.height color: "transparent" @@ -119,19 +118,20 @@ Rectangle { } } - TextField + TextField { id: printJobTextfield anchors.right: printJobPencilIcon.left anchors.rightMargin: UM.Theme.getSize("default_margin").width/2 height: UM.Theme.getSize("jobspecs_line").height - width: base.width + width: __contentWidth + UM.Theme.getSize("default_margin").width + maximumLength: 120 property int unremovableSpacing: 5 text: '' horizontalAlignment: TextInput.AlignRight onTextChanged: { if(text != ''){ - //this prevent that is sets an empty string as jobname + //Prevent that jobname is set to an empty string Printer.setJobName(text) } } diff --git a/resources/qml/WizardPages/AddMachine.qml b/resources/qml/WizardPages/AddMachine.qml index d42a5675db..5a6a27c0a3 100644 --- a/resources/qml/WizardPages/AddMachine.qml +++ b/resources/qml/WizardPages/AddMachine.qml @@ -212,6 +212,7 @@ Item id: machineName; text: getMachineName() implicitWidth: UM.Theme.getSize("standard_list_input").width + maximumLength: 120 } } diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 60677870bc..1d0b385fc2 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -368,6 +368,7 @@ QtObject { width: Theme.getSize("slider_handle").width; height: Theme.getSize("slider_handle").height; color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle"); + radius: Theme.getSize("slider_handle").width/2; Behavior on color { ColorAnimation { duration: 50; } } } }