chiark / gitweb /
Combine retract and head lift into same step when pausing
authornickthetait <tait@alephobjects.com>
Tue, 10 Nov 2015 15:23:40 +0000 (08:23 -0700)
committernickthetait <tait@alephobjects.com>
Tue, 10 Nov 2015 15:40:54 +0000 (08:40 -0700)
Cura/util/printerConnection/serialConnection.py

index 92344f70a3a4ac6b4226e1b004322c257a75dd96..bf37ea64414d4542ce36e4306870fa32b511cfa7 100644 (file)
@@ -171,15 +171,21 @@ class serialConnection(printerConnectionBase.printerConnectionBase):
                                if x is not None and y is not None:
                                        # Set E relative positioning
                                        self.sendCommand("M83")
+                                       
                                        # Retract 1mm
-                                       self.sendCommand("G1 E-%f F120" % retract_amount)
+                                       retract = ("E-%f" % retract_amount)
 
                                        #Move the toolhead up
                                        newZ = self._ZPosition + moveZ
                                        if maxZ < newZ:
                                                newZ = maxZ
+                                               
                                        if newZ > self._ZPosition:
-                                               self.sendCommand("G1 Z%f F200\n" % (newZ))
+                                               move = ("Z%f " % (newZ))
+                                       else: #No z movement, too close to max height 
+                                               move = ""
+                                       retract_and_move = "G1 {} {}F120\n".format(retract, move)
+                                       self.sendCommand(retract_and_move)
 
                                        #Move the head away
                                        self.sendCommand("G1 X%f Y%f F9000\n" % (parkX, parkY))