mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Merge remote-tracking branch 'origin/3.5'
This commit is contained in:
commit
b97f4ea30c
5 changed files with 27 additions and 8 deletions
|
@ -115,17 +115,24 @@ class VariantManager:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Gets the default variant for the given machine definition.
|
# Gets the default variant for the given machine definition.
|
||||||
|
# If the optional GlobalStack is given, the metadata information will be fetched from the GlobalStack instead of
|
||||||
|
# the DefinitionContainer. Because for machines such as UM2, you can enable Olsson Block, which will set
|
||||||
|
# "has_variants" to True in the GlobalStack. In those cases, we need to fetch metadata from the GlobalStack or
|
||||||
|
# it may not be correct.
|
||||||
#
|
#
|
||||||
def getDefaultVariantNode(self, machine_definition: "DefinitionContainer",
|
def getDefaultVariantNode(self, machine_definition: "DefinitionContainer",
|
||||||
variant_type: VariantType) -> Optional["ContainerNode"]:
|
variant_type: "VariantType",
|
||||||
|
global_stack: Optional["GlobalStack"] = None) -> Optional["ContainerNode"]:
|
||||||
machine_definition_id = machine_definition.getId()
|
machine_definition_id = machine_definition.getId()
|
||||||
|
container_for_metadata_fetching = global_stack if global_stack is not None else machine_definition
|
||||||
|
|
||||||
preferred_variant_name = None
|
preferred_variant_name = None
|
||||||
if variant_type == VariantType.BUILD_PLATE:
|
if variant_type == VariantType.BUILD_PLATE:
|
||||||
if parseBool(machine_definition.getMetaDataEntry("has_variant_buildplates", False)):
|
if parseBool(container_for_metadata_fetching.getMetaDataEntry("has_variant_buildplates", False)):
|
||||||
preferred_variant_name = machine_definition.getMetaDataEntry("preferred_variant_buildplate_name")
|
preferred_variant_name = container_for_metadata_fetching.getMetaDataEntry("preferred_variant_buildplate_name")
|
||||||
else:
|
else:
|
||||||
if parseBool(machine_definition.getMetaDataEntry("has_variants", False)):
|
if parseBool(container_for_metadata_fetching.getMetaDataEntry("has_variants", False)):
|
||||||
preferred_variant_name = machine_definition.getMetaDataEntry("preferred_variant_name")
|
preferred_variant_name = container_for_metadata_fetching.getMetaDataEntry("preferred_variant_name")
|
||||||
|
|
||||||
node = None
|
node = None
|
||||||
if preferred_variant_name:
|
if preferred_variant_name:
|
||||||
|
|
|
@ -114,7 +114,8 @@ class CuraStackBuilder:
|
||||||
|
|
||||||
# get variant container for extruders
|
# get variant container for extruders
|
||||||
extruder_variant_container = application.empty_variant_container
|
extruder_variant_container = application.empty_variant_container
|
||||||
extruder_variant_node = variant_manager.getDefaultVariantNode(global_stack.definition, VariantType.NOZZLE)
|
extruder_variant_node = variant_manager.getDefaultVariantNode(global_stack.definition, VariantType.NOZZLE,
|
||||||
|
global_stack = global_stack)
|
||||||
extruder_variant_name = None
|
extruder_variant_name = None
|
||||||
if extruder_variant_node:
|
if extruder_variant_node:
|
||||||
extruder_variant_container = extruder_variant_node.getContainer()
|
extruder_variant_container = extruder_variant_node.getContainer()
|
||||||
|
|
|
@ -234,6 +234,11 @@ Item
|
||||||
UM.SimulationView.setCurrentLayer(value)
|
UM.SimulationView.setCurrentLayer(value)
|
||||||
|
|
||||||
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
||||||
|
// In case there is only one layer, the diff value results in a NaN, so this is for catching this specific case
|
||||||
|
if (isNaN(diff))
|
||||||
|
{
|
||||||
|
diff = 0
|
||||||
|
}
|
||||||
var newUpperYPosition = Math.round(diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
var newUpperYPosition = Math.round(diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
||||||
y = newUpperYPosition
|
y = newUpperYPosition
|
||||||
|
|
||||||
|
@ -339,6 +344,11 @@ Item
|
||||||
UM.SimulationView.setMinimumLayer(value)
|
UM.SimulationView.setMinimumLayer(value)
|
||||||
|
|
||||||
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
||||||
|
// In case there is only one layer, the diff value results in a NaN, so this is for catching this specific case
|
||||||
|
if (isNaN(diff))
|
||||||
|
{
|
||||||
|
diff = 0
|
||||||
|
}
|
||||||
var newLowerYPosition = Math.round((sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize) + diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
var newLowerYPosition = Math.round((sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize) + diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
||||||
y = newLowerYPosition
|
y = newLowerYPosition
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ class SimulationView(View):
|
||||||
|
|
||||||
self._old_max_layers = self._max_layers
|
self._old_max_layers = self._max_layers
|
||||||
## Recalculate num max layers
|
## Recalculate num max layers
|
||||||
new_max_layers = 0
|
new_max_layers = -1
|
||||||
for node in DepthFirstIterator(scene.getRoot()):
|
for node in DepthFirstIterator(scene.getRoot()):
|
||||||
layer_data = node.callDecoration("getLayerData")
|
layer_data = node.callDecoration("getLayerData")
|
||||||
if not layer_data:
|
if not layer_data:
|
||||||
|
@ -381,7 +381,7 @@ class SimulationView(View):
|
||||||
if new_max_layers < layer_count:
|
if new_max_layers < layer_count:
|
||||||
new_max_layers = layer_count
|
new_max_layers = layer_count
|
||||||
|
|
||||||
if new_max_layers > 0 and new_max_layers != self._old_max_layers:
|
if new_max_layers >= 0 and new_max_layers != self._old_max_layers:
|
||||||
self._max_layers = new_max_layers
|
self._max_layers = new_max_layers
|
||||||
|
|
||||||
# The qt slider has a bit of weird behavior that if the maxvalue needs to be changed first
|
# The qt slider has a bit of weird behavior that if the maxvalue needs to be changed first
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"platform_offset": [9, 0, 0],
|
"platform_offset": [9, 0, 0],
|
||||||
"has_materials": false,
|
"has_materials": false,
|
||||||
"has_machine_quality": true,
|
"has_machine_quality": true,
|
||||||
|
"preferred_variant_name": "0.4 mm",
|
||||||
"exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white"],
|
"exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white"],
|
||||||
"first_start_actions": ["UM2UpgradeSelection"],
|
"first_start_actions": ["UM2UpgradeSelection"],
|
||||||
"supported_actions":["UM2UpgradeSelection", "UpgradeFirmware"],
|
"supported_actions":["UM2UpgradeSelection", "UpgradeFirmware"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue