- small changes in parse_gcode()
This commit is contained in:
parent
13f67786af
commit
23a1388e98
13
camlib.py
13
camlib.py
|
@ -3972,9 +3972,11 @@ class CNCjob(Geometry):
|
||||||
path = [pos_xy]
|
path = [pos_xy]
|
||||||
# path = [(0, 0)]
|
# path = [(0, 0)]
|
||||||
|
|
||||||
self.app.inform.emit('%s: %d' % (_("Parsing GCode file. Number of lines"), len(self.gcode.splitlines())))
|
gcode_lines_list = self.gcode.splitlines()
|
||||||
|
self.app.inform.emit('%s: %d' % (_("Parsing GCode file. Number of lines"), len(gcode_lines_list)))
|
||||||
|
|
||||||
# Process every instruction
|
# Process every instruction
|
||||||
for line in StringIO(self.gcode):
|
for line in gcode_lines_list:
|
||||||
if force_parsing is False or force_parsing is None:
|
if force_parsing is False or force_parsing is None:
|
||||||
if '%MO' in line or '%' in line or 'MOIN' in line or 'MOMM' in line:
|
if '%MO' in line or '%' in line or 'MOIN' in line or 'MOMM' in line:
|
||||||
return "fail"
|
return "fail"
|
||||||
|
@ -3986,6 +3988,10 @@ class CNCjob(Geometry):
|
||||||
self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']]
|
self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# TODO take into consideration the tools and update the travel line thickness
|
||||||
|
if 'T' in gobj:
|
||||||
|
pass
|
||||||
|
|
||||||
# ## Changing height
|
# ## Changing height
|
||||||
if 'Z' in gobj:
|
if 'Z' in gobj:
|
||||||
if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
|
if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
|
||||||
|
@ -4067,6 +4073,9 @@ class CNCjob(Geometry):
|
||||||
stop = np.arctan2(-center[1] + y, -center[0] + x)
|
stop = np.arctan2(-center[1] + y, -center[0] + x)
|
||||||
path += arc(center, radius, start, stop, arcdir[current['G']], int(self.steps_per_circle / 4))
|
path += arc(center, radius, start, stop, arcdir[current['G']], int(self.steps_per_circle / 4))
|
||||||
|
|
||||||
|
current['X'] = x
|
||||||
|
current['Y'] = y
|
||||||
|
|
||||||
# Update current instruction
|
# Update current instruction
|
||||||
for code in gobj:
|
for code in gobj:
|
||||||
current[code] = gobj[code]
|
current[code] = gobj[code]
|
||||||
|
|
|
@ -89,9 +89,6 @@ class Toolchange_manual(FlatCAMPostProc):
|
||||||
if toolchangexy is not None:
|
if toolchangexy is not None:
|
||||||
x_toolchange = toolchangexy[0]
|
x_toolchange = toolchangexy[0]
|
||||||
y_toolchange = toolchangexy[1]
|
y_toolchange = toolchangexy[1]
|
||||||
# else:
|
|
||||||
# x_toolchange = p.oldx
|
|
||||||
# y_toolchange = p.oldy
|
|
||||||
|
|
||||||
no_drills = 1
|
no_drills = 1
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@ class default(FlatCAMPostProc):
|
||||||
gcode = """
|
gcode = """
|
||||||
M5
|
M5
|
||||||
G00 Z{z_toolchange}
|
G00 Z{z_toolchange}
|
||||||
G00 X{x_toolchange} Y{y_toolchange}
|
|
||||||
T{tool}
|
T{tool}
|
||||||
|
G00 X{x_toolchange} Y{y_toolchange}
|
||||||
M6
|
M6
|
||||||
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
||||||
M0
|
M0
|
||||||
|
|
Loading…
Reference in New Issue