From abf092512a039ad62839e14df5bebb8b0aa0ba80 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 16 Feb 2017 13:23:20 +0100 Subject: [PATCH] Don't show temperature if print core is removed in UM3 The empty string as hotend ID is interpreted as there being no hotend, since this is what the UM3 returns in that case. Contributes to issue CURA-3161. --- cura/PrinterOutputDevice.py | 6 +++++- resources/qml/PrintMonitor.qml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 21f03a11ea..7f0b7c4c07 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -418,10 +418,14 @@ class PrinterOutputDevice(QObject, OutputDevice): # /param index Index of the extruder # /param hotend_id id of the hotend def _setHotendId(self, index, hotend_id): - if hotend_id and hotend_id != "" and hotend_id != self._hotend_ids[index]: + if hotend_id and hotend_id != self._hotend_ids[index]: Logger.log("d", "Setting hotend id of hotend %d to %s" % (index, hotend_id)) self._hotend_ids[index] = hotend_id self.hotendIdChanged.emit(index, hotend_id) + elif not hotend_id: + Logger.log("d", "Removing hotend id of hotend %d.", index) + self._hotend_ids[index] = None + self.hotendIdChanged.emit(index, None) ## Let the user decide if the hotends and/or material should be synced with the printer # NB: the UX needs to be implemented by the plugin diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 16be06c95e..7274e8670d 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -96,7 +96,7 @@ Column } Label //Temperature indication. { - text: (connectedPrinter != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : "" + text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : "" color: UM.Theme.getColor("text") font: UM.Theme.getFont("large") anchors.right: parent.right