From: daid303 Date: Fri, 8 Mar 2013 09:49:40 +0000 (+0100) Subject: Fix for the pauze at Z plugin, when using multiple pauses below 15mm it was seeing... X-Git-Tag: 13.03~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6139f90bcadf44bab3e04ea04976d73e1f319f91;p=cura.git Fix for the pauze at Z plugin, when using multiple pauses below 15mm it was seeing the up-move as the pause point for the next pause. --- diff --git a/Cura/plugins/pauseAtZ.py b/Cura/plugins/pauseAtZ.py index 1771e03f..745ec6e6 100644 --- a/Cura/plugins/pauseAtZ.py +++ b/Cura/plugins/pauseAtZ.py @@ -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)) diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index c9a2b3ea..eee6758b 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -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