- work in progress to Toolchange_Custom code replacememnt -> finished the parse and replace function

This commit is contained in:
Marius Stanciu
2019-02-26 17:03:57 +02:00
committed by Marius
parent 00340287a4
commit 874ce11d84
5 changed files with 35 additions and 60 deletions

View File

@@ -1,7 +1,7 @@
from FlatCAMPostProc import *
class Toolchange_Probe_general(FlatCAMPostProc):
class Toolchange_Custom(FlatCAMPostProc):
coordinate_format = "%.*f"
feedrate_format = '%.*f'
@@ -97,29 +97,13 @@ class Toolchange_Probe_general(FlatCAMPostProc):
if toolchangexy is not None:
gcode = """
M5
G00 X{toolchangex} Y{toolchangey}
T{tool}
M6
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
M0
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
else:
gcode = """
M5
T{tool}
M6
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
M0
""".format(tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
@@ -127,24 +111,11 @@ M0
else:
if toolchangexy is not None:
gcode = """
M5
G00 X{toolchangex} Y{toolchangey}
T{tool}
M6
(MSG, Change to Tool Dia = {toolC})
M0
M6
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
tool=int(p.tool),
toolC=toolC_formatted)
else:
gcode = """
M5
T{tool}
M6
(MSG, Change to Tool Dia = {toolC})
M0""".format(tool=int(p.tool),
toolC=toolC_formatted)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)