Просмотр исходного кода

- modified the extracut and multidepth parameters in Cncjob Tcl command like for dwell and toolchange

Marius Stanciu 6 лет назад
Родитель
Сommit
0447839e43
3 измененных файлов с 21 добавлено и 22 удалено
  1. 1 0
      README.md
  2. 19 17
      tclCommands/TclCommandCncjob.py
  3. 1 5
      tclCommands/TclCommandDrillcncjob.py

+ 1 - 0
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
 - 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
 - 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 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
 30.12.2019
 
 

+ 19 - 17
tclCommands/TclCommandCncjob.py

@@ -33,8 +33,6 @@ class TclCommandCncjob(TclCommandSignaled):
         ('feedrate', float),
         ('feedrate', float),
         ('feedrate_z', float),
         ('feedrate_z', float),
         ('feedrate_rapid', float),
         ('feedrate_rapid', float),
-        ('multidepth', bool),
-        ('extracut', bool),
         ('extracut_length', float),
         ('extracut_length', float),
         ('depthperpass', float),
         ('depthperpass', float),
         ('toolchangez', float),
         ('toolchangez', float),
@@ -62,11 +60,8 @@ class TclCommandCncjob(TclCommandSignaled):
             ('feedrate', 'Moving speed on X-Y plane when cutting.'),
             ('feedrate', 'Moving speed on X-Y plane when cutting.'),
             ('feedrate_z', 'Moving speed on Z plane when cutting.'),
             ('feedrate_z', 'Moving speed on Z plane when cutting.'),
             ('feedrate_rapid', 'Rapid moving at speed 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'
             ('toolchangez', 'Z distance for toolchange (example: 30.0).\n'
                             'If used in the command then a toolchange event will be included in gcode'),
                             '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) ).'),
             ('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 \
         args["feedrate_rapid"] = args["feedrate_rapid"] if "feedrate_rapid" in args and args["feedrate_rapid"] else \
             obj.options["feedrate_rapid"]
             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:
         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:
         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 \
         args["startz"] = args["startz"] if "startz" in args and args["startz"] else \
             self.app.defaults["geometry_startz"]
             self.app.defaults["geometry_startz"]
@@ -154,10 +156,10 @@ class TclCommandCncjob(TclCommandSignaled):
 
 
         if 'dwelltime' in args:
         if 'dwelltime' in args:
             args["dwell"] = True
             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"])
                 args["dwelltime"] = float(obj.options["dwelltime"])
+            else:
+                args["dwelltime"] = float(args['dwelltime'])
         else:
         else:
             args["dwell"] = False
             args["dwell"] = False
             args["dwelltime"] = 0.0
             args["dwelltime"] = 0.0

+ 1 - 5
tclCommands/TclCommandDrillcncjob.py

@@ -26,11 +26,9 @@ class TclCommandDrillcncjob(TclCommandSignaled):
         ('feedrate', float),
         ('feedrate', float),
         ('feedrate_rapid', float),
         ('feedrate_rapid', float),
         ('spindlespeed', int),
         ('spindlespeed', int),
-        ('toolchange', bool),
         ('toolchangez', float),
         ('toolchangez', float),
         ('toolchangexy', tuple),
         ('toolchangexy', tuple),
         ('endz', float),
         ('endz', float),
-        ('dwell', bool),
         ('dwelltime', float),
         ('dwelltime', float),
         ('pp', str),
         ('pp', str),
         ('outname', str),
         ('outname', str),
@@ -55,7 +53,6 @@ class TclCommandDrillcncjob(TclCommandSignaled):
             ('feedrate', 'Drilling feed rate.'),
             ('feedrate', 'Drilling feed rate.'),
             ('feedrate_rapid', 'Rapid drilling feed rate.'),
             ('feedrate_rapid', 'Rapid drilling feed rate.'),
             ('spindlespeed', 'Speed of the spindle in rpm (example: 4000).'),
             ('spindlespeed', 'Speed of the spindle in rpm (example: 4000).'),
-            ('toolchange', 'Enable tool changes (example: True).'),
             ('toolchangez', 'Z distance for toolchange (example: 30.0).\n'
             ('toolchangez', 'Z distance for toolchange (example: 30.0).\n'
                             'If used in the command then a toolchange event will be included in gcode'),
                             '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) ).'),
             ('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['xmax'] = xmax
             job_obj.options['ymax'] = ymax
             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)
                                                    toolchange=toolchange, excellon_optimization_type=opt_type)
 
 
             for t_item in job_obj.exc_cnc_tools:
             for t_item in job_obj.exc_cnc_tools: