Просмотр исходного кода

- added a Gcode end_command: default is M02

Marius Stanciu 6 лет назад
Родитель
Сommit
5e9a27ca45
2 измененных файлов с 13 добавлено и 1 удалено
  1. 12 1
      FlatCAMObj.py
  2. 1 0
      README.md

+ 12 - 1
FlatCAMObj.py

@@ -5539,6 +5539,17 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
 
 
         return gcode
         return gcode
 
 
+    def gcode_footer(self, end_command=None):
+        """
+
+        :param end_command: 'M02' or 'M30' - String
+        :return:
+        """
+        if end_command:
+            return end_command
+        else:
+            return 'M02'
+
     def export_gcode(self, filename=None, preamble='', postamble='', to_file=False):
     def export_gcode(self, filename=None, preamble='', postamble='', to_file=False):
         gcode = ''
         gcode = ''
         roland = False
         roland = False
@@ -5603,7 +5614,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
                 ))
                 ))
                 return
                 return
 
 
-            g = gcode[:g_idx] + preamble + '\n' + gcode[g_idx:] + postamble
+            g = gcode[:g_idx] + preamble + '\n' + gcode[g_idx:] + postamble + self.gcode_footer()
 
 
         # if toolchange custom is used, replace M6 code with the code from the Toolchange Custom Text box
         # if toolchange custom is used, replace M6 code with the code from the Toolchange Custom Text box
         if self.ui.toolchange_cb.get_value() is True:
         if self.ui.toolchange_cb.get_value() is True:

+ 1 - 0
README.md

@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
 
 
 - fixed plotting in Gerber Editor
 - fixed plotting in Gerber Editor
 - working on GUI in Gerber Editor
 - working on GUI in Gerber Editor
+- added a Gcode end_command: default is M02
 
 
 31.03.2019
 31.03.2019