- added a parameter ('Fast plunge' in Edit -> Preferences -> Geometry Options and Excellon Options) to control if the fast move to Z_move is done or not

This commit is contained in:
Marius Stanciu
2019-01-31 13:58:49 +02:00
committed by Marius
parent 965e7f48ed
commit 3c355f72be
9 changed files with 83 additions and 18 deletions

View File

@@ -67,6 +67,7 @@ class default(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@@ -111,8 +112,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@@ -138,7 +139,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@@ -66,6 +66,7 @@ class grbl_11(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@@ -111,7 +112,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@@ -137,7 +139,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@@ -74,6 +74,7 @@ class line_xyz(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@@ -101,7 +102,7 @@ class line_xyz(FlatCAMPostProc):
for i in p['options']['Tools_in_use']:
if i[0] == p.tool:
no_drills = i[2]
return """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
T{tool}
M5
M6
@@ -112,8 +113,15 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex)
tool=int(p.tool),
t_drills=no_drills,
toolC=toolC_formatted)
if f_plunge is True:
gcode += """\nG00 X{toolchangex} Y{toolchangey} Z{z_move}""".format(
toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
return gcode
else:
return """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
gcode = """G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
T{tool}
M5
M6
@@ -124,6 +132,13 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex)
tool=int(p.tool),
toolC=toolC_formatted)
if f_plunge is True:
gcode += """\nG00 X{toolchangex} Y{toolchangey} Z{z_move}""".format(
toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
return gcode
def up_to_zero_code(self, p):
g = 'G01 ' + 'X' + self.coordinate_format % (p.coords_decimals, p.x) + \
' Y' + self.coordinate_format % (p.coords_decimals, p.y) + \

View File

@@ -65,6 +65,7 @@ class manual_toolchange(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@@ -123,7 +124,8 @@ M0
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@@ -157,7 +159,8 @@ M0
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G00 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG00 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):

View File

@@ -67,6 +67,7 @@ class marlin(FlatCAMPostProc):
def toolchange_code(self, p):
toolchangez = p.toolchangez
toolchangexy = p.toolchange_xy
f_plunge = p.f_plunge
gcode = ''
if toolchangexy is not None:
@@ -112,7 +113,8 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
t_drills=no_drills,
toolC=toolC_formatted)
gcode += 'G0 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG0 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
else:
@@ -138,7 +140,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
tool=int(p.tool),
toolC=toolC_formatted)
gcode += 'G0 Z%.*f' % (p.coords_decimals, p.z_move)
if f_plunge is True:
gcode += '\nG0 Z%.*f' % (p.coords_decimals, p.z_move)
return gcode
def up_to_zero_code(self, p):