From 430bcc90a896fac4b0ae290c1a5f511139632336 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 23 Aug 2019 16:44:08 +0200 Subject: [PATCH] Make QualityChangesGroup depend on intent This is probably the main implementation of CURA-6600. --- cura/Machines/QualityChangesGroup.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/cura/Machines/QualityChangesGroup.py b/cura/Machines/QualityChangesGroup.py index 16e3e08c81..4881f70839 100644 --- a/cura/Machines/QualityChangesGroup.py +++ b/cura/Machines/QualityChangesGroup.py @@ -1,33 +1,12 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from typing import TYPE_CHECKING - -from UM.Application import Application -from UM.ConfigurationErrorMessage import ConfigurationErrorMessage - from .QualityGroup import QualityGroup -if TYPE_CHECKING: - from cura.Machines.QualityNode import QualityNode - - class QualityChangesGroup(QualityGroup): - def __init__(self, name: str, quality_type: str, parent = None) -> None: + def __init__(self, name: str, quality_type: str, intent_category: str, parent = None) -> None: super().__init__(name, quality_type, parent) - self._container_registry = Application.getInstance().getContainerRegistry() - - def addNode(self, node: "QualityNode") -> None: - extruder_position = node.container.getMetaDataEntry("position") - - if extruder_position is None and self.node_for_global is not None or extruder_position in self.nodes_for_extruders: #We would be overwriting another node. - ConfigurationErrorMessage.getInstance().addFaultyContainers(node.container_id) - return - - if extruder_position is None: # Then we're a global quality changes profile. - self.node_for_global = node - else: # This is an extruder's quality changes profile. - self.nodes_for_extruders[extruder_position] = node + self.intent_category = intent_category def __str__(self) -> str: return "%s[<%s>, available = %s]" % (self.__class__.__name__, self.name, self.is_available)