mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-22 04:29:01 +08:00
Implement defaultIntent
We keep this function in as a way of documentation. Contributes to issue CURA-6091.
This commit is contained in:
parent
2b775497b5
commit
744fbec38c
@ -95,20 +95,11 @@ class IntentManager:
|
|||||||
final_intent_categories |= self.intentCategories(current_definition_id, nozzle_name, material_id)
|
final_intent_categories |= self.intentCategories(current_definition_id, nozzle_name, material_id)
|
||||||
return list(final_intent_categories)
|
return list(final_intent_categories)
|
||||||
|
|
||||||
def defaultIntent(self) -> Tuple[str, str]:
|
## The intent that gets selected by default when no intent is available for
|
||||||
default_quality_type = QualityManager.getInstance().getDefaultQualityType().quality_type
|
# the configuration, an extruder can't match the intent that the user
|
||||||
for intent in self.currentAvailableIntents():
|
# selects, or just when creating a new printer.
|
||||||
if intent.getMetaDataEntry("intent_category") == "default" and intent.getMetaDataEntry("quality_type") == default_quality_type:
|
def defaultIntent(self) -> InstanceContainer:
|
||||||
return intent
|
return CuraApplication.getInstance().empty_intent_container
|
||||||
else: #Fallback: Preferred quality type is not available for default category.
|
|
||||||
for intent in self.currentAvailableIntents():
|
|
||||||
if intent.getMetaDataEntry("intent_category") == "default":
|
|
||||||
return intent
|
|
||||||
else: #Fallback: No default category.
|
|
||||||
if self.currentAvailableIntents():
|
|
||||||
return self.currentAvailableIntents()[0]
|
|
||||||
else:
|
|
||||||
return CuraApplication.empty_intent_container
|
|
||||||
|
|
||||||
def selectIntent(self, intent_category, quality_type):
|
def selectIntent(self, intent_category, quality_type):
|
||||||
for extruder in all_extruders:
|
for extruder in all_extruders:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user