From 5e22b4b096585bf58ca83dc1e643b28f49e65119 Mon Sep 17 00:00:00 2001 From: daftscience Date: Sat, 16 Mar 2013 05:30:02 -0300 Subject: [PATCH] Reset currentLine when changing state to printing This keeps gcodePos and current line in sync when changing status to "Printing" --- octoprint/util/comm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 9be720a..a1f9d7e 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -486,7 +486,10 @@ class MachineCom(object): pass commandToSend = cmd - self._currentLine += 1 + if "M110" in cmd: + pass + else: + self._currentLine += 1 if sendChecksum or self._alwaysSendChecksum: lineNumber = self._gcodePos if self._alwaysSendChecksum: @@ -558,6 +561,7 @@ class MachineCom(object): return self._gcodeList = gcodeList self._gcodePos = 0 + self._currentLine = 0 self._printStartTime100 = None self._printSection = 'CUSTOM' self._changeState(self.STATE_PRINTING)