Skip to content

Commit 6096bfe

Browse files
committed
qtplasmac: run from line fixes
remove additional M66 line fix G21 test allow for space after G53
1 parent b2aaf9c commit 6096bfe

3 files changed

Lines changed: 29 additions & 36 deletions

File tree

lib/python/plasmac/run_from_line.py

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'''
22
run_from_line.py
33
4-
Copyright (C) 2019, 2020, 2021, 2022 Phillip A Carter
5-
Copyright (C) 2020, 2021, 2022 Gregory D Carl
4+
Copyright (C) 2019-2024 Phillip A Carter
5+
Copyright (C) 2020-2024 Gregory D Carl
66
77
This program is free software; you can redistribute it and/or modify it
88
under the terms of the GNU General Public License as published by the
@@ -42,10 +42,9 @@ def run_from_line_get(file, startLine):
4242
newData.append('G21')
4343
elif 'G20' in line:
4444
newData.append('G20')
45-
if line.strip().startswith('M66P3'):
46-
material.append(line.strip())
4745
# find the type of first move
48-
if not codes['move']['isSet'] and not 'G53G0' in line and not 'G20' in line and not 'g21' in line:
46+
''' IT IS POSSIBLE THERE MAY BE SPACES IN THE INCOMING LINE '''
47+
if not codes['move']['isSet'] and not 'G53G0' in line.replace(' ','') and not 'G20' in line and not 'G21' in line:
4948
if 'G00' in line:
5049
codes['move']['isSet'] = True
5150
codes['move']['isG00'] = True
@@ -89,21 +88,7 @@ def run_from_line_get(file, startLine):
8988
else:
9089
cutComp = False
9190
elif t1[1] == '6':
92-
codes['g6_'] = t1
93-
if t1 == 'G64':
94-
tmp = line.split('64')[1].strip()
95-
if tmp[0] == 'P':
96-
p = ''
97-
tmp = tmp[1:]
98-
while 1:
99-
if not tmp:
100-
break
101-
elif tmp[0] in '.0123456789Q':
102-
p += tmp[0]
103-
tmp = tmp[1:]
104-
else:
105-
break
106-
codes['g6_'] = 'G64P{}'.format(p)
91+
codes['g6_'] = t1 + line.split(t1)[1]
10792
elif t1 == 'G90' and not 'G90.1' in line:
10893
codes['g9_'] = 'G90'
10994
elif t1 == 'G91' and not 'G91.1' in line:
@@ -133,44 +118,43 @@ def run_from_line_get(file, startLine):
133118
if 'M03$' in line.replace(' ','') and not codes['spindle']['line']:
134119
codes['spindle']['line'] = line.strip()
135120
if 'M62P3' in line.replace(' ',''):
136-
codes['d3'] = 'M62P3 (Disable Torch)'
121+
codes['d3'] = 'M62 P3 (Disable Torch)'
137122
elif 'M63P3' in line.replace(' ',''):
138-
codes['d3'] = 'M63P3 (Enable Torch)'
123+
codes['d3'] = 'M63 P3 (Enable Torch)'
139124
elif 'M64P3' in line.replace(' ',''):
140-
codes['d3'] = 'M64P3 (Disable Torch)'
125+
codes['d3'] = 'M64 P3 (Disable Torch)'
141126
elif 'M65P3' in line.replace(' ',''):
142-
codes['d3'] = 'M65P3 (Enable Torch)'
127+
codes['d3'] = 'M65 P3 (Enable Torch)'
143128
if 'M62P2' in line.replace(' ',''):
144-
codes['d2'] = 'M62P2 (Disable THC)'
129+
codes['d2'] = 'M62 P2 (Disable THC)'
145130
elif 'M63P2' in line.replace(' ',''):
146-
codes['d2'] = 'M63P2 (Enable THC)'
131+
codes['d2'] = 'M63 P2 (Enable THC)'
147132
elif 'M64P2' in line.replace(' ',''):
148-
codes['d2'] = 'M64P2 (Disable THC)'
133+
codes['d2'] = 'M64 P2 (Disable THC)'
149134
elif 'M65P2' in line.replace(' ',''):
150-
codes['d2'] = 'M65P2 (Enable THC)'
135+
codes['d2'] = 'M65 P2 (Enable THC)'
151136
if 'M67E3Q' in line.replace(' ',''):
152-
codes['a3'] = 'M67E3Q'
137+
codes['a3'] = 'M67 E3 Q'
153138
tmp = line.replace(' ','').split('M67E3Q')[1]
154139
while 1:
155140
if tmp[0] in '-.0123456789':
156141
codes['a3'] += tmp[0]
157142
tmp = tmp[1:]
158143
else:
159144
break
160-
pc = float(codes['a3'].split('M67E3Q')[1])
145+
pc = float(codes['a3'].split('M67 E3 Q')[1])
161146
pc = pc if pc > 0 else 100
162147
codes['a3'] += ' (Velocity {}%)'.format(pc)
163148
if 'M68E3Q' in line.replace(' ',''):
164-
codes['a3'] = 'M68E3Q'
149+
codes['a3'] = 'M68 E3 Q'
165150
tmp = line.replace(' ','').split('M68E3Q')[1]
166-
bb=1
167151
while 1:
168152
if tmp[0] in '-.0123456789':
169153
codes['a3'] += tmp[0]
170154
tmp = tmp[1:]
171155
else:
172156
break
173-
pc = float(codes['a3'].split('M68E3Q')[1])
157+
pc = float(codes['a3'].split('M68 E3 Q')[1])
174158
pc = pc if pc > 0 else 100
175159
codes['a3'] += ' (Velocity {}%)'.format(pc)
176160
# test if inside a subroutine

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
VERSION = '236.303'
1+
VERSION = '237.304'
22
LCNCVER = '2.9'
33
DOCSVER = LCNCVER
44

55
'''
66
qtplasmac_handler.py
77
8-
Copyright (C) 2020, 2021, 2022, 2023 Phillip A Carter
9-
Copyright (C) 2020, 2021, 2022, 2023 Gregory D Carl
8+
Copyright (C) 2020-2024 Phillip A Carter
9+
Copyright (C) 2020-2024 Gregory D Carl
1010
1111
This program is free software; you can redistribute it and/or modify it
1212
under the terms of the GNU General Public License as published by the

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.9</h2>
2626
</table>
2727
<br>
2828
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
29+
<br><b><u>237.304 2024 Feb 22</u></b>
30+
<ul style="margin:0;">
31+
<li>manual cut: fix abort state</li>
32+
<li>cut recovery: fix state when offsets are reset</li>
33+
<li>run from line: remove additional M66 line</li>
34+
<li>run from line: fix G21 test</li>
35+
<li>run from line: allow for space after G53</li>
36+
</ul>
37+
2938
<br><b><u>236.303 2024 Feb 16</u></b>
3039
<ul style="margin:0;">
3140
<li>fix missing g64 value in run from line</li>

0 commit comments

Comments
 (0)