From 99f42c179f856b4b1f7bff48c65236ef83fe2b20 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 8 Oct 2020 17:18:24 +0200 Subject: [PATCH] Remove hardcoded value for num extruders CURA-7745 --- .../resources/qml/MonitorPrinterCard.qml | 3 +-- .../src/Models/Http/ClusterPrinterStatus.py | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 6416558fe7..59cdeef174 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -194,8 +194,7 @@ Item var configs = [] if (printer) { - configs.push(printer.printerConfiguration.extruderConfigurations[0]) - configs.push(printer.printerConfiguration.extruderConfigurations[1]) + configs = configs.concat(printer.printerConfiguration.extruderConfigurations) } else { diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py index 5b4d7fb161..b5fae5d9c7 100644 --- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py +++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py @@ -71,12 +71,7 @@ class ClusterPrinterStatus(BaseModel): :param controller: - The controller of the model. """ - - # FIXME - # Note that we're using '2' here as extruder count. We have hardcoded this for now to prevent issues where the - # amount of extruders coming back from the API is actually lower (which it can be if a printer was just added - # to a cluster). This should be fixed in the future, probably also on the cluster API side. - model = PrinterOutputModel(controller, 2, firmware_version = self.firmware_version) + model = PrinterOutputModel(controller, len(self.configuration), firmware_version = self.firmware_version) self.updateOutputModel(model) return model