From: nickthetait Date: Mon, 22 Jun 2015 17:06:22 +0000 (-0600) Subject: Cooldown toolhead and bed whenever print is canceled (including closing print window... X-Git-Tag: lulzbot-15.02.1-2.01~78 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b4e0007d4ab890312335a8bd26f7550a76cfc344;p=cura.git Cooldown toolhead and bed whenever print is canceled (including closing print window). Fixes #118 --- 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