chiark / gitweb /
Cooldown toolhead and bed whenever print is canceled (including closing print window...
authornickthetait <tait@alephobjects.com>
Mon, 22 Jun 2015 17:06:22 +0000 (11:06 -0600)
committernickthetait <tait@alephobjects.com>
Mon, 22 Jun 2015 17:06:22 +0000 (11:06 -0600)
Cura/gui/printWindow.py
Cura/util/printerConnection/serialConnection.py

index d0a8337a1ffc401be36a5d60e5d81adf36ae8b11..bce405adac8d6bdf7a416b45fc69e8dfd957e7f1 100644 (file)
@@ -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):
index 488507b1b2cb8478a7e27ff15c994053c7d7efe5..2279fd38491dd242fa14fbd58b0b4970ca3dcc1b 100644 (file)
@@ -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