From b4f6ae8c5f76fa7cd0d1510d1960853396fb4d06 Mon Sep 17 00:00:00 2001 From: Elijah Snyder Date: Mon, 10 Apr 2017 19:01:59 -0500 Subject: [PATCH 1/5] First refactor for section to increase verbosity and move all translated M105s. --- plugins/USBPrinting/USBPrinterOutputDevice.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 580bbf06df..2ca7e4ecc7 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -563,19 +563,19 @@ class USBPrinterOutputDevice(PrinterOutputDevice): line = line[:line.find(";")] line = line.strip() - # Don't send empty lines. But we do have to send something, so send m105 instead. - if line == "": + # Don't send empty lines. But we do have to send something, so send + # m105 instead. + # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as + # an LCD menu pause. + if line == "" or line == "M1" or line == "M1": line = "M105" - try: - if line == "M0" or line == "M1": - line = "M105" # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause. if ("G0" in line or "G1" in line) and "Z" in line: z = float(re.search("Z([0-9\.]*)", line).group(1)) if self._current_z != z: self._current_z = z except Exception as e: - Logger.log("e", "Unexpected error with printer connection: %s" % e) + Logger.log("e", "Unexpected error with printer connection, could not parse current Z: %s: %s" % (e, line)) self._setErrorState("Unexpected error: %s" %e) checksum = functools.reduce(lambda x,y: x^y, map(ord, "N%d%s" % (self._gcode_position, line))) @@ -674,4 +674,4 @@ class USBPrinterOutputDevice(PrinterOutputDevice): def cancelPreheatBed(self): Logger.log("i", "Cancelling pre-heating of the bed.") self._setTargetBedTemperature(0) - self.preheatBedRemainingTimeChanged.emit() \ No newline at end of file + self.preheatBedRemainingTimeChanged.emit() From bb752fa16f2967559063d40ad83e06667cd5f4c5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Apr 2017 19:05:13 +0200 Subject: [PATCH 2/5] Added more logging --- plugins/USBPrinting/USBPrinterOutputDevice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 580bbf06df..28ab67dc46 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -148,6 +148,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): ## Start a print based on a g-code. # \param gcode_list List with gcode (strings). def printGCode(self, gcode_list): + Logger.log("d", "Started printing g-code") if self._progress or self._connection_state != ConnectionState.connected: self._error_message = Message(catalog.i18nc("@info:status", "Unable to start a new job because the printer is busy or not connected.")) self._error_message.show() @@ -183,6 +184,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): ## Private function (threaded) that actually uploads the firmware. def _updateFirmware(self): + Logger.log("d", "Attempting to update firmware") self._error_code = 0 self.setProgress(0, 100) self._firmware_update_finished = False @@ -536,6 +538,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._sendNextGcodeLine() elif b"resend" in line.lower() or b"rs" in line: # Because a resend can be asked with "resend" and "rs" try: + Logger.log("d", "Got a resend response") self._gcode_position = int(line.replace(b"N:",b" ").replace(b"N",b" ").replace(b":",b" ").split()[-1]) except: if b"rs" in line: From 6dfe9f609a299ec595417ce0c9a619cc785cbfc2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Apr 2017 09:48:17 +0200 Subject: [PATCH 3/5] Added build info to gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 22d42783f2..a6a456fd90 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,10 @@ plugins/GodMode plugins/PostProcessingPlugin plugins/X3GWriter +#Build stuff +CmakeCache.txt +CmakeFiles +CTestTestfile.cmake +Makefile + + From fe36da34387851dd898f203296c065e67ea5a5a6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Apr 2017 09:52:29 +0200 Subject: [PATCH 4/5] Added more files to gitignore --- .gitignore | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a6a456fd90..52d888f465 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ LC_MESSAGES *~ *.qm .idea +cura.desktop # Eclipse+PyDev .project @@ -33,11 +34,21 @@ plugins/Doodle3D-cura-plugin plugins/GodMode plugins/PostProcessingPlugin plugins/X3GWriter +plugins/FlatProfileExporter +plugins/cura-god-mode-plugin #Build stuff -CmakeCache.txt -CmakeFiles +CMakeCache.txt +CMakeFiles +CPackSourceConfig.cmake +Testing/ CTestTestfile.cmake -Makefile +Makefile* +junit-pytest-* +CuraVersion.py +cmake_install.cmake +#Debug +*.gcode +run.sh From d6d6036760a6ec04a83606b07be074790f0341c5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Apr 2017 10:29:24 +0200 Subject: [PATCH 5/5] Fixed minor mistake with pull request CURA-3681 --- plugins/USBPrinting/USBPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 3f9dc3971a..0100874eab 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -570,7 +570,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): # m105 instead. # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as # an LCD menu pause. - if line == "" or line == "M1" or line == "M1": + if line == "" or line == "M0" or line == "M1": line = "M105" try: if ("G0" in line or "G1" in line) and "Z" in line: