mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 10:09:02 +08:00
Merge remote-tracking branch 'origin/3.5'
This commit is contained in:
commit
6535f7890b
@ -5,6 +5,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import time
|
import time
|
||||||
|
from typing import cast, Optional, Set
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QObject
|
from PyQt5.QtCore import pyqtSlot, QObject
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ from UM.i18n import i18nCatalog
|
|||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.Qt.Duration import DurationFormat
|
from UM.Qt.Duration import DurationFormat
|
||||||
from typing import cast, Optional
|
|
||||||
from .SliceInfoJob import SliceInfoJob
|
from .SliceInfoJob import SliceInfoJob
|
||||||
|
|
||||||
|
|
||||||
@ -95,13 +96,29 @@ class SliceInfo(QObject, Extension):
|
|||||||
def setSendSliceInfo(self, enabled: bool):
|
def setSendSliceInfo(self, enabled: bool):
|
||||||
Application.getInstance().getPreferences().setValue("info/send_slice_info", enabled)
|
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):
|
def _onWriteStarted(self, output_device):
|
||||||
try:
|
try:
|
||||||
if not Application.getInstance().getPreferences().getValue("info/send_slice_info"):
|
if not Application.getInstance().getPreferences().getValue("info/send_slice_info"):
|
||||||
Logger.log("d", "'info/send_slice_info' is turned off.")
|
Logger.log("d", "'info/send_slice_info' is turned off.")
|
||||||
return # Do nothing, user does not want to send data
|
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()
|
machine_manager = application.getMachineManager()
|
||||||
print_information = application.getPrintInformation()
|
print_information = application.getPrintInformation()
|
||||||
|
|
||||||
@ -164,6 +181,8 @@ class SliceInfo(QObject, Extension):
|
|||||||
|
|
||||||
data["quality_profile"] = global_stack.quality.getMetaData().get("quality_type")
|
data["quality_profile"] = global_stack.quality.getMetaData().get("quality_type")
|
||||||
|
|
||||||
|
data["user_modified_setting_keys"] = self._getUserModifiedSettingKeys()
|
||||||
|
|
||||||
data["models"] = []
|
data["models"] = []
|
||||||
# Listing all files placed on the build plate
|
# Listing all files placed on the build plate
|
||||||
for node in DepthFirstIterator(application.getController().getScene().getRoot()):
|
for node in DepthFirstIterator(application.getController().getScene().getRoot()):
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quality_profile": "fast",
|
"quality_profile": "fast",
|
||||||
|
"user_modified_setting_keys": ["layer_height", "wall_line_width", "infill_sparse_density"],
|
||||||
"models": [
|
"models": [
|
||||||
{
|
{
|
||||||
"hash": "b72789b9beb5366dff20b1cf501020c3d4d4df7dc2295ecd0fddd0a6436df070",
|
"hash": "b72789b9beb5366dff20b1cf501020c3d4d4df7dc2295ecd0fddd0a6436df070",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user