diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-08-24 12:24:43 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-08-27 14:46:58 +0300 |
commit | 1dd0d794df8c2578781c6755d2c79f8555fea0aa (patch) | |
tree | ef3892f1e75f7ce320f3fd197b6b84af35e51f81 /plugins/SliceInfoPlugin | |
parent | 22ccf074f3b8529bbb541d1da20ca39ff7d9d572 (diff) |
Collect user modified settings
- Collect user modified settings in user_changes and quality_changes
- Update example data
Diffstat (limited to 'plugins/SliceInfoPlugin')
-rwxr-xr-x | plugins/SliceInfoPlugin/SliceInfo.py | 16 | ||||
-rw-r--r-- | plugins/SliceInfoPlugin/example_data.json | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 2e9e557c4a..48c1d2ab20 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -95,6 +95,20 @@ class SliceInfo(QObject, Extension): def setSendSliceInfo(self, enabled: bool): Application.getInstance().getPreferences().setValue("info/send_slice_info", enabled) + def _getUserModifiedSettingKeys(self) -> list: + application = Application.getInstance() + machine_manager = application.getMachineManager() + global_stack = machine_manager.activeMachine + + user_modified_setting_keys = set() + + for stack in [global_stack] + list(global_stack.extruders.values()): + # Get all settings in user_changes and quality_changes + all_keys = stack.userChanges.getAllKeys() | stack.qualityChanges.getAllKeys() + user_modified_setting_keys |= all_keys + + return list(sorted(user_modified_setting_keys)) + def _onWriteStarted(self, output_device): try: if not Application.getInstance().getPreferences().getValue("info/send_slice_info"): @@ -164,6 +178,8 @@ class SliceInfo(QObject, Extension): data["quality_profile"] = global_stack.quality.getMetaData().get("quality_type") + data["user_modified_setting_keys"] = ",".join(self._getUserModifiedSettingKeys()) + data["models"] = [] # Listing all files placed on the build plate for node in DepthFirstIterator(application.getController().getScene().getRoot()): diff --git a/plugins/SliceInfoPlugin/example_data.json b/plugins/SliceInfoPlugin/example_data.json index ec953e0842..3f0a9fb388 100644 --- a/plugins/SliceInfoPlugin/example_data.json +++ b/plugins/SliceInfoPlugin/example_data.json @@ -56,6 +56,7 @@ } ], "quality_profile": "fast", + "user_modified_setting_keys": "layer_height,wall_line_width,infill_sparse_density", "models": [ { "hash": "b72789b9beb5366dff20b1cf501020c3d4d4df7dc2295ecd0fddd0a6436df070", |