From b4e0007d4ab890312335a8bd26f7550a76cfc344 Mon Sep 17 00:00:00 2001 From: nickthetait Date: Mon, 22 Jun 2015 11:06:22 -0600 Subject: [PATCH] Cooldown toolhead and bed whenever print is canceled (including closing print window). Fixes #118 --- Cura/gui/printWindow.py | 1 + Cura/util/printerConnection/serialConnection.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index d0a8337a..bce405ad 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -259,6 +259,7 @@ class printWindowPlugin(wx.Frame): self._printerConnection.removeCallback(self._doPrinterConnectionUpdate) #TODO: When multiple printer windows are open, closing one will enable sleeping again. preventComputerFromSleeping(self, False) + self._printerConnection.coolDown() self.Destroy() def OnTermEnterLine(self, e): diff --git a/Cura/util/printerConnection/serialConnection.py b/Cura/util/printerConnection/serialConnection.py index 488507b1..2279fd38 100644 --- a/Cura/util/printerConnection/serialConnection.py +++ b/Cura/util/printerConnection/serialConnection.py @@ -95,12 +95,22 @@ class serialConnection(printerConnectionBase.printerConnectionBase): self._process.stdin.write('START\n') self._printProgress = 0 + def coolDown(self): + cooldown_toolhead = "M104 S0" + for i in range(0,3): + change_toolhead = "T%d".format(i) + self.sendCommand(change_toolhead) + self.sendCommand(cooldown_toolhead) + self.sendCommand("M140 S0") #Bed + pass + #Abort the previously loaded print file def cancelPrint(self): if not self.isPrinting()or self._process is None: return self._process.stdin.write('STOP\n') self._printProgress = 0 + self.coolDown() def isPrinting(self): return self._commState == machineCom.MachineCom.STATE_PRINTING -- 2.30.2