mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 00:36:25 +08:00
Merge branch 'master' into cura-1707
This commit is contained in:
commit
2936ad508c
@ -89,8 +89,12 @@ class PrintInformation(QObject):
|
|||||||
for index, amount in enumerate(material_amounts):
|
for index, amount in enumerate(material_amounts):
|
||||||
## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some
|
## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some
|
||||||
# list comprehension filtering to solve this for us.
|
# list comprehension filtering to solve this for us.
|
||||||
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0]
|
if extruder_stacks: # Multi extrusion machine
|
||||||
density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0)
|
extruder_stack = [extruder for extruder in extruder_stacks if extruder.getMetaDataEntry("position") == str(index)][0]
|
||||||
|
density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0)
|
||||||
|
else: # Machine with no extruder stacks
|
||||||
|
density = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("properties", {}).get("density", 0)
|
||||||
|
|
||||||
self._material_weights.append(float(amount) * float(density))
|
self._material_weights.append(float(amount) * float(density))
|
||||||
self._material_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
|
self._material_lengths.append(round((amount / (math.pi * r ** 2)) / 1000, 2))
|
||||||
self.materialLengthsChanged.emit()
|
self.materialLengthsChanged.emit()
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Copyright (c) 2016 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
|
|
||||||
|
@ -174,18 +174,19 @@ class StartSliceJob(Job):
|
|||||||
def _buildExtruderMessage(self, stack):
|
def _buildExtruderMessage(self, stack):
|
||||||
message = self._slice_message.addRepeatedMessage("extruders")
|
message = self._slice_message.addRepeatedMessage("extruders")
|
||||||
message.id = int(stack.getMetaDataEntry("position"))
|
message.id = int(stack.getMetaDataEntry("position"))
|
||||||
|
|
||||||
|
material_instance_container = stack.findContainer({"type": "material"})
|
||||||
|
|
||||||
for key in stack.getAllKeys():
|
for key in stack.getAllKeys():
|
||||||
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
||||||
setting.name = key
|
setting.name = key
|
||||||
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
|
if key == "material_guid" and material_instance_container:
|
||||||
|
# Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it.
|
||||||
|
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
|
||||||
|
else:
|
||||||
|
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
# ALso send the material GUID as a setting.
|
|
||||||
material_instance_container = stack.findContainer({"type": "material"})
|
|
||||||
if material_instance_container:
|
|
||||||
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
|
||||||
setting.name = "material_GUID"
|
|
||||||
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
|
|
||||||
## Sends all global settings to the engine.
|
## Sends all global settings to the engine.
|
||||||
#
|
#
|
||||||
# The settings are taken from the global stack. This does not include any
|
# The settings are taken from the global stack. This does not include any
|
||||||
|
@ -18,7 +18,11 @@ _printer_translations = {
|
|||||||
_profile_translations = {
|
_profile_translations = {
|
||||||
"PLA": "generic_pla",
|
"PLA": "generic_pla",
|
||||||
"ABS": "generic_abs",
|
"ABS": "generic_abs",
|
||||||
"CPE": "generic_cpe"
|
"CPE": "generic_cpe",
|
||||||
|
"Low Quality": "low",
|
||||||
|
"Normal Quality": "normal",
|
||||||
|
"High Quality": "high",
|
||||||
|
"Ulti Quality": "high" #This one doesn't have an equivalent. Map it to high.
|
||||||
}
|
}
|
||||||
|
|
||||||
## How to translate setting names from the old version to the new.
|
## How to translate setting names from the old version to the new.
|
||||||
|
@ -57,6 +57,14 @@
|
|||||||
"settable_per_extruder": false,
|
"settable_per_extruder": false,
|
||||||
"settable_per_meshgroup": false
|
"settable_per_meshgroup": false
|
||||||
},
|
},
|
||||||
|
"material_guid":
|
||||||
|
{
|
||||||
|
"label": "Material GUID",
|
||||||
|
"description": "GUID of the material. This is set automatically. ",
|
||||||
|
"default_value": "",
|
||||||
|
"type": "str",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
"material_bed_temp_wait":
|
"material_bed_temp_wait":
|
||||||
{
|
{
|
||||||
"label": "Wait for bed heatup",
|
"label": "Wait for bed heatup",
|
||||||
@ -984,6 +992,29 @@
|
|||||||
"value": "layer_height",
|
"value": "layer_height",
|
||||||
"settable_per_mesh": true
|
"settable_per_mesh": true
|
||||||
},
|
},
|
||||||
|
"gradual_infill_steps":
|
||||||
|
{
|
||||||
|
"label": "Gradual Infill Steps",
|
||||||
|
"description": "Number of times to reduce the infill density by half when getting further below top surfaces. Areas which are closer to top surfaces get a higher density, up to the Infill Density.",
|
||||||
|
"default_value": 0,
|
||||||
|
"type": "int",
|
||||||
|
"minimum_value": "0",
|
||||||
|
"maximum_value_warning": "4",
|
||||||
|
"maximum_value": "17",
|
||||||
|
"settable_per_mesh": true
|
||||||
|
},
|
||||||
|
"gradual_infill_step_height":
|
||||||
|
{
|
||||||
|
"label": "Gradual Infill Step Height",
|
||||||
|
"description": "The height of infill of a given density before switching to half the density.",
|
||||||
|
"unit": "mm",
|
||||||
|
"type": "float",
|
||||||
|
"default_value": 5.0,
|
||||||
|
"minimum_value": "0.0001",
|
||||||
|
"maximum_value_warning": "100",
|
||||||
|
"enabled": "gradual_infill_steps > 0",
|
||||||
|
"settable_per_mesh": true
|
||||||
|
},
|
||||||
"infill_before_walls":
|
"infill_before_walls":
|
||||||
{
|
{
|
||||||
"label": "Infill Before Walls",
|
"label": "Infill Before Walls",
|
||||||
|
@ -506,6 +506,75 @@ UM.MainWindow
|
|||||||
onTriggered: preferences.getCurrentItem().showProfileNameDialog()
|
onTriggered: preferences.getCurrentItem().showProfileNameDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BlurSettings is a way to force the focus away from any of the setting items.
|
||||||
|
// We need to do this in order to keep the bindings intact.
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: Cura.MachineManager
|
||||||
|
onBlurSettings:
|
||||||
|
{
|
||||||
|
contentItem.focus = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workaround for shortcuts not working for singletons.
|
||||||
|
// The main window eats all the events, so we need to pass them manually.
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Undo
|
||||||
|
onTriggered: Cura.Actions.undo.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Redo
|
||||||
|
onTriggered: Cura.Actions.redo.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Quit
|
||||||
|
onTriggered: Cura.Actions.quit.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Help
|
||||||
|
onTriggered: Cura.Actions.help.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Delete
|
||||||
|
onTriggered: Cura.Actions.delete.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: "Ctrl+G"
|
||||||
|
onTriggered: Cura.Actions.groupObjects.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: "Ctrl+Shift+G"
|
||||||
|
onTriggered: Cura.Actions.unGroupObjects.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: "Ctrl+Alt+G"
|
||||||
|
onTriggered: Cura.Actions.mergeObjects.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: "Ctrl+D"
|
||||||
|
onTriggered: Cura.Actions.deleteAll.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.Open
|
||||||
|
onTriggered: Cura.Actions.open.trigger()
|
||||||
|
}
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
shortcut: StandardKey.WhatsThis
|
||||||
|
onTriggered: Cura.Actions.showEngineLog.trigger()
|
||||||
|
}
|
||||||
|
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
id: objectContextMenu;
|
id: objectContextMenu;
|
||||||
|
@ -248,14 +248,5 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: Cura.MachineManager
|
|
||||||
onBlurSettings:
|
|
||||||
{
|
|
||||||
revertButton.focus = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user