diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index e65756f181..cf75d75d5e 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -904,6 +904,7 @@ class BuildVolume(SceneNode): if not self._global_container_stack: return 0 container_stack = self._global_container_stack + used_extruders = ExtruderManager.getInstance().getUsedExtruderStacks() # If we are printing one at a time, we need to add the bed adhesion size to the disallowed areas of the objects if container_stack.getProperty("print_sequence", "value") == "one_at_a_time": @@ -914,24 +915,18 @@ class BuildVolume(SceneNode): skirt_distance = self._getSettingFromAdhesionExtruder("skirt_gap") skirt_line_count = self._getSettingFromAdhesionExtruder("skirt_line_count") bed_adhesion_size = skirt_distance + (skirt_line_count * self._getSettingFromAdhesionExtruder("skirt_brim_line_width")) * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 - if len(ExtruderManager.getInstance().getUsedExtruderStacks()) > 1: - adhesion_extruder_nr = int(self._global_container_stack.getProperty("adhesion_extruder_nr", "value")) - extruder_values = ExtruderManager.getInstance().getAllExtruderValues("skirt_brim_line_width") - line_width_factors = ExtruderManager.getInstance().getAllExtruderValues("initial_layer_line_width_factor") - del extruder_values[adhesion_extruder_nr] # Remove the value of the adhesion extruder nr. - del line_width_factors[adhesion_extruder_nr] - for i in range(min(len(extruder_values), len(line_width_factors))): - bed_adhesion_size += extruder_values[i] * line_width_factors[i] / 100.0 + if len(used_extruders) > 1: + for extruder_stack in used_extruders: + bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0 + #We don't create an additional line for the extruder we're printing the skirt with. + bed_adhesion_size -= self._getSettingFromAdhesionExtruder("skirt_brim_line_width", "value") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor", "value") / 100.0 elif adhesion_type == "brim": bed_adhesion_size = self._getSettingFromAdhesionExtruder("brim_line_count") * self._getSettingFromAdhesionExtruder("skirt_brim_line_width") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor") / 100.0 if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1: - adhesion_extruder_nr = int(self._global_container_stack.getProperty("adhesion_extruder_nr", "value")) - extruder_values = ExtruderManager.getInstance().getAllExtruderValues("skirt_brim_line_width") - line_width_factors = ExtruderManager.getInstance().getAllExtruderValues("initial_layer_line_width_factor") - del extruder_values[adhesion_extruder_nr] # Remove the value of the adhesion extruder nr. - del line_width_factors[adhesion_extruder_nr] - for i in range(min(len(extruder_values), len(line_width_factors))): - bed_adhesion_size += extruder_values[i] * line_width_factors[i] / 100.0 + for extruder_stack in used_extruders: + bed_adhesion_size += extruder_stack.getProperty("skirt_brim_line_width", "value") * extruder_stack.getProperty("initial_layer_line_width_factor", "value") / 100.0 + #We don't create an additional line for the extruder we're printing the brim with. + bed_adhesion_size -= self._getSettingFromAdhesionExtruder("skirt_brim_line_width", "value") * self._getSettingFromAdhesionExtruder("initial_layer_line_width_factor", "value") / 100.0 elif adhesion_type == "raft": bed_adhesion_size = self._getSettingFromAdhesionExtruder("raft_margin") elif adhesion_type == "none": @@ -951,7 +946,6 @@ class BuildVolume(SceneNode): move_from_wall_radius = 0 # Moves that start from outer wall. move_from_wall_radius = max(move_from_wall_radius, max(self._getSettingFromAllExtruders("infill_wipe_dist"))) - used_extruders = ExtruderManager.getInstance().getUsedExtruderStacks() avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts","value") for stack in used_extruders] travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders] for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): #For each extruder (or just global). diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index e23efc0f5a..bf013e4b9f 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -65,6 +65,11 @@ class PrinterOutputDevice(QObject, OutputDevice): self._monitor_view_qml_path = "" self._monitor_component = None self._monitor_item = None + + self._control_view_qml_path = "" + self._control_component = None + self._control_item = None + self._qml_context = None def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None): @@ -131,6 +136,29 @@ class PrinterOutputDevice(QObject, OutputDevice): return self._monitor_item + @pyqtProperty(QObject, constant=True) + def controlItem(self): + if not self._control_component: + self._createControlViewFromQML() + + return self._control_item + + def _createControlViewFromQML(self): + path = QUrl.fromLocalFile(self._control_view_qml_path) + + # Because of garbage collection we need to keep this referenced by python. + self._control_component = QQmlComponent(Application.getInstance()._engine, path) + + # Check if the context was already requested before (Printer output device might have multiple items in the future) + if self._qml_context is None: + self._qml_context = QQmlContext(Application.getInstance()._engine.rootContext()) + self._qml_context.setContextProperty("OutputDevice", self) + + self._control_item = self._control_component.create(self._qml_context) + if self._control_item is None: + Logger.log("e", "QQmlComponent status %s", self._control_component.status()) + Logger.log("e", "QQmlComponent error string %s", self._control_component.errorString()) + def _createMonitorViewFromQML(self): path = QUrl.fromLocalFile(self._monitor_view_qml_path) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 70f95caae5..e490d94c16 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -434,19 +434,39 @@ class ExtruderManager(QObject): extruder_stack_id = self.extruderIds["0"] used_extruder_stack_ids.add(extruder_stack_id) - #Get whether any of them use support. - per_mesh_stack = mesh.callDecoration("getStack") - if per_mesh_stack: - support_enabled |= per_mesh_stack.getProperty("support_enable", "value") - support_bottom_enabled |= per_mesh_stack.getProperty("support_bottom_enable", "value") - support_roof_enabled |= per_mesh_stack.getProperty("support_roof_enable", "value") - else: #Take the setting from the build extruder stack. - extruder_stack = container_registry.findContainerStacks(id = extruder_stack_id)[0] - support_enabled |= extruder_stack.getProperty("support_enable", "value") - support_bottom_enabled |= extruder_stack.getProperty("support_bottom_enable", "value") - support_roof_enabled |= extruder_stack.getProperty("support_roof_enable", "value") + # Get whether any of them use support. + stack_to_use = mesh.callDecoration("getStack") # if there is a per-mesh stack, we use it + if not stack_to_use: + # if there is no per-mesh stack, we use the build extruder for this mesh + stack_to_use = container_registry.findContainerStacks(id = extruder_stack_id)[0] - #The support extruders. + support_enabled |= stack_to_use.getProperty("support_enable", "value") + support_bottom_enabled |= stack_to_use.getProperty("support_bottom_enable", "value") + support_roof_enabled |= stack_to_use.getProperty("support_roof_enable", "value") + + # Check limit to extruders + limit_to_extruder_feature_list = ["wall_extruder_nr", + "wall_0_extruder_nr", + "wall_x_extruder_nr", + "top_bottom_extruder_nr", + "infill_extruder_nr", + ] + wall_extruder_nr = None + for extruder_nr_feature_name in limit_to_extruder_feature_list: + extruder_nr = int(global_stack.getProperty(extruder_nr_feature_name, "value")) + if extruder_nr == -1: + # outer and inner wall extruder numbers should first inherit from the wall extruder number + if extruder_nr_feature_name in ["wall_0_extruder_nr", "wall_x_extruder_nr"]: + extruder_nr = wall_extruder_nr + else: + extruder_nr = 0 + + used_extruder_stack_ids.add(self.extruderIds[str(extruder_nr)]) + + if extruder_nr_feature_name == "wall_extruder_nr": + wall_extruder_nr = extruder_nr + + # Check support extruders if support_enabled: used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_infill_extruder_nr", "value"))]) used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_extruder_nr_layer_0", "value"))]) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index aca3948813..e40a7c5479 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -254,12 +254,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): for index, container_id in enumerate(id_list): # take into account the old empty container IDs container_id = self._old_empty_profile_id_dict.get(container_id, container_id) - # HACK: there used to be 5, now we have one more 5 - definition changes - if len(id_list) == 6 and index == 5: - if global_stack.getContainer(5).getId() != "empty": - machine_conflict = True - break - index = 6 if global_stack.getContainer(index).getId() != container_id: machine_conflict = True break @@ -295,12 +289,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader): for index, container_id in enumerate(id_list): # take into account the old empty container IDs container_id = self._old_empty_profile_id_dict.get(container_id, container_id) - # HACK: there used to be 5, now we have one more 5 - definition changes - if len(id_list) == 6 and index == 5: - if existing_extruder_stack.getContainer(5).getId() != "empty": - machine_conflict = True - break - index = 6 if existing_extruder_stack.getContainer(index).getId() != container_id: machine_conflict = True break @@ -875,6 +863,12 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_list = container_string.split(",") container_ids = [container_id for container_id in container_list if container_id != ""] + # HACK: there used to be 6 containers numbering from 0 to 5 in a stack, + # now we have 7: index 5 becomes "definition_changes" + if len(container_ids) == 6: + # Hack; We used to not save the definition changes. Fix this. + container_ids.insert(5, "empty") + return container_ids def _getMachineNameFromSerializedStack(self, serialized): @@ -887,5 +881,3 @@ class ThreeMFWorkspaceReader(WorkspaceReader): metadata = data.iterfind("./um:metadata/um:name/um:label", {"um": "http://www.ultimaker.com/material"}) for entry in metadata: return entry.text - pass - diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index b309691e81..b14737a2a3 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -179,7 +179,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._compressing_print = False self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "MonitorItem.qml") - printer_type = self._properties.get(b"machine", b"").decode("utf-8") if printer_type.startswith("9511"): self._updatePrinterType("ultimaker3_extended") @@ -645,7 +644,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # Only check for mistakes if there is material length information. if print_information.materialLengths: - # Check if print cores / materials are loaded at all. Any failure in these results in an Error. + # Check if PrintCores / materials are loaded at all. Any failure in these results in an Error. for index in range(0, self._num_extruders): if index < len(print_information.materialLengths) and print_information.materialLengths[index] != 0: if self._json_printer_state["heads"][0]["extruders"][index]["hotend"]["id"] == "": @@ -677,7 +676,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): if variant: if variant.getName() != core_name: Logger.log("w", "Extruder %s has a different Cartridge (%s) as Cura (%s)", index + 1, core_name, variant.getName()) - warnings.append(i18n_catalog.i18nc("@label", "Different print core (Cura: {0}, Printer: {1}) selected for extruder {2}".format(variant.getName(), core_name, index + 1))) + warnings.append(i18n_catalog.i18nc("@label", "Different PrintCore (Cura: {0}, Printer: {1}) selected for extruder {2}".format(variant.getName(), core_name, index + 1))) material = extruder_manager.getExtruderStack(index).findContainer({"type": "material"}) if material: @@ -699,7 +698,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): is_offset_calibrated = True if not is_offset_calibrated: - warnings.append(i18n_catalog.i18nc("@label", "Print core {0} is not properly calibrated. XY calibration needs to be performed on the printer.").format(index + 1)) + warnings.append(i18n_catalog.i18nc("@label", "PrintCore {0} is not properly calibrated. XY calibration needs to be performed on the printer.").format(index + 1)) else: Logger.log("w", "There was no material usage found. No check to match used material with machine is done.") @@ -1176,7 +1175,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): i18n_catalog.i18nc("@label", "Would you like to use your current printer configuration in Cura?"), i18n_catalog.i18nc("@label", - "The print cores and/or materials on your printer differ from those within your current project. For the best result, always slice for the print cores and materials that are inserted in your printer."), + "The PrintCores and/or materials on your printer differ from those within your current project. For the best result, always slice for the PrintCores and materials that are inserted in your printer."), buttons=QMessageBox.Yes + QMessageBox.No, icon=QMessageBox.Question, callback=callback diff --git a/plugins/VersionUpgrade/VersionUpgrade26to27/__init__.py b/plugins/VersionUpgrade/VersionUpgrade26to27/__init__.py index b0c0d70ae2..c309142c8f 100644 --- a/plugins/VersionUpgrade/VersionUpgrade26to27/__init__.py +++ b/plugins/VersionUpgrade/VersionUpgrade26to27/__init__.py @@ -53,7 +53,7 @@ def getMetaData(): }, "definition_changes": { "get_version": upgrade.getCfgVersion, - "location": {"./machine_instances"} + "location": {"./definition_changes"} } } } diff --git a/resources/definitions/cartesio.def.json b/resources/definitions/cartesio.def.json index bbc62bdf75..e5253f3b75 100644 --- a/resources/definitions/cartesio.def.json +++ b/resources/definitions/cartesio.def.json @@ -48,8 +48,8 @@ "material_bed_temp_wait": { "default_value": false }, "prime_tower_enable": { "default_value": true }, "prime_tower_wall_thickness": { "resolve": 0.7 }, - "prime_tower_position_x": { "default_value": 50 }, - "prime_tower_position_y": { "default_value": 150 }, + "prime_tower_position_x": { "value": "50" }, + "prime_tower_position_y": { "value": "150" }, "prime_blob_enable": { "default_value": false }, "machine_max_feedrate_z": { "default_value": 20 }, "machine_disallowed_areas": { "default_value": [ diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 6f46d62c66..c5e4a8f98d 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4021,7 +4021,7 @@ "default_value": 20, "minimum_value": "0", "maximum_value_warning": "50 / skirt_brim_line_width", - "value": "math.ceil(brim_width / skirt_brim_line_width)", + "value": "math.ceil(brim_width / (skirt_brim_line_width * initial_layer_line_width_factor / 100.0))", "enabled": "resolveOrValue('adhesion_type') == 'brim'", "settable_per_mesh": false, "settable_per_extruder": true, @@ -4572,6 +4572,7 @@ "unit": "mm", "enabled": "resolveOrValue('prime_tower_enable')", "default_value": 200, + "value": "machine_width - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 - 1", "maximum_value": "machine_width / 2 if machine_center_is_zero else machine_width", "minimum_value": "resolveOrValue('prime_tower_size') - machine_width / 2 if machine_center_is_zero else resolveOrValue('prime_tower_size')", "settable_per_mesh": false, @@ -4585,6 +4586,7 @@ "unit": "mm", "enabled": "resolveOrValue('prime_tower_enable')", "default_value": 200, + "value": "machine_depth - prime_tower_size - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 - 1", "maximum_value": "machine_depth / 2 - resolveOrValue('prime_tower_size') if machine_center_is_zero else machine_depth - resolveOrValue('prime_tower_size')", "minimum_value": "machine_depth / -2 if machine_center_is_zero else 0", "settable_per_mesh": false, diff --git a/resources/definitions/makeit_pro_l.def.json b/resources/definitions/makeit_pro_l.def.json index 79dab33fc1..32f65d2b99 100644 --- a/resources/definitions/makeit_pro_l.def.json +++ b/resources/definitions/makeit_pro_l.def.json @@ -72,10 +72,10 @@ "enabled": true }, "prime_tower_position_x": { - "default_value": 185 + "value": "185" }, "prime_tower_position_y": { - "default_value": 160 + "value": "160" }, "material_diameter": { "default_value": 1.75 diff --git a/resources/definitions/makeit_pro_m.def.json b/resources/definitions/makeit_pro_m.def.json index 0d9dab7073..7cae1d12ae 100644 --- a/resources/definitions/makeit_pro_m.def.json +++ b/resources/definitions/makeit_pro_m.def.json @@ -72,10 +72,10 @@ "enabled": false }, "prime_tower_position_x": { - "default_value": 185 + "value": "185" }, "prime_tower_position_y": { - "default_value": 160 + "value": "160" }, "material_diameter": { "default_value": 1.75 diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 1cbd1fa363..06f0fe3a89 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -69,8 +69,7 @@ "extruder_prime_pos_abs": { "default_value": true }, "machine_start_gcode": { "default_value": "" }, "machine_end_gcode": { "default_value": "" }, - "prime_tower_position_x": { "default_value": 170 }, - "prime_tower_position_y": { "value": "machine_depth - prime_tower_size - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) - 1" }, + "prime_tower_position_x": { "value": "machine_depth - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) - 30" }, "prime_tower_wipe_enabled": { "default_value": false }, "prime_blob_enable": { "enabled": true }, diff --git a/resources/definitions/ultimaker_original_dual.def.json b/resources/definitions/ultimaker_original_dual.def.json index d133a3853f..e219a5ecb5 100644 --- a/resources/definitions/ultimaker_original_dual.def.json +++ b/resources/definitions/ultimaker_original_dual.def.json @@ -73,10 +73,10 @@ "default_value": 2 }, "prime_tower_position_x": { - "default_value": 195 + "value": "195" }, "prime_tower_position_y": { - "default_value": 149 + "value": "149" } } } diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 13d855d993..fa0ca087b7 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -157,19 +157,6 @@ Item { width: parent.width height: parent.height - UM.RecolorImage - { - id: timeIcon - anchors.right: timeSpecPerFeatureTooltipArea.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width/2 - anchors.verticalCenter: parent.verticalCenter - width: UM.Theme.getSize("save_button_specs_icons").width - height: UM.Theme.getSize("save_button_specs_icons").height - sourceSize.width: width - sourceSize.height: width - color: UM.Theme.getColor("text_subtext") - source: UM.Theme.getIcon("print_time") - } UM.TooltipArea { id: timeSpecPerFeatureTooltipArea @@ -205,10 +192,25 @@ Item { anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.verticalCenter: parent.verticalCenter + UM.RecolorImage + { + id: timeIcon + anchors.left: parent.left + anchors.top: parent.top + anchors.verticalCenter: parent.verticalCenter + width: UM.Theme.getSize("save_button_specs_icons").width + height: UM.Theme.getSize("save_button_specs_icons").height + sourceSize.width: width + sourceSize.height: width + color: UM.Theme.getColor("text_subtext") + source: UM.Theme.getIcon("print_time") + } + Text { id: timeSpec - anchors.left: parent.left + anchors.left: timeIcon.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width / 2 anchors.top: parent.top font: UM.Theme.getFont("small") color: UM.Theme.getColor("text_subtext") diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 915d320f41..86e146cb17 100755 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -78,6 +78,7 @@ Menu Dialog { id: multiplyDialog + modality: Qt.ApplicationModal title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index b57b56c292..db5f60862d 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -20,6 +20,7 @@ Rectangle // Is there an output device for this printer? property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands + property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null property int backendState: UM.Backend.state; property bool monitoringPrint: false @@ -344,12 +345,48 @@ Rectangle Loader { + id: controlItem anchors.bottom: footerSeparator.top anchors.top: headerSeparator.bottom anchors.left: base.left anchors.right: base.right - source: monitoringPrint ? "PrintMonitor.qml": "SidebarContents.qml" - } + sourceComponent: + { + if(monitoringPrint && connectedPrinter != null) + { + if(connectedPrinter.controlItem != null) + { + return connectedPrinter.controlItem + } + } + return null + } + } + + Loader + { + anchors.bottom: footerSeparator.top + anchors.top: headerSeparator.bottom + anchors.left: base.left + anchors.right: base.right + source: + { + if(controlItem.sourceComponent == null) + { + if(monitoringPrint) + { + return "PrintMonitor.qml" + } else + { + return "SidebarContents.qml" + } + } + else + { + return "" + } + } + } Rectangle {