mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Merge branch 'master' into CURA-7022_Add_cloud_printer_within_add_a_connected_printer
This commit is contained in:
commit
b008f1e823
9 changed files with 36 additions and 20 deletions
|
@ -738,11 +738,15 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
|
||||
@staticmethod
|
||||
def _loadMetadata(file_name: str) -> Dict[str, Dict[str, Any]]:
|
||||
archive = zipfile.ZipFile(file_name, "r")
|
||||
result = dict() # type: Dict[str, Dict[str, Any]]
|
||||
try:
|
||||
archive = zipfile.ZipFile(file_name, "r")
|
||||
except zipfile.BadZipFile:
|
||||
Logger.logException("w", "Unable to retrieve metadata from {fname}: 3MF archive is corrupt.".format(fname = file_name))
|
||||
return result
|
||||
|
||||
metadata_files = [name for name in archive.namelist() if name.endswith("plugin_metadata.json")]
|
||||
|
||||
result = dict()
|
||||
|
||||
for metadata_file in metadata_files:
|
||||
try:
|
||||
|
|
|
@ -86,7 +86,7 @@ class ModelChecker(QObject, Extension):
|
|||
|
||||
if material_shrinkage[node_extruder_position] > shrinkage_threshold:
|
||||
bbox = node.getBoundingBox()
|
||||
if bbox.width >= warning_size_xy or bbox.depth >= warning_size_xy or bbox.height >= warning_size_z:
|
||||
if bbox is not None and (bbox.width >= warning_size_xy or bbox.depth >= warning_size_xy or bbox.height >= warning_size_z):
|
||||
warning_nodes.append(node)
|
||||
|
||||
self._caution_message.setText(catalog.i18nc(
|
||||
|
|
|
@ -149,6 +149,7 @@ class SolidView(View):
|
|||
theme = Application.getInstance().getTheme()
|
||||
self._xray_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_flat_error_color_mix", 0.) # Don't show flat error color in solid-view.
|
||||
|
||||
renderer = self.getRenderer()
|
||||
if not self._composite_pass or not 'xray' in self._composite_pass.getLayerBindings():
|
||||
|
|
|
@ -232,11 +232,11 @@ class CloudOutputDeviceManager:
|
|||
return
|
||||
new_machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
|
||||
|
||||
self._setOutputDeviceMetadata(device, new_machine)
|
||||
|
||||
if activate:
|
||||
CuraApplication.getInstance().getMachineManager().setActiveMachine(new_machine.getId())
|
||||
|
||||
self._connectToOutputDevice(device, new_machine)
|
||||
|
||||
def _connectToActiveMachine(self) -> None:
|
||||
"""Callback for when the active machine was changed by the user"""
|
||||
|
||||
|
@ -258,14 +258,17 @@ class CloudOutputDeviceManager:
|
|||
# Remove device if it is not meant for the active machine.
|
||||
output_device_manager.removeOutputDevice(device.key)
|
||||
|
||||
def _connectToOutputDevice(self, device: CloudOutputDevice, machine: GlobalStack) -> None:
|
||||
"""Connects to an output device and makes sure it is registered in the output device manager."""
|
||||
|
||||
def _setOutputDeviceMetadata(self, device: CloudOutputDevice, machine: GlobalStack):
|
||||
machine.setName(device.name)
|
||||
machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
|
||||
machine.setMetaDataEntry("group_name", device.name)
|
||||
machine.addConfiguredConnectionType(device.connectionType.value)
|
||||
|
||||
def _connectToOutputDevice(self, device: CloudOutputDevice, machine: GlobalStack) -> None:
|
||||
"""Connects to an output device and makes sure it is registered in the output device manager."""
|
||||
|
||||
self._setOutputDeviceMetadata(device, machine)
|
||||
|
||||
if not device.isConnected():
|
||||
device.connect()
|
||||
|
||||
|
|
|
@ -125,7 +125,10 @@ class ToolPathUploader:
|
|||
if self._retries < self.MAX_RETRIES and status_code in self.RETRY_HTTP_CODES:
|
||||
self._retries += 1
|
||||
Logger.log("i", "Retrying %s/%s request %s", self._retries, self.MAX_RETRIES, reply.url().toString())
|
||||
self._uploadChunk()
|
||||
try:
|
||||
self._uploadChunk()
|
||||
except ValueError: # Asynchronously it could have completed in the meanwhile.
|
||||
pass
|
||||
return
|
||||
|
||||
# Http codes that are not to be retried are assumed to be errors.
|
||||
|
|
|
@ -29,11 +29,12 @@ class VersionUpgrade45to46(VersionUpgrade):
|
|||
parser["metadata"]["setting_version"] = "12"
|
||||
|
||||
# Remove deleted settings from the visible settings list.
|
||||
visible_settings = set(parser["general"]["visible_settings"].split(";"))
|
||||
for removed in _removed_settings:
|
||||
if removed in visible_settings:
|
||||
visible_settings.remove(removed)
|
||||
parser["general"]["visible_settings"] = ";".join(visible_settings)
|
||||
if "general" in parser and "visible_settings" in parser["general"]:
|
||||
visible_settings = set(parser["general"]["visible_settings"].split(";"))
|
||||
for removed in _removed_settings:
|
||||
if removed in visible_settings:
|
||||
visible_settings.remove(removed)
|
||||
parser["general"]["visible_settings"] = ";".join(visible_settings)
|
||||
|
||||
result = io.StringIO()
|
||||
parser.write(result)
|
||||
|
|
|
@ -93,6 +93,7 @@ class XRayView(CuraView):
|
|||
theme = Application.getInstance().getTheme()
|
||||
self._xray_composite_shader.setUniformValue("u_background_color", Color(*theme.getColor("viewport_background").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_outline_color", Color(*theme.getColor("model_selection_outline").getRgb()))
|
||||
self._xray_composite_shader.setUniformValue("u_flat_error_color_mix", 1.) # Show flat error color _only_ in xray-view.
|
||||
|
||||
if not self._composite_pass:
|
||||
self._composite_pass = self.getRenderer().getRenderPass("composite")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue