diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 03907b5f..03dbbfa7 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -5539,6 +5539,17 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob): 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): gcode = '' roland = False @@ -5603,7 +5614,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob): )) 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 self.ui.toolchange_cb.get_value() is True: diff --git a/README.md b/README.md index bc2589b8..68067310 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing. - fixed plotting in Gerber Editor - working on GUI in Gerber Editor +- added a Gcode end_command: default is M02 31.03.2019