diff --git a/README.md b/README.md index 5004a6bc..52c1fd4a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ CAD program, and create G-Code for Isolation routing. - fixed issue #363. The Tcl command drillcncjob does not create tool cut, does not allow creation of gcode, it forces the usage of dwell and dwelltime parameters - in NCC Tool I've added a warning so the user is warned that the NCC margin has to have a value of at least the tool diameter that is doing an iso_op job in the Tool Table - 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 +- modified the extracut and multidepth parameters in Cncjob Tcl command like for dwell and toolchange 30.12.2019 diff --git a/tclCommands/TclCommandCncjob.py b/tclCommands/TclCommandCncjob.py index 53e294ce..eeaa4321 100644 --- a/tclCommands/TclCommandCncjob.py +++ b/tclCommands/TclCommandCncjob.py @@ -33,8 +33,6 @@ class TclCommandCncjob(TclCommandSignaled): ('feedrate', float), ('feedrate_z', float), ('feedrate_rapid', float), - ('multidepth', bool), - ('extracut', bool), ('extracut_length', float), ('depthperpass', float), ('toolchangez', float), @@ -62,11 +60,8 @@ class TclCommandCncjob(TclCommandSignaled): ('feedrate', 'Moving speed on X-Y plane when cutting.'), ('feedrate_z', 'Moving speed on Z plane when cutting.'), ('feedrate_rapid', 'Rapid moving at speed when cutting.'), - ('multidepth', 'Use or not multidepth cnc cut. (True or False)'), - ('extracut', 'Use or not an extra cnccut over the first point in path,in the job end (example: True)'), - ('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).'), + ('extracut_length', 'The value for extra cnccut over the first point in path,in the job end; float'), + ('depthperpass', 'If present then use multidepth cnc cut. Height of one layer for multidepth.'), ('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) ).'), @@ -135,16 +130,23 @@ class TclCommandCncjob(TclCommandSignaled): args["feedrate_rapid"] = args["feedrate_rapid"] if "feedrate_rapid" in args and args["feedrate_rapid"] else \ obj.options["feedrate_rapid"] - 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"] - if "extracut_length" in args: - args["extracut_length"] = float(args["extracut_length"]) + args["extracut"] = True + if args["extracut_length"] is None: + args["extracut_length"] = 0.0 + else: + args["extracut_length"] = float(args["extracut_length"]) else: - args["extracut_length"] = 0.0 + args["extracut"] = False - args["depthperpass"] = args["depthperpass"] if "depthperpass" in args and args["depthperpass"] else \ - obj.options["depthperpass"] + if "depthperpass" in args: + args["multidepth"] = True + if args["depthperpass"] is None: + args["depthperpass"] = obj.options["depthperpass"] + else: + args["depthperpass"] = float(args["depthperpass"]) + else: + args["multidepth"] = False args["startz"] = args["startz"] if "startz" in args and args["startz"] else \ self.app.defaults["geometry_startz"] @@ -154,10 +156,10 @@ class TclCommandCncjob(TclCommandSignaled): if 'dwelltime' in args: args["dwell"] = True - if args['dwelltime'] is not None: - args["dwelltime"] = float(args['dwelltime']) - else: + if args['dwelltime'] is None: args["dwelltime"] = float(obj.options["dwelltime"]) + else: + args["dwelltime"] = float(args['dwelltime']) else: args["dwell"] = False args["dwelltime"] = 0.0 diff --git a/tclCommands/TclCommandDrillcncjob.py b/tclCommands/TclCommandDrillcncjob.py index 8178d9ad..a815569c 100644 --- a/tclCommands/TclCommandDrillcncjob.py +++ b/tclCommands/TclCommandDrillcncjob.py @@ -26,11 +26,9 @@ class TclCommandDrillcncjob(TclCommandSignaled): ('feedrate', float), ('feedrate_rapid', float), ('spindlespeed', int), - ('toolchange', bool), ('toolchangez', float), ('toolchangexy', tuple), ('endz', float), - ('dwell', bool), ('dwelltime', float), ('pp', str), ('outname', str), @@ -55,7 +53,6 @@ class TclCommandDrillcncjob(TclCommandSignaled): ('feedrate', 'Drilling feed rate.'), ('feedrate_rapid', 'Rapid drilling feed rate.'), ('spindlespeed', 'Speed of the spindle in rpm (example: 4000).'), - ('toolchange', 'Enable tool changes (example: True).'), ('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) ).'), @@ -221,8 +218,7 @@ class TclCommandDrillcncjob(TclCommandSignaled): job_obj.options['xmax'] = xmax job_obj.options['ymax'] = ymax - job_obj.generate_from_excellon_by_tool(obj, tools, drillz=drillz, toolchangez=toolchangez, - endz=endz, + job_obj.generate_from_excellon_by_tool(obj, tools, drillz=drillz, toolchangez=toolchangez, endz=endz, toolchange=toolchange, excellon_optimization_type=opt_type) for t_item in job_obj.exc_cnc_tools: