- updated the preprocessor files

This commit is contained in:
Marius Stanciu
2019-12-16 19:24:50 +02:00
committed by Marius
parent d256c99385
commit 6744d9ae07
16 changed files with 177 additions and 172 deletions

View File

@@ -1,16 +1,15 @@
# ########################################################## ##
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé, Daniel Friderich #
# Date: 12/15/2019 #
# Date: 12/15/2019 #
# MIT Licence #
# ########################################################## ##
# ##########################################################
from FlatCAMPostProc import *
class ISEL_ICP_CNC(FlatCAMPostProc):
include_header = False
def start_code(self, p):
@@ -22,47 +21,40 @@ class ISEL_ICP_CNC(FlatCAMPostProc):
xmax = '%.*f' % (p.coords_decimals, p['options']['xmax'])
ymin = '%.*f' % (p.coords_decimals, p['options']['ymin'])
ymax = '%.*f' % (p.coords_decimals, p['options']['ymax'])
gcode += 'IMF_PBL flatcam\r\n'
if str(p['options']['type']) == 'Geometry':
gcode += '; TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\r\n'
gcode += '; Spindle Speed: %s RPM\r\n' % str(p['spindlespeed'])
gcode += '; Feedrate: ' + str(p['feedrate']) + units + '/min' + '\r\n'
gcode += 'IMF_PBL flatcam\n\n'
if str(p['options']['type']) == 'Geometry':
gcode += '; Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\r\n'
gcode += '; Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\r\n\r\n'
gcode += '; Z_Cut: ' + str(p['z_cut']) + units + '\r\n'
gcode += '; TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\n'
gcode += '; Spindle Speed: %s RPM\n' % str(p['spindlespeed'])
gcode += '; Feedrate: ' + str(p['feedrate']) + units + '/min' + '\n'
if str(p['options']['type']) == 'Geometry':
gcode += '; Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n'
gcode += '\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['z_depthpercut']) + units + ' <=>' + \
str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\r\n'
gcode += '; Z_Move: ' + str(p['z_move']) + units + '\r\n'
gcode += '; Z Toolchange: ' + str(p['z_toolchange']) + units + '\r\n'
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['z_toolchange']) + units + '\n'
if coords_xy is not None:
gcode += '; X,Y Toolchange: ' + "%.*f, %.*f" % (p.decimals, coords_xy[0],
p.decimals, coords_xy[1]) + units + '\r\n'
p.decimals, coords_xy[1]) + units + '\n'
else:
gcode += '; X,Y Toolchange: ' + "None" + units + '\r\n'
gcode += '; Z Start: ' + str(p['startz']) + units + '\r\n'
gcode += '; Z End: ' + str(p['z_end']) + units + '\r\n'
gcode += '; Steps per circle: ' + str(p['steps_per_circle']) + '\r\n'
gcode += '; X,Y Toolchange: ' + "None" + units + '\n'
gcode += '; Z Start: ' + str(p['startz']) + 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':
gcode += '; Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\r\n'
gcode += '; Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n'
else:
gcode += '; Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\r\n'
gcode += '; Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n'
gcode += '\n'
gcode += '; X range: ' + '{: >9s}'.format(xmin) + ' ... ' + '{: >9s}'.format(xmax) + ' ' + units + '\r\n'
gcode += '; Y range: ' + '{: >9s}'.format(ymin) + ' ... ' + '{: >9s}'.format(ymax) + ' ' + units + '\r\n'
gcode += '; X range: ' + '{: >9s}'.format(xmin) + ' ... ' + '{: >9s}'.format(xmax) + ' ' + units + '\n'
gcode += '; Y range: ' + '{: >9s}'.format(ymin) + ' ... ' + '{: >9s}'.format(ymax) + ' ' + units + '\n'
return gcode
@@ -89,24 +81,26 @@ class ISEL_ICP_CNC(FlatCAMPostProc):
if i[0] == p.tool:
no_drills = i[2]
gcode = "GETTOOL {tool}\r\n; Changed to Tool Dia = {toolC}".format(tool=int(p.tool), t_drills=no_drills, toolC=toolC_formatted)
gcode = "GETTOOL {tool}\n; Changed to Tool Dia = {toolC}".format(tool=int(p.tool), t_drills=no_drills,
toolC=toolC_formatted)
if f_plunge is True:
gcode += '\r\nFASTABS Z' + str(int(p.z_move * 1000))
gcode += '\nFASTABS Z' + str(int(p.z_move * 1000))
return gcode
else:
gcode = "GETTOOL {tool}\r\n; Changed to Tool Dia = {toolC})".format(tool=int(p.tool), toolC=toolC_formatted)
gcode = "GETTOOL {tool}\n; Changed to Tool Dia = {toolC}".format(tool=int(p.tool), toolC=toolC_formatted)
if f_plunge is True:
gcode += '\r\nFASTABS Z' + str(int(p.z_move * 1000))
gcode += '\nFASTABS Z' + str(int(p.z_move * 1000))
return gcode
def up_to_zero_code(self, p):
return 'MOVEABS Z0'
def position_code(self, p):
return ('X' + str(int(p.x * 1000)) + ' Y' + str(int(p.y * 1000)))
return 'X' + str(int(p.x * 1000)) + ' Y' + str(int(p.y * 1000))
def rapid_code(self, p):
return ('FASTABS ' + self.position_code(p)).format(**p)
@@ -115,9 +109,9 @@ class ISEL_ICP_CNC(FlatCAMPostProc):
def end_code(self, p):
gcode = ''
gcode += 'WPCLEAR\r\n'
gcode += 'FASTABS Z0\r\n'
gcode += 'FASTABS X0 Y0\r\n'
gcode += 'WPCLEAR\n'
gcode += 'FASTABS Z0\n'
gcode += 'FASTABS X0 Y0\n'
gcode += 'PROGEND'
return gcode
@@ -138,5 +132,5 @@ class ISEL_ICP_CNC(FlatCAMPostProc):
if p.dwelltime:
return 'WAIT ' + str(int(p.dwelltime * 1000))
def spindle_stop_code(self,p):
return 'SPINDLE OFF'
def spindle_stop_code(self, p):
return 'SPINDLE OFF'