Merged in joernsn/flatcam/toolchange-shell-parameter (pull request #14)

Added 'toolchange' as an optional parameter to shell command 'drillcncjob'
This commit is contained in:
jpcgt 2015-07-18 12:01:03 -04:00
commit 9a1e55e83f
1 changed files with 7 additions and 4 deletions

View File

@ -2055,7 +2055,8 @@ class App(QtCore.QObject):
'outname': str,
'drillz': float,
'travelz': float,
'feedrate': float}
'feedrate': float,
'toolchange': int}
for key in kwa:
if key not in types:
@ -2085,7 +2086,8 @@ class App(QtCore.QObject):
job_obj.z_cut = kwa["drillz"]
job_obj.z_move = kwa["travelz"]
job_obj.feedrate = kwa["feedrate"]
job_obj.generate_from_excellon_by_tool(obj, kwa["tools"])
toolchange = True if "toolchange" in kwa and kwa["toolchange"] == 1 else False
job_obj.generate_from_excellon_by_tool(obj, kwa["tools"], toolchange)
job_obj.gcode_parse()
@ -2427,13 +2429,14 @@ class App(QtCore.QObject):
'drillcncjob': {
'fcn': drillcncjob,
'help': "Drill CNC job.\n" +
"> drillcncjob <name> -tools <str> -drillz <float> -travelz <float> -feedrate <float> -outname <str> \n" +
"> drillcncjob <name> -tools <str> -drillz <float> -travelz <float> -feedrate <float> -outname <str> [-toolchange (int)] \n" +
" name: Name of the object\n" +
" tools: Comma separated indexes of tools (example: 1,3 or 2)\n" +
" drillz: Drill depth into material (example: -2.0)\n" +
" travelz: Travel distance above material (example: 2.0)\n" +
" feedrate: Drilling feed rate\n" +
" outname: Name of object to create\n"
" outname: Name of object to create\n" +
" toolchange: Enable tool changes (example: 1)\n"
},
'scale': {
'fcn': lambda name, factor: self.collection.get_by_name(str(name)).scale(float(factor)),