Merge branch '2.1' of https://github.com/Ultimaker/Cura into 2.1

This commit is contained in:
Tim Kuipers 2016-03-03 11:58:47 +01:00
commit 7c8e08401b
8 changed files with 25 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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)
}
}

View File

@ -212,6 +212,7 @@ Item
id: machineName;
text: getMachineName()
implicitWidth: UM.Theme.getSize("standard_list_input").width
maximumLength: 120
}
}

View File

@ -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; } }
}
}