- modified the Drillcncjob and Cncjob Tcl commands to be allowed to work without the 'dwell' and 'toolchange' arguments. If 'dwelltime' argument is present it will be assumed that the 'dwell' is True and the same for 'toolchangez' parameter, if present then 'toolchange' will be assumed to be True, else False
This commit is contained in:
@@ -37,13 +37,11 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
('extracut', bool),
|
||||
('extracut_length', float),
|
||||
('depthperpass', float),
|
||||
('toolchange', int),
|
||||
('toolchangez', float),
|
||||
('toolchangexy', tuple),
|
||||
('startz', float),
|
||||
('endz', float),
|
||||
('spindlespeed', int),
|
||||
('dwell', bool),
|
||||
('dwelltime', float),
|
||||
('pp', str),
|
||||
('muted', int),
|
||||
@@ -69,13 +67,14 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
('extracut', 'The value for extra cnccut over the first point in path,in the job end; float'),
|
||||
('depthperpass', 'Height of one layer for multidepth.'),
|
||||
('toolchange', 'Enable tool changes (example: True).'),
|
||||
('toolchangez', 'Z distance for toolchange (example: 30.0).'),
|
||||
('toolchangez', 'Z distance for toolchange (example: 30.0).\n'
|
||||
'If used in the command then a toolchange event will be included in gcode'),
|
||||
('toolchangexy', 'X, Y coordonates for toolchange in format (x, y) (example: (2.0, 3.1) ).'),
|
||||
('startz', 'Height before the first move.'),
|
||||
('endz', 'Height where the last move will park.'),
|
||||
('spindlespeed', 'Speed of the spindle in rpm (example: 4000).'),
|
||||
('dwell', 'True or False; use (or not) the dwell'),
|
||||
('dwelltime', 'Time to pause to allow the spindle to reach the full speed'),
|
||||
('dwelltime', 'Time to pause to allow the spindle to reach the full speed.\n'
|
||||
'If it is not used in command then it will not be included'),
|
||||
('outname', 'Name of the resulting Geometry object.'),
|
||||
('pp', 'Name of the Geometry preprocessor. No quotes, case sensitive'),
|
||||
('muted', 'It will not put errors in the Shell.')
|
||||
@@ -138,8 +137,12 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
|
||||
args["multidepth"] = bool(args["multidepth"]) if "multidepth" in args else obj.options["multidepth"]
|
||||
args["extracut"] = bool(args["extracut"]) if "extracut" in args else obj.options["extracut"]
|
||||
args["extracut_length"] = float(args["extracut_length"]) if "extracut_length" in args else \
|
||||
obj.options["extracut_length"]
|
||||
|
||||
if "extracut_length" in args:
|
||||
args["extracut_length"] = float(args["extracut_length"])
|
||||
else:
|
||||
args["extracut_length"] = 0.0
|
||||
|
||||
args["depthperpass"] = args["depthperpass"] if "depthperpass" in args and args["depthperpass"] else \
|
||||
obj.options["depthperpass"]
|
||||
|
||||
@@ -148,14 +151,29 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
args["endz"] = args["endz"] if "endz" in args and args["endz"] else obj.options["endz"]
|
||||
|
||||
args["spindlespeed"] = args["spindlespeed"] if "spindlespeed" in args and args["spindlespeed"] != 0 else None
|
||||
args["dwell"] = bool(args["dwell"]) if "dwell" in args else obj.options["dwell"]
|
||||
args["dwelltime"] = args["dwelltime"] if "dwelltime" in args and args["dwelltime"] else obj.options["dwelltime"]
|
||||
|
||||
if 'dwelltime' in args:
|
||||
args["dwell"] = True
|
||||
if args['dwelltime'] is not None:
|
||||
args["dwelltime"] = float(args['dwelltime'])
|
||||
else:
|
||||
args["dwelltime"] = float(obj.options["dwelltime"])
|
||||
else:
|
||||
args["dwell"] = False
|
||||
args["dwelltime"] = 0.0
|
||||
|
||||
args["pp"] = args["pp"] if "pp" in args and args["pp"] else obj.options["ppname_g"]
|
||||
|
||||
args["toolchange"] = True if "toolchange" in args and args["toolchange"] == 1 else False
|
||||
args["toolchangez"] = args["toolchangez"] if "toolchangez" in args and args["toolchangez"] else \
|
||||
obj.options["toolchangez"]
|
||||
if "toolchangez" in args:
|
||||
args["toolchange"] = True
|
||||
if args["toolchangez"] is not None:
|
||||
args["toolchangez"] = args["toolchangez"]
|
||||
else:
|
||||
args["toolchangez"] = obj.options["toolchangez"]
|
||||
else:
|
||||
args["toolchange"] = False
|
||||
args["toolchangez"] = 0.0
|
||||
|
||||
args["toolchangexy"] = args["toolchangexy"] if "toolchangexy" in args and args["toolchangexy"] else \
|
||||
self.app.defaults["geometry_toolchangexy"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user