mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Merge remote-tracking branch 'origin/3.5'
This commit is contained in:
commit
6535f7890b
2 changed files with 22 additions and 2 deletions
|
@ -5,6 +5,7 @@ import json
|
|||
import os
|
||||
import platform
|
||||
import time
|
||||
from typing import cast, Optional, Set
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, QObject
|
||||
|
||||
|
@ -16,7 +17,7 @@ from UM.i18n import i18nCatalog
|
|||
from UM.Logger import Logger
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Qt.Duration import DurationFormat
|
||||
from typing import cast, Optional
|
||||
|
||||
from .SliceInfoJob import SliceInfoJob
|
||||
|
||||
|
||||
|
@ -95,13 +96,29 @@ class SliceInfo(QObject, Extension):
|
|||
def setSendSliceInfo(self, enabled: bool):
|
||||
Application.getInstance().getPreferences().setValue("info/send_slice_info", enabled)
|
||||
|
||||
def _getUserModifiedSettingKeys(self) -> list:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
application = cast(CuraApplication, Application.getInstance())
|
||||
machine_manager = application.getMachineManager()
|
||||
global_stack = machine_manager.activeMachine
|
||||
|
||||
user_modified_setting_keys = set() # type: Set[str]
|
||||
|
||||
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"):
|
||||
Logger.log("d", "'info/send_slice_info' is turned off.")
|
||||
return # Do nothing, user does not want to send data
|
||||
|
||||
application = Application.getInstance()
|
||||
from cura.CuraApplication import CuraApplication
|
||||
application = cast(CuraApplication, Application.getInstance())
|
||||
machine_manager = application.getMachineManager()
|
||||
print_information = application.getPrintInformation()
|
||||
|
||||
|
@ -164,6 +181,8 @@ class SliceInfo(QObject, Extension):
|
|||
|
||||
data["quality_profile"] = global_stack.quality.getMetaData().get("quality_type")
|
||||
|
||||
data["user_modified_setting_keys"] = self._getUserModifiedSettingKeys()
|
||||
|
||||
data["models"] = []
|
||||
# Listing all files placed on the build plate
|
||||
for node in DepthFirstIterator(application.getController().getScene().getRoot()):
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
}
|
||||
],
|
||||
"quality_profile": "fast",
|
||||
"user_modified_setting_keys": ["layer_height", "wall_line_width", "infill_sparse_density"],
|
||||
"models": [
|
||||
{
|
||||
"hash": "b72789b9beb5366dff20b1cf501020c3d4d4df7dc2295ecd0fddd0a6436df070",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue