From 96059c4b5492ff20876f052928202f81f377e0eb Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 24 Aug 2020 13:14:54 +0300 Subject: [PATCH] - in CNCJob UI Autolevelling - GRBL controller - fixed the send_grbl_command() method --- CHANGELOG.md | 1 + appObjects/FlatCAMCNCJob.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91986276..f2165747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta - made sure that when doing units conversion keep only the decimals specified in the application decimals setting (should differentiate between values and display?) - in CNCJob UI Autolevelling - some UI changes - in CNCJob UI Autolevelling - GRBL controller - added the probing method +- in CNCJob UI Autolevelling - GRBL controller - fixed the send_grbl_command() method 23.08.2020 diff --git a/appObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py index ada561f1..bcad2515 100644 --- a/appObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -1111,9 +1111,7 @@ class CNCJobObject(FlatCAMObj, CNCjob): :return: the text returned by the GRBL controller after each command :rtype: str """ - stripped_cmd = command.strip() - - cmd = stripped_cmd.rpartition('\n')[0] + cmd = command.strip() if echo: self.app.inform_shell[str, bool].emit(cmd, False) @@ -1121,12 +1119,14 @@ class CNCJobObject(FlatCAMObj, CNCjob): snd = cmd + '\n' self.grbl_ser_port.write(snd.encode('utf-8')) grbl_out = self.grbl_ser_port.readlines() + if not grbl_out: + self.app.inform_shell[str, bool].emit('\t\t\t: No answer\n', False) result = '' for line in grbl_out: if echo: try: - self.app.inform_shell.emit(' : ' + line.decode('utf-8').strip().upper()) + self.app.inform_shell.emit('\t\t\t: ' + line.decode('utf-8').strip().upper()) except Exception as e: log.debug("CNCJobObject.send_grbl_command() --> %s" % str(e)) if 'ok' in line: