瀏覽代碼

- in CNCJob UI Autolevelling - GRBL controller - fixed the send_grbl_command() method

Marius Stanciu 5 年之前
父節點
當前提交
96059c4b54
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 1 0
      CHANGELOG.md
  2. 4 4
      appObjects/FlatCAMCNCJob.py

+ 1 - 0
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
 

+ 4 - 4
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: