From 7fda5e9a398a99fd4b686f1b7b351322c58a9eac Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 19 Aug 2015 14:35:35 +0200 Subject: [PATCH] Endstop now stops listening upon destruction --- plugins/USBPrinting/PrinterConnection.py | 5 +++++ resources/qml/WizardPages/UltimakerCheckup.qml | 1 + 2 files changed, 6 insertions(+) diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index d79d2ef67d..9635b5f0b6 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -230,11 +230,16 @@ class PrinterConnection(OutputDevice, QObject, SignalEmitter): Logger.log("i", "Updating firmware of %s using %s", self._serial_port, file_name) self._firmware_file_name = file_name self._update_firmware_thread.start() + @pyqtSlot() def startPollEndstop(self): self._poll_endstop = True self._end_stop_thread.start() + @pyqtSLot() + def stopPollEndstop(self): + self._poll_endstop = False + def _pollEndStop(self): while self._is_connected and self._poll_endstop: self.sendCommand("M119") diff --git a/resources/qml/WizardPages/UltimakerCheckup.qml b/resources/qml/WizardPages/UltimakerCheckup.qml index 584f7436ba..acfe288e14 100644 --- a/resources/qml/WizardPages/UltimakerCheckup.qml +++ b/resources/qml/WizardPages/UltimakerCheckup.qml @@ -22,6 +22,7 @@ Column property variant printer_connection: UM.USBPrinterManager.connectedPrinterList.getItem(0).printer Component.onCompleted: printer_connection.startPollEndstop() + Component.onDestruction: printer_connection.stopPollEndstop() Label {