chiark / gitweb /
Fix for the pauze at Z plugin, when using multiple pauses below 15mm it was seeing...
authordaid303 <daid303@gmail.com>
Fri, 8 Mar 2013 09:49:40 +0000 (10:49 +0100)
committerdaid303 <daid303@gmail.com>
Fri, 8 Mar 2013 09:49:40 +0000 (10:49 +0100)
Cura/plugins/pauseAtZ.py
Cura/util/gcodeInterpreter.py

index 1771e03f804f025af3fdc0fe8190dd86278bcae6..745ec6e6be0052338b4de46af35785dc2905c4f8 100644 (file)
@@ -30,16 +30,22 @@ y = 0
 pauseState = 0
 with open(filename, "w") as f:
        for line in lines:
+               if line.startswith(';'):
+                       if line.startswith(';TYPE:'):
+                               currentSectionType = line[6:].strip()
+                       f.write(line)
+                       continue
                if getValue(line, 'G', None) == 1:
                        newZ = getValue(line, 'Z', z)
                        x = getValue(line, 'X', x)
                        y = getValue(line, 'Y', y)
-                       if newZ != z:
+                       if newZ != z and currentSectionType != 'CUSTOM':
                                z = newZ
                                if z < pauseLevel and pauseState == 0:
                                        pauseState = 1
                                if z >= pauseLevel and pauseState == 1:
                                        pauseState = 2
+                                       f.write(";TYPE:CUSTOM\n")
                                        #Retract
                                        f.write("M83\n")
                                        f.write("G1 E-%f F6000\n" % (retractAmount))
@@ -49,6 +55,9 @@ with open(filename, "w") as f:
                                                f.write("G1 Z15 F300\n")
                                        #Wait till the user continues printing
                                        f.write("M0\n")
+                                       #Push the filament back, and retract again, the properly primes the nozzle when changing filament.
+                                       f.write("G1 E%f F6000\n" % (retractAmount))
+                                       f.write("G1 E-%f F6000\n" % (retractAmount))
                                        #Move the head back
                                        f.write("G1 X%f Y%f F9000\n" % (x, y))
                                        f.write("G1 E%f F6000\n" % (retractAmount))
index c9a2b3eacebb357a157912a4b2cc7ce8865fbf28..eee6758b43295bc4854c8e16ed3c42a18be03aa3 100644 (file)
@@ -214,7 +214,9 @@ class gcode(object):
                        else:
                                M = self.getCodeInt(line, 'M')
                                if M is not None:
-                                       if M == 1:      #Message with possible wait (ignored)
+                                       if M == 0:      #Message with possible wait (ignored)
+                                               pass
+                                       elif M == 1:    #Message with possible wait (ignored)
                                                pass
                                        elif M == 80:   #Enable power supply
                                                pass