diff options
-rw-r--r-- | cura/Machines/Models/GlobalStacksModel.py | 21 | ||||
-rw-r--r-- | resources/definitions/ultimaker2_plus_connect.def.json | 2 | ||||
-rw-r--r-- | resources/qml/Preferences/Materials/MaterialsSyncDialog.qml | 1 |
3 files changed, 22 insertions, 2 deletions
diff --git a/cura/Machines/Models/GlobalStacksModel.py b/cura/Machines/Models/GlobalStacksModel.py index 586bd11819..cc750f2244 100644 --- a/cura/Machines/Models/GlobalStacksModel.py +++ b/cura/Machines/Models/GlobalStacksModel.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import Qt, QTimer, pyqtProperty, pyqtSignal -from typing import Optional +from typing import List, Optional from UM.Qt.ListModel import ListModel from UM.i18n import i18nCatalog @@ -11,6 +11,7 @@ from UM.Util import parseBool from cura.PrinterOutput.PrinterOutputDevice import ConnectionType from cura.Settings.CuraContainerRegistry import CuraContainerRegistry from cura.Settings.GlobalStack import GlobalStack +from cura.UltimakerCloud.UltimakerCloudConstants import META_CAPABILITIES # To filter on the printer's capabilities. class GlobalStacksModel(ListModel): @@ -42,6 +43,7 @@ class GlobalStacksModel(ListModel): self._filter_connection_type = None # type: Optional[ConnectionType] self._filter_online_only = False + self._filter_capabilities: List[str] = [] # Required capabilities that all listed printers must have. # Listen to changes CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged) @@ -76,6 +78,19 @@ class GlobalStacksModel(ListModel): """ return self._filter_online_only + filterCapabilitiesChanged = pyqtSignal() + def setFilterCapabilities(self, new_filter: List[str]) -> None: + self._filter_capabilities = new_filter + + @pyqtProperty("QStringList", fset = setFilterCapabilities, notify = filterCapabilitiesChanged) + def filterCapabilities(self) -> List[str]: + """ + Capabilities to require on the list of printers. + + Only printers that have all of these capabilities will be shown in this model. + """ + return self._filter_capabilities + def _onContainerChanged(self, container) -> None: """Handler for container added/removed events from registry""" @@ -108,6 +123,10 @@ class GlobalStacksModel(ListModel): if self._filter_online_only and not is_online: continue + capabilities = set(container_stack.getMetaDataEntry(META_CAPABILITIES, set())) + if set(self._filter_capabilities) - capabilities: # Not all required capabilities are met. + continue + device_name = container_stack.getMetaDataEntry("group_name", container_stack.getName()) section_name = "Connected printers" if has_remote_connection else "Preset printers" section_name = self._catalog.i18nc("@info:title", section_name) diff --git a/resources/definitions/ultimaker2_plus_connect.def.json b/resources/definitions/ultimaker2_plus_connect.def.json index 1a4b68cf24..fd1f77d573 100644 --- a/resources/definitions/ultimaker2_plus_connect.def.json +++ b/resources/definitions/ultimaker2_plus_connect.def.json @@ -81,7 +81,7 @@ "material_bed_temperature_layer_0": { "maximum_value": 110 }, "material_print_temperature": { "maximum_value": 260 }, "meshfix_maximum_resolution": { "value": "(speed_wall_0 + speed_wall_x) / 60" }, - "meshfix_maximum_deviation": { "value": "layer_height / 4" }, + "meshfix_maximum_deviation": { "value": "layer_height / 4" }, "meshfix_maximum_travel_resolution": { "value": 0.5 }, "prime_blob_enable": { "enabled": true, "default_value": true, "value": "resolveOrValue('print_sequence') != 'one_at_a_time'" } } diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index d0cf9fafd6..9eaaa7bd6f 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -737,6 +737,7 @@ Window id: cloudPrinterList filterConnectionType: 3 //Only show cloud connections. filterOnlineOnly: true //Only show printers that are online. + filterCapabilities: ["import_materials"] //Only show printers that can receive the material profiles. } Cura.GlobalStacksModel { |