- progress in ToolChange Custom commands replacement and rename
This commit is contained in:
@@ -59,13 +59,13 @@ class Paste_1(FlatCAMPostProc_Tools):
|
||||
return 'G01 Z' + self.coordinate_format%(p.coords_decimals, float(p['z_stop']))
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = float(p['z_toolchange'])
|
||||
z_toolchange = float(p['z_toolchange'])
|
||||
toolchangexy = [float(eval(a)) for a in p['xy_toolchange'].split(",")]
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(float(p['toolC']), '.2f')
|
||||
@@ -74,26 +74,26 @@ class Paste_1(FlatCAMPostProc_Tools):
|
||||
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool with Nozzle Dia = {toolC})
|
||||
M0
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(int(p.tool)),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
else:
|
||||
gcode = """
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool with Nozzle Dia = {toolC})
|
||||
M0
|
||||
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(int(p.tool)),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -121,7 +121,7 @@ M0
|
||||
def feedrate_xy_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, float(p['frxy'])))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, float(p['frz'])))
|
||||
|
||||
def feedrate_z_dispense_code(self, p):
|
||||
|
||||
@@ -9,7 +9,7 @@ class Repetier(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -23,18 +23,18 @@ class Repetier(FlatCAMPostProc):
|
||||
gcode += ';Feedrate: ' + str(p['feedrate']) + units + '/min' + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += ';Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + '\n'
|
||||
gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n'
|
||||
|
||||
gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n'
|
||||
gcode += ';Z_Cut: ' + str(p['z_cut']) + units + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += ';DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + '\n'
|
||||
gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n'
|
||||
|
||||
gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n'
|
||||
gcode += ';Z Toolchange: ' + str(p['toolchangez']) + units + '\n'
|
||||
gcode += ';Z Toolchange: ' + str(p['z_toolchange']) + units + '\n'
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += ';X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + '\n'
|
||||
@@ -42,7 +42,7 @@ class Repetier(FlatCAMPostProc):
|
||||
gcode += ';X,Y Toolchange: ' + "None" + units + '\n'
|
||||
|
||||
gcode += ';Z Start: ' + str(p['startz']) + units + '\n'
|
||||
gcode += ';Z End: ' + str(p['endz']) + units + '\n'
|
||||
gcode += ';Z End: ' + str(p['z_end']) + units + '\n'
|
||||
gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -73,19 +73,19 @@ class Repetier(FlatCAMPostProc):
|
||||
return 'G1 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut) + " " + self.end_feedrate_code(p)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -99,22 +99,22 @@ class Repetier(FlatCAMPostProc):
|
||||
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
G0 Z{toolchangez}
|
||||
G0 X{toolchangex} Y{toolchangey}
|
||||
G0 Z{z_toolchange}
|
||||
G0 X{x_toolchange} Y{y_toolchange}
|
||||
M84
|
||||
@pause Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills}
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
G0 Z{toolchangez}
|
||||
G0 Z{z_toolchange}
|
||||
M84
|
||||
@pause Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills}
|
||||
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -127,21 +127,21 @@ M84
|
||||
else:
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
G0 Z{toolchangez}
|
||||
G0 X{toolchangex} Y{toolchangey}
|
||||
G0 Z{z_toolchange}
|
||||
G0 X{x_toolchange} Y{y_toolchange}
|
||||
M84
|
||||
@pause Change to tool T{tool} with Tool Dia = {toolC}
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
G0 Z{toolchangez}
|
||||
G0 Z{z_toolchange}
|
||||
M84
|
||||
@pause Change to tool T{tool} with Tool Dia = {toolC}
|
||||
""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -164,8 +164,8 @@ M84
|
||||
return ('G1 ' + self.position_code(p)).format(**p) + " " + self.end_feedrate_code(p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G0 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + " " + self.feedrate_rapid_code(p) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G0 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + " " + self.feedrate_rapid_code(p) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G0 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + " " + self.feedrate_rapid_code(p) + "\n"
|
||||
@@ -178,8 +178,8 @@ M84
|
||||
def end_feedrate_code(self, p):
|
||||
return 'F' + self.feedrate_format %(p.fr_decimals, p.feedrate)
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G1 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G1 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def feedrate_rapid_code(self, p):
|
||||
return 'F' + self.feedrate_rapid_format % (p.fr_decimals, p.feedrate_rapid)
|
||||
|
||||
@@ -72,9 +72,9 @@ class Roland_MDX_20(FlatCAMPostProc):
|
||||
|
||||
def end_code(self, p):
|
||||
if p.units.upper() == 'IN':
|
||||
z = p.endz / 25.4
|
||||
z = p.z_end / 25.4
|
||||
else:
|
||||
z = p.endz
|
||||
z = p.z_end
|
||||
gcode = self.feedrate_rapid_code(p) + '\n'
|
||||
gcode += self.position_code(p).format(**p) + ',' + str(float(z * 40.0)) + ';'
|
||||
return gcode
|
||||
@@ -89,13 +89,13 @@ class Roland_MDX_20(FlatCAMPostProc):
|
||||
fr_sec = 6
|
||||
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
fr_sec = p.feedrate_z / 60
|
||||
def z_feedrate_code(self, p):
|
||||
fr_sec = p.z_feedrate / 60
|
||||
|
||||
# valid feedrate for MDX20 is between 0.1mm/sec and 15mm/sec (6mm/min to 900mm/min)
|
||||
if p.feedrate_z >= 900:
|
||||
if p.z_feedrate >= 900:
|
||||
fr_sec = 15
|
||||
if p.feedrate_z < 6:
|
||||
if p.z_feedrate < 6:
|
||||
fr_sec = 6
|
||||
return 'V' + str(self.feedrate_format % fr_sec) + ';'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class Toolchange_Custom(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,18 +22,18 @@ class Toolchange_Custom(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
@@ -41,7 +41,7 @@ class Toolchange_Custom(FlatCAMPostProc):
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -71,19 +71,19 @@ class Toolchange_Custom(FlatCAMPostProc):
|
||||
return 'G01 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -98,8 +98,8 @@ class Toolchange_Custom(FlatCAMPostProc):
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M6
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -112,8 +112,8 @@ M6
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M6
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -135,8 +135,8 @@ M6
|
||||
return ('G01 ' + self.position_code(p)).format(**p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
@@ -145,8 +145,8 @@ M6
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self, p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -8,7 +8,7 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,7 +22,7 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Feedrate Probe ' + str(p['feedrate_probe']) + units + '/min' + ')\n' + '\n'
|
||||
@@ -30,11 +30,11 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
@@ -42,7 +42,7 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Z Probe Depth: ' + str(p['z_pdepth']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
@@ -76,20 +76,20 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
return 'G01 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -106,8 +106,8 @@ class Toolchange_Probe_MACH3(FlatCAMPostProc):
|
||||
M5
|
||||
T{tool}
|
||||
M6
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| CONNECT THE PROBE ||| Drills for this tool = {t_drills})
|
||||
M0
|
||||
F{feedrate_probe}
|
||||
@@ -120,9 +120,9 @@ G92 Z0
|
||||
G00 Z{z_move}
|
||||
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
|
||||
M0
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
|
||||
z_in_between=self.coordinate_format % (p.coords_decimals, p.z_move / 2),
|
||||
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
|
||||
@@ -136,7 +136,7 @@ M0
|
||||
M5
|
||||
T{tool}
|
||||
M6
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| CONNECT THE PROBE ||| Drills for this tool = {t_drills})
|
||||
M0
|
||||
F{feedrate_probe}
|
||||
@@ -149,7 +149,7 @@ G92 Z0
|
||||
G00 Z{z_move}
|
||||
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
|
||||
M0
|
||||
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
|
||||
z_in_between=self.coordinate_format % (p.coords_decimals, p.z_move / 2),
|
||||
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
|
||||
@@ -169,8 +169,8 @@ M0
|
||||
M5
|
||||
T{tool}
|
||||
M6
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| CONNECT THE PROBE)
|
||||
M0
|
||||
F{feedrate_probe}
|
||||
@@ -183,9 +183,9 @@ G92 Z0
|
||||
G00 Z{z_move}
|
||||
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
|
||||
M0
|
||||
""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
|
||||
z_in_between=self.coordinate_format % (p.coords_decimals, p.z_move / 2),
|
||||
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
|
||||
@@ -198,7 +198,7 @@ M0
|
||||
M5
|
||||
T{tool}
|
||||
M6
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| CONNECT THE PROBE)
|
||||
M0
|
||||
F{feedrate_probe}
|
||||
@@ -211,7 +211,7 @@ G92 Z0
|
||||
G00 Z{z_move}
|
||||
(MSG, Remove any clips or other devices used for probing. CNC work is resuming ...)
|
||||
M0
|
||||
""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move),
|
||||
z_in_between=self.coordinate_format % (p.coords_decimals, p.z_move / 2),
|
||||
feedrate_probe=str(self.feedrate_format %(p.fr_decimals, p.feedrate_probe)),
|
||||
@@ -238,8 +238,8 @@ M0
|
||||
return ('G01 ' + self.position_code(p)).format(**p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
@@ -248,8 +248,8 @@ M0
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self, p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -8,7 +8,7 @@ class Toolchange_manual(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,24 +22,24 @@ class Toolchange_manual(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
else:
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -72,22 +72,22 @@ class Toolchange_manual(FlatCAMPostProc):
|
||||
return 'G01 Z' + self.coordinate_format % (p.coords_decimals, p.z_cut)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
# else:
|
||||
# toolchangex = p.oldx
|
||||
# toolchangey = p.oldy
|
||||
# x_toolchange = p.oldx
|
||||
# y_toolchange = p.oldy
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -102,20 +102,20 @@ class Toolchange_manual(FlatCAMPostProc):
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
||||
M0
|
||||
G01 Z0
|
||||
(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.)
|
||||
M0
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Now the tool can be tightened more securely.)
|
||||
M0
|
||||
""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format%(p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format%(p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -123,18 +123,18 @@ M0
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
||||
M0
|
||||
G01 Z0
|
||||
(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.)
|
||||
M0
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Now the tool can be tightened more securely.)
|
||||
M0
|
||||
""".format(
|
||||
toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -147,36 +147,36 @@ M0
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
G00 X{toolchangex}Y{toolchangey}
|
||||
G00 X{x_toolchange}Y{y_toolchange}
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0
|
||||
G01 Z0
|
||||
(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.)
|
||||
M0
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Now the tool can be tightened more securely.)
|
||||
M0
|
||||
""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format%(p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format%(p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0
|
||||
G01 Z0
|
||||
(MSG, Adjust the tool T{tool} to touch the material and then tighten it slightly.)
|
||||
M0
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
(MSG, Now the tool can be tightened more securely.)
|
||||
M0
|
||||
""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -198,8 +198,8 @@ M0
|
||||
return ('G01 ' + self.position_code(p)).format(**p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
else:
|
||||
@@ -209,8 +209,8 @@ M0
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self,p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -8,7 +8,7 @@ class default(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,18 +22,18 @@ class default(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
@@ -41,7 +41,7 @@ class default(FlatCAMPostProc):
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -73,19 +73,19 @@ class default(FlatCAMPostProc):
|
||||
return 'G01 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -100,26 +100,26 @@ class default(FlatCAMPostProc):
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
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),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
||||
M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -131,24 +131,24 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -170,8 +170,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
return ('G01 ' + self.position_code(p)).format(**p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
@@ -180,8 +180,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self, p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -8,7 +8,7 @@ class grbl_11(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,24 +22,24 @@ class grbl_11(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
else:
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -72,19 +72,19 @@ class grbl_11(FlatCAMPostProc):
|
||||
return 'G01 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -99,25 +99,25 @@ class grbl_11(FlatCAMPostProc):
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
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),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC} ||| Total drills for tool T{tool} = {t_drills})
|
||||
M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -130,24 +130,24 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 X{toolchangex} Y{toolchangey}
|
||||
G00 Z{z_toolchange}
|
||||
G00 X{x_toolchange} Y{y_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 Z{toolchangez}
|
||||
G00 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -170,8 +170,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
' F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
@@ -180,8 +180,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self,p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -68,8 +68,8 @@ class grbl_laser(FlatCAMPostProc):
|
||||
' F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G00 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
@@ -78,8 +78,8 @@ class grbl_laser(FlatCAMPostProc):
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self, p):
|
||||
return ''
|
||||
|
||||
@@ -60,7 +60,7 @@ class hpgl(FlatCAMPostProc):
|
||||
def feedrate_code(self, p):
|
||||
return ''
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
def z_feedrate_code(self, p):
|
||||
return ''
|
||||
|
||||
def feedrate_rapid_code(self, p):
|
||||
|
||||
@@ -8,7 +8,7 @@ class line_xyz(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -22,24 +22,24 @@ class line_xyz(FlatCAMPostProc):
|
||||
gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += '(Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + ')\n'
|
||||
gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n'
|
||||
|
||||
gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n'
|
||||
gcode += '(Z_Cut: ' + str(p['z_cut']) + units + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += '(DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + ')\n'
|
||||
gcode += '(DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n'
|
||||
|
||||
gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['toolchangez']) + units + ')\n'
|
||||
gcode += '(Z Toolchange: ' + str(p['z_toolchange']) + units + ')\n'
|
||||
if coords_xy is not None:
|
||||
gcode += '(X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + ')\n'
|
||||
else:
|
||||
gcode += '(X,Y Toolchange: ' + "None" + units + ')\n'
|
||||
gcode += '(Z Start: ' + str(p['startz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['endz']) + units + ')\n'
|
||||
gcode += '(Z End: ' + str(p['z_end']) + units + ')\n'
|
||||
gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -80,26 +80,26 @@ class line_xyz(FlatCAMPostProc):
|
||||
return g
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
xy_toolchange = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
if xy_toolchange is not None:
|
||||
x_toolchange = xy_toolchange[0]
|
||||
y_toolchange = xy_toolchange[1]
|
||||
else:
|
||||
if str(p['options']['type']) == 'Excellon':
|
||||
toolchangex = p.oldx
|
||||
toolchangey = p.oldy
|
||||
x_toolchange = p.oldx
|
||||
y_toolchange = p.oldy
|
||||
else:
|
||||
toolchangex = p.x
|
||||
toolchangey = p.y
|
||||
x_toolchange = p.x
|
||||
y_toolchange = p.y
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -112,40 +112,40 @@ class line_xyz(FlatCAMPostProc):
|
||||
no_drills = i[2]
|
||||
gcode = """
|
||||
M5
|
||||
G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
|
||||
G00 X{x_toolchange} Y{x_toolchange} Z{z_toolchange}
|
||||
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),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
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),
|
||||
gcode += """\nG00 X{x_toolchange} Y{x_toolchange} Z{z_move}""".format(
|
||||
x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
|
||||
return gcode
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G00 X{toolchangex} Y{toolchangey} Z{toolchangez}
|
||||
G00 X{x_toolchange} Y{x_toolchange} Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
(MSG, Change to Tool Dia = {toolC})
|
||||
M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format%(p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
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),
|
||||
gcode += """\nG00 X{x_toolchange} Y{x_toolchange} Z{z_move}""".format(
|
||||
x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_move=self.coordinate_format % (p.coords_decimals, p.z_move))
|
||||
return gcode
|
||||
|
||||
@@ -170,19 +170,19 @@ M0""".format(toolchangex=self.coordinate_format%(p.coords_decimals, toolchangex)
|
||||
return g
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
if coords_xy is not None:
|
||||
g = 'G00 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + "\n"
|
||||
else:
|
||||
g = ('G00 ' + self.position_code(p)).format(**p)
|
||||
g += ' Z' + self.coordinate_format % (p.coords_decimals, p.endz)
|
||||
g += ' Z' + self.coordinate_format % (p.coords_decimals, p.z_end)
|
||||
return g
|
||||
|
||||
def feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate))
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G01 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def spindle_code(self, p):
|
||||
if p.spindlespeed:
|
||||
|
||||
@@ -9,7 +9,7 @@ class marlin(FlatCAMPostProc):
|
||||
|
||||
def start_code(self, p):
|
||||
units = ' ' + str(p['units']).lower()
|
||||
coords_xy = p['toolchange_xy']
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ''
|
||||
|
||||
xmin = '%.*f' % (p.coords_decimals, p['options']['xmin'])
|
||||
@@ -23,18 +23,18 @@ class marlin(FlatCAMPostProc):
|
||||
gcode += ';Feedrate: ' + str(p['feedrate']) + units + '/min' + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
gcode += ';Feedrate_Z: ' + str(p['feedrate_z']) + units + '/min' + '\n'
|
||||
gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n'
|
||||
|
||||
gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n'
|
||||
gcode += ';Z_Cut: ' + str(p['z_cut']) + units + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Geometry':
|
||||
if p['multidepth'] is True:
|
||||
gcode += ';DepthPerCut: ' + str(p['depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['depthpercut'])) + ' passes' + '\n'
|
||||
gcode += ';DepthPerCut: ' + str(p['z_depthpercut']) + units + ' <=>' + \
|
||||
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n'
|
||||
|
||||
gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n'
|
||||
gcode += ';Z Toolchange: ' + str(p['toolchangez']) + units + '\n'
|
||||
gcode += ';Z Toolchange: ' + str(p['z_toolchange']) + units + '\n'
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += ';X,Y Toolchange: ' + "%.4f, %.4f" % (coords_xy[0], coords_xy[1]) + units + '\n'
|
||||
@@ -42,7 +42,7 @@ class marlin(FlatCAMPostProc):
|
||||
gcode += ';X,Y Toolchange: ' + "None" + units + '\n'
|
||||
|
||||
gcode += ';Z Start: ' + str(p['startz']) + units + '\n'
|
||||
gcode += ';Z End: ' + str(p['endz']) + units + '\n'
|
||||
gcode += ';Z End: ' + str(p['z_end']) + units + '\n'
|
||||
gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n'
|
||||
|
||||
if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry':
|
||||
@@ -73,19 +73,19 @@ class marlin(FlatCAMPostProc):
|
||||
return 'G1 Z' + self.coordinate_format%(p.coords_decimals, p.z_cut) + " " + self.end_feedrate_code(p)
|
||||
|
||||
def toolchange_code(self, p):
|
||||
toolchangez = p.toolchangez
|
||||
toolchangexy = p.toolchange_xy
|
||||
z_toolchange = p.z_toolchange
|
||||
toolchangexy = p.xy_toolchange
|
||||
f_plunge = p.f_plunge
|
||||
gcode = ''
|
||||
|
||||
if toolchangexy is not None:
|
||||
toolchangex = toolchangexy[0]
|
||||
toolchangey = toolchangexy[1]
|
||||
x_toolchange = toolchangexy[0]
|
||||
y_toolchange = toolchangexy[1]
|
||||
|
||||
no_drills = 1
|
||||
|
||||
if int(p.tool) == 1 and p.startz is not None:
|
||||
toolchangez = p.startz
|
||||
z_toolchange = p.startz
|
||||
|
||||
if p.units.upper() == 'MM':
|
||||
toolC_formatted = format(p.toolC, '.2f')
|
||||
@@ -100,25 +100,25 @@ class marlin(FlatCAMPostProc):
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G0 Z{toolchangez}
|
||||
G0 X{toolchangex} Y{toolchangey}
|
||||
G0 Z{z_toolchange}
|
||||
G0 X{x_toolchange} Y{y_toolchange}
|
||||
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),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G0 Z{toolchangez}
|
||||
G0 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
;MSG, Change to Tool Dia = {toolC}, Total drills for tool T{tool} = {t_drills}
|
||||
M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
t_drills=no_drills,
|
||||
toolC=toolC_formatted)
|
||||
@@ -131,24 +131,24 @@ M0""".format(toolchangez=self.coordinate_format % (p.coords_decimals, toolchange
|
||||
if toolchangexy is not None:
|
||||
gcode = """
|
||||
M5
|
||||
G0 Z{toolchangez}
|
||||
G0 X{toolchangex} Y{toolchangey}
|
||||
G0 Z{z_toolchange}
|
||||
G0 X{x_toolchange} Y{y_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
;MSG, Change to Tool Dia = {toolC}
|
||||
M0""".format(toolchangex=self.coordinate_format % (p.coords_decimals, toolchangex),
|
||||
toolchangey=self.coordinate_format % (p.coords_decimals, toolchangey),
|
||||
toolchangez=self.coordinate_format % (p.coords_decimals, toolchangez),
|
||||
M0""".format(x_toolchange=self.coordinate_format % (p.coords_decimals, x_toolchange),
|
||||
y_toolchange=self.coordinate_format % (p.coords_decimals, y_toolchange),
|
||||
z_toolchange=self.coordinate_format % (p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
else:
|
||||
gcode = """
|
||||
M5
|
||||
G0 Z{toolchangez}
|
||||
G0 Z{z_toolchange}
|
||||
T{tool}
|
||||
M6
|
||||
;MSG, Change to Tool Dia = {toolC}
|
||||
M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez),
|
||||
M0""".format(z_toolchange=self.coordinate_format%(p.coords_decimals, z_toolchange),
|
||||
tool=int(p.tool),
|
||||
toolC=toolC_formatted)
|
||||
|
||||
@@ -170,8 +170,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
return ('G1 ' + self.position_code(p)).format(**p) + " " + self.end_feedrate_code(p)
|
||||
|
||||
def end_code(self, p):
|
||||
coords_xy = p['toolchange_xy']
|
||||
gcode = ('G0 Z' + self.feedrate_format %(p.fr_decimals, p.endz) + " " + self.feedrate_rapid_code(p) + "\n")
|
||||
coords_xy = p['xy_toolchange']
|
||||
gcode = ('G0 Z' + self.feedrate_format %(p.fr_decimals, p.z_end) + " " + self.feedrate_rapid_code(p) + "\n")
|
||||
|
||||
if coords_xy is not None:
|
||||
gcode += 'G0 X{x} Y{y}'.format(x=coords_xy[0], y=coords_xy[1]) + " " + self.feedrate_rapid_code(p) + "\n"
|
||||
@@ -184,8 +184,8 @@ M0""".format(toolchangez=self.coordinate_format%(p.coords_decimals, toolchangez)
|
||||
def end_feedrate_code(self, p):
|
||||
return 'F' + self.feedrate_format %(p.fr_decimals, p.feedrate)
|
||||
|
||||
def feedrate_z_code(self, p):
|
||||
return 'G1 F' + str(self.feedrate_format %(p.fr_decimals, p.feedrate_z))
|
||||
def z_feedrate_code(self, p):
|
||||
return 'G1 F' + str(self.feedrate_format %(p.fr_decimals, p.z_feedrate))
|
||||
|
||||
def feedrate_rapid_code(self, p):
|
||||
return 'F' + self.feedrate_rapid_format % (p.fr_decimals, p.feedrate_rapid)
|
||||
|
||||
Reference in New Issue
Block a user