mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-17 11:35:54 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
782dea040a
@ -45,7 +45,6 @@ Please checkout [cura-build](https://github.com/Ultimaker/cura-build)
|
|||||||
|
|
||||||
Third party plugins
|
Third party plugins
|
||||||
-------------
|
-------------
|
||||||
* [Print Cost Calculator](https://github.com/nallath/PrintCostCalculator): Calculates weight and monetary cost of your print.
|
|
||||||
* [Post Processing Plugin](https://github.com/nallath/PostProcessingPlugin): Allows for post-processing scripts to run on g-code.
|
* [Post Processing Plugin](https://github.com/nallath/PostProcessingPlugin): Allows for post-processing scripts to run on g-code.
|
||||||
* [Barbarian Plugin](https://github.com/nallath/BarbarianPlugin): Simple scale tool for imperial to metric.
|
* [Barbarian Plugin](https://github.com/nallath/BarbarianPlugin): Simple scale tool for imperial to metric.
|
||||||
* [X3G Writer](https://github.com/Ghostkeeper/X3GWriter): Adds support for exporting X3G files.
|
* [X3G Writer](https://github.com/Ghostkeeper/X3GWriter): Adds support for exporting X3G files.
|
||||||
|
@ -218,20 +218,25 @@ class ContainerManager(QObject):
|
|||||||
entries = entry_name.split("/")
|
entries = entry_name.split("/")
|
||||||
entry_name = entries.pop()
|
entry_name = entries.pop()
|
||||||
|
|
||||||
|
sub_item_changed = False
|
||||||
if entries:
|
if entries:
|
||||||
root_name = entries.pop(0)
|
root_name = entries.pop(0)
|
||||||
root = container.getMetaDataEntry(root_name)
|
root = container.getMetaDataEntry(root_name)
|
||||||
|
|
||||||
item = root
|
item = root
|
||||||
for entry in entries:
|
for _ in range(len(entries)):
|
||||||
item = item.get(entries.pop(0), { })
|
item = item.get(entries.pop(0), { })
|
||||||
|
|
||||||
|
if item[entry_name] != entry_value:
|
||||||
|
sub_item_changed = True
|
||||||
item[entry_name] = entry_value
|
item[entry_name] = entry_value
|
||||||
|
|
||||||
entry_name = root_name
|
entry_name = root_name
|
||||||
entry_value = root
|
entry_value = root
|
||||||
|
|
||||||
container.setMetaDataEntry(entry_name, entry_value)
|
container.setMetaDataEntry(entry_name, entry_value)
|
||||||
|
if sub_item_changed: #If it was only a sub-item that has changed then the setMetaDataEntry won't correctly notice that something changed, and we must manually signal that the metadata changed.
|
||||||
|
container.metaDataChanged.emit(container)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ class MaterialManager(QObject):
|
|||||||
if button == "Undo":
|
if button == "Undo":
|
||||||
container_manager = ContainerManager.getInstance()
|
container_manager = ContainerManager.getInstance()
|
||||||
container_manager.setContainerMetaDataEntry(self._material_diameter_warning_message.material_id, "properties/diameter", self._material_diameter_warning_message.previous_diameter)
|
container_manager.setContainerMetaDataEntry(self._material_diameter_warning_message.material_id, "properties/diameter", self._material_diameter_warning_message.previous_diameter)
|
||||||
|
approximate_previous_diameter = str(round(float(self._material_diameter_warning_message.previous_diameter)))
|
||||||
|
container_manager.setContainerMetaDataEntry(self._material_diameter_warning_message.material_id, "approximate_diameter", approximate_previous_diameter)
|
||||||
message.hide()
|
message.hide()
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "Unknown button action for material diameter warning message: {action}".format(action = button))
|
Logger.log("w", "Unknown button action for material diameter warning message: {action}".format(action = button))
|
@ -44,6 +44,14 @@ class GcodeStartEndFormatter(Formatter):
|
|||||||
|
|
||||||
## Job class that builds up the message of scene data to send to CuraEngine.
|
## Job class that builds up the message of scene data to send to CuraEngine.
|
||||||
class StartSliceJob(Job):
|
class StartSliceJob(Job):
|
||||||
|
## Meshes that are sent to the engine regardless of being outside of the
|
||||||
|
# build volume.
|
||||||
|
#
|
||||||
|
# If these settings are True for any mesh, the build volume is ignored.
|
||||||
|
# Note that Support Mesh is not in here because it actually generates
|
||||||
|
# g-code in the volume of the mesh.
|
||||||
|
_not_printed_mesh_settings = {"anti_overhang_mesh", "infill_mesh", "cutting_mesh"}
|
||||||
|
|
||||||
def __init__(self, slice_message):
|
def __init__(self, slice_message):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
@ -132,7 +140,8 @@ class StartSliceJob(Job):
|
|||||||
temp_list = []
|
temp_list = []
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
if type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
|
if type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
|
||||||
if not getattr(node, "_outside_buildarea", False):
|
if not getattr(node, "_outside_buildarea", False)\
|
||||||
|
or (node.callDecoration("getStack") and any(node.callDecoration("getStack").getProperty(setting, "value") for setting in self._not_printed_mesh_settings)):
|
||||||
temp_list.append(node)
|
temp_list.append(node)
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
|
@ -169,9 +169,11 @@ TabView
|
|||||||
// This does not use a SettingPropertyProvider, because we need to make the change to all containers
|
// This does not use a SettingPropertyProvider, because we need to make the change to all containers
|
||||||
// which derive from the same base_file
|
// which derive from the same base_file
|
||||||
var old_diameter = Cura.ContainerManager.getContainerProperty(base.containerId, "material_diameter", "value").toString();
|
var old_diameter = Cura.ContainerManager.getContainerProperty(base.containerId, "material_diameter", "value").toString();
|
||||||
base.setMetaDataEntry("approximate_diameter", properties.approximate_diameter, Math.round(value).toString());
|
var old_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter");
|
||||||
|
base.setMetaDataEntry("approximate_diameter", old_approximate_diameter, Math.round(value).toString());
|
||||||
base.setMetaDataEntry("properties/diameter", properties.diameter, value);
|
base.setMetaDataEntry("properties/diameter", properties.diameter, value);
|
||||||
if (Cura.MachineManager.filterMaterialsByMachine && properties.approximate_diameter != Cura.MachineManager.activeMachine.approximateMaterialDiameter)
|
var new_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter");
|
||||||
|
if (Cura.MachineManager.filterMaterialsByMachine && new_approximate_diameter != Cura.MachineManager.activeMachine.approximateMaterialDiameter)
|
||||||
{
|
{
|
||||||
Cura.MaterialManager.showMaterialWarningMessage(base.containerId, old_diameter);
|
Cura.MaterialManager.showMaterialWarningMessage(base.containerId, old_diameter);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ from UM.Settings.InstanceContainer import InstanceContainer #To test against the
|
|||||||
from UM.Settings.SettingInstance import InstanceState
|
from UM.Settings.SettingInstance import InstanceState
|
||||||
import UM.Settings.ContainerRegistry
|
import UM.Settings.ContainerRegistry
|
||||||
import UM.Settings.ContainerStack
|
import UM.Settings.ContainerStack
|
||||||
|
import UM.Settings.SettingDefinition #To add settings to the definition.
|
||||||
|
|
||||||
## Fake container registry that always provides all containers you ask of.
|
## Fake container registry that always provides all containers you ask of.
|
||||||
@pytest.yield_fixture()
|
@pytest.yield_fixture()
|
||||||
@ -96,11 +97,14 @@ def test_addExtruder(global_stack):
|
|||||||
#Exceptional cases.
|
#Exceptional cases.
|
||||||
(0, 0),
|
(0, 0),
|
||||||
(-10.1, -10),
|
(-10.1, -10),
|
||||||
(-1, -1)
|
(-1, -1),
|
||||||
|
(9000.1, 9000)
|
||||||
])
|
])
|
||||||
def test_approximateMaterialDiameter(diameter, approximate_diameter, global_stack):
|
def test_approximateMaterialDiameter(diameter, approximate_diameter, global_stack):
|
||||||
global_stack.definition = DefinitionContainer(container_id = "TestDefinition")
|
global_stack.definition = DefinitionContainer(container_id = "TestDefinition")
|
||||||
global_stack.definition._metadata["material_diameter"] = str(diameter)
|
material_diameter = UM.Settings.SettingDefinition.SettingDefinition(key = "material_diameter", container = global_stack.definition)
|
||||||
|
material_diameter.addSupportedProperty("value", UM.Settings.SettingDefinition.DefinitionPropertyType.Any, default = diameter)
|
||||||
|
global_stack.definition.definitions.append(material_diameter)
|
||||||
assert float(global_stack.approximateMaterialDiameter) == approximate_diameter
|
assert float(global_stack.approximateMaterialDiameter) == approximate_diameter
|
||||||
|
|
||||||
## Tests getting the material diameter when there is no material diameter.
|
## Tests getting the material diameter when there is no material diameter.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user