Use getApproximateMaterialDiameter instead of rounded getCompatibleMaterialDiameter

There was a function to round it for us already.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-09-17 16:41:32 +02:00
parent 37d54071f0
commit 5f4051ab5c
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -127,8 +127,8 @@ class BaseMaterialsModel(ListModel):
return return
nozzle_name = extruder_stack.variant.getName() nozzle_name = extruder_stack.variant.getName()
materials = ContainerTree.getInstance().machines[global_stack.definition.getId()].variants[nozzle_name].materials materials = ContainerTree.getInstance().machines[global_stack.definition.getId()].variants[nozzle_name].materials
compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter())) approximate_material_diameter = extruder_stack.getApproximateMaterialDiameter()
self._available_materials = {key: material for key, material in materials.items() if material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter} self._available_materials = {key: material for key, material in materials.items() if float(material.container.getMetaDataEntry("approximate_diameter")) == approximate_material_diameter}
## This method is used by all material models in the beginning of the ## This method is used by all material models in the beginning of the
# _update() method in order to prevent errors. It's the same in all models # _update() method in order to prevent errors. It's the same in all models