mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Fix typing of approximate diameter and add typing to function for it
Seems I forgot to add typing and that's biting my bum right now. Contributes to issue CURA-6600.
This commit is contained in:
parent
3952366798
commit
9297890d78
2 changed files with 2 additions and 2 deletions
|
@ -151,7 +151,7 @@ class MaterialManagementModel(QObject):
|
|||
# Find the preferred material.
|
||||
extruder_stack = application.getMachineManager().activeStack
|
||||
active_variant_name = extruder_stack.variant.getName()
|
||||
approximate_diameter = str(extruder_stack.approximateMaterialDiameter)
|
||||
approximate_diameter = int(extruder_stack.approximateMaterialDiameter)
|
||||
machine_node = ContainerTree.getInstance().machines[application.getGlobalContainerStack().definition.getId()]
|
||||
preferred_material_node = machine_node.variants[active_variant_name].preferredMaterial(approximate_diameter)
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class VariantNode(ContainerNode):
|
|||
# material.
|
||||
# \return The node for the preferred material, or any arbitrary material
|
||||
# if there is no match.
|
||||
def preferredMaterial(self, approximate_diameter) -> MaterialNode:
|
||||
def preferredMaterial(self, approximate_diameter: int) -> MaterialNode:
|
||||
for base_material, material_node in self.materials.items():
|
||||
if self.machine.preferred_material in base_material and approximate_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
|
||||
return material_node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue