|
2 | 2 | ''' |
3 | 3 | plasmac_gcode.py |
4 | 4 |
|
5 | | -Copyright (C) 2019, 2020, 2021, 2022, 2023 Phillip A Carter |
6 | | -Copyright (C) 2020, 2021, 2022, 2023 Gregory D Carl |
| 5 | +Copyright (C) 2019 - 2024 Phillip A Carter |
| 6 | +Copyright (C) 2020 - 2024 Gregory D Carl |
7 | 7 |
|
8 | 8 | This program is free software; you can redistribute it and/or modify it |
9 | 9 | under the terms of the GNU General Public License as published by the |
@@ -235,7 +235,7 @@ def process_file(self): |
235 | 235 | code = self.parse_code(both[0]) |
236 | 236 | cmnt = both[1] |
237 | 237 | if code: |
238 | | - line = f'{code} {tag}{cmnt}' |
| 238 | + line = f'{code}{tag}{cmnt}' |
239 | 239 | else: |
240 | 240 | line = f'{tag}{cmnt}' |
241 | 241 | # code only - parse the code |
@@ -279,7 +279,7 @@ def parse_code(self, data): |
279 | 279 | data = data[1:] |
280 | 280 | data = tmp |
281 | 281 | # if incremental distance mode fix overburn coordinates |
282 | | - if data[:3] in ['G00', 'G01'] and self.distMode == 91 and (self.oBurnX or self.oBurnY): |
| 282 | + if data[:3] in ['G00', 'G01'] and self.distMode == 91 and (self.oBurnX or self.oBurnY) and not self.spotting: |
283 | 283 | data = self.fix_overburn_incremental_coordinates(data) |
284 | 284 | # set path blending |
285 | 285 | if 'G64' in data: |
@@ -313,6 +313,9 @@ def parse_code(self, data): |
313 | 313 | # is this a scribe |
314 | 314 | if data.startswith('M03 $1 S'): |
315 | 315 | self.set_scribing() |
| 316 | + # is this a spot |
| 317 | + if data.startswith('M03 $2 S') and not self.pierceOnly: |
| 318 | + self.spotting = True |
316 | 319 | # test for pierce only mode |
317 | 320 | elif data.replace(' ','').startswith('#<pierce-only>=1') or self.cutType == 1: |
318 | 321 | self.set_pierce_mode() |
@@ -734,6 +737,9 @@ def spindle_off(self, data): |
734 | 737 | self.lineNum += 1 |
735 | 738 | data = f'{data}\nM65 P3 (enable torch)' |
736 | 739 | self.torchEnable = True |
| 740 | + # if not pierce mode reset spotting flag |
| 741 | + if not self.pierceOnly: |
| 742 | + self.spotting = False |
737 | 743 | return data |
738 | 744 |
|
739 | 745 | def program_end(self, data): |
|
0 commit comments