Merge branch 'master' of github.com:Ultimaker/Cura into feature_send_extruder_settings

This commit is contained in:
Jaime van Kessel 2016-06-09 13:05:50 +02:00
commit 8ebc75e09a
5 changed files with 14 additions and 6 deletions

View file

@ -58,6 +58,9 @@ class ExtruderManager(QObject):
cls.__instance = ExtruderManager() cls.__instance = ExtruderManager()
return cls.__instance return cls.__instance
## Changes the active extruder by index.
#
# \param index The index of the new active extruder.
@pyqtSlot(int) @pyqtSlot(int)
def setActiveExtruderIndex(self, index): def setActiveExtruderIndex(self, index):
self._active_extruder_index = index self._active_extruder_index = index

View file

@ -54,10 +54,15 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
for index, extruder in enumerate(manager.getMachineExtruders(global_container_stack.getBottom().getId())): for index, extruder in enumerate(manager.getMachineExtruders(global_container_stack.getBottom().getId())):
material = extruder.findContainer({ "type": "material" }) material = extruder.findContainer({ "type": "material" })
colour = material.getMetaDataEntry("color_code", default = "#FFFF00") if material else "#FFFF00" colour = material.getMetaDataEntry("color_code", default = "#FFFF00") if material else "#FFFF00"
position = extruder.getBottom().getMetaDataEntry("position", default = "0") #Position in the definition.
try:
position = int(position)
except ValueError: #Not a proper int.
position = -1
item = { #Construct an item with only the relevant information. item = { #Construct an item with only the relevant information.
"name": extruder.getName(), "name": extruder.getName(),
"colour": colour, "colour": colour,
"index": index "index": position
} }
self.appendItem(item) self.appendItem(item)
self.sort(lambda item: item["index"]) self.sort(lambda item: item["index"])

View file

@ -1043,7 +1043,7 @@
"speed_wall_0": "speed_wall_0":
{ {
"label": "Outer Wall Speed", "label": "Outer Wall Speed",
"description": "The speed at which the outermost walls are printed. Printing the outer wall at a lower speed improves the final skin quality. However, having a large difference between the inner wall speed and the outer wall speed will effect quality in a negative way.", "description": "The speed at which the outermost walls are printed. Printing the outer wall at a lower speed improves the final skin quality. However, having a large difference between the inner wall speed and the outer wall speed will affect quality in a negative way.",
"unit": "mm/s", "unit": "mm/s",
"type": "float", "type": "float",
"minimum_value": "0.1", "minimum_value": "0.1",

View file

@ -49,8 +49,7 @@ UM.ManagementPage
onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id) onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id)
onAddObject: { onAddObject: {
var selectedContainer; var selectedContainer;
if (objectList.currentIndex == 0) { if (objectList.currentItem.id == Cura.MachineManager.activeQualityId) {
// Current settings
selectedContainer = Cura.MachineManager.convertUserContainerToQuality(); selectedContainer = Cura.MachineManager.convertUserContainerToQuality();
} else { } else {
selectedContainer = Cura.MachineManager.duplicateContainer(base.currentItem.id); selectedContainer = Cura.MachineManager.duplicateContainer(base.currentItem.id);

View file

@ -110,8 +110,9 @@ Item
checked: base.currentExtruderIndex == index checked: base.currentExtruderIndex == index
onClicked: onClicked:
{ {
base.currentExtruderIndex = index extruderSelection.focus = true; //Changing focus applies the currently-being-typed values so it can change the displayed setting values.
ExtruderManager.setActiveExtruderIndex(index) base.currentExtruderIndex = index;
ExtruderManager.setActiveExtruderIndex(index);
} }
style: ButtonStyle { style: ButtonStyle {