From 74e7de1b54104b486350f8d5348369344e10dc13 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 3 Oct 2019 14:59:12 +0200 Subject: [PATCH 1/2] Add intent into stats CURA-6632 --- cura/Settings/GlobalStack.py | 8 ++++++++ cura/Settings/MachineManager.py | 8 +------- plugins/SliceInfoPlugin/SliceInfo.py | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index f2f6277e6a..17daaf205a 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -131,6 +131,14 @@ class GlobalStack(CuraContainerStack): return "machine_stack" return configuration_type + def getIntentCategory(self) -> str: + intent_category = "default" + for extruder in self.extruderList: + category = extruder.intent.getMetaDataEntry("intent_category", "default") + if category != "default" and category != intent_category: + intent_category = category + return intent_category + def getBuildplateName(self) -> Optional[str]: name = None if self.variant.getId() != "empty_variant": diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 57da690d6d..bdde5aee14 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -632,13 +632,7 @@ class MachineManager(QObject): if not global_container_stack: return "" - intent_category = "default" - for extruder in global_container_stack.extruderList: - category = extruder.intent.getMetaDataEntry("intent_category", "default") - if category != "default" and category != intent_category: - intent_category = category - - return intent_category + return global_container_stack.getIntentCategory() # Provies a list of extruder positions that have a different intent from the active one. @pyqtProperty("QStringList", notify=activeIntentChanged) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 9308719227..acab445fd6 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -174,6 +174,7 @@ class SliceInfo(QObject, Extension): extruder_dict["extruder_settings"] = extruder_settings data["extruders"].append(extruder_dict) + data["intent_category"] = global_stack.getIntentCategory() data["quality_profile"] = global_stack.quality.getMetaData().get("quality_type") data["user_modified_setting_keys"] = self._getUserModifiedSettingKeys() From 551c9fe682bc0de92fee2d0071fda4980804b67d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 3 Oct 2019 15:01:15 +0200 Subject: [PATCH 2/2] Update SliceInfo example CURA-6632 --- plugins/SliceInfoPlugin/example_data.html | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SliceInfoPlugin/example_data.html b/plugins/SliceInfoPlugin/example_data.html index 4294b0af6d..103eb55a6a 100644 --- a/plugins/SliceInfoPlugin/example_data.html +++ b/plugins/SliceInfoPlugin/example_data.html @@ -4,6 +4,7 @@ Operating System: Windows 10
Language: en_US
Machine Type: Ultimaker S5
+ Intent Profile: Default
Quality Profile: Fast
Using Custom Settings: No