Przeglądaj źródła

Add dwell and dwelltime options to drillcncjob command to match cncjob
command. Also add missing import to drillcncjob.

Chris Breneman 6 lat temu
rodzic
commit
155f6e66df
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9 0
      tclCommands/TclCommandDrillcncjob.py

+ 9 - 0
tclCommands/TclCommandDrillcncjob.py

@@ -1,5 +1,6 @@
 from ObjectCollection import *
 from tclCommands.TclCommand import TclCommandSignaled
+import math
 
 
 class TclCommandDrillcncjob(TclCommandSignaled):
@@ -27,6 +28,8 @@ class TclCommandDrillcncjob(TclCommandSignaled):
         ('toolchangez', float),
         ('toolchangexy', tuple),
         ('endz', float),
+        ('dwell', bool),
+        ('dwelltime', float),
         ('pp', str),
         ('outname', str),
         ('opt_type', str),
@@ -53,6 +56,8 @@ class TclCommandDrillcncjob(TclCommandSignaled):
             ('toolchangez', 'Z distance for toolchange (example: 30.0).'),
             ('toolchangexy', 'X, Y coordonates for toolchange in format (x, y) (example: (2.0, 3.1) ).'),
             ('endz', 'Z distance at job end (example: 30.0).'),
+            ('dwell', 'True or False; use (or not) the dwell'),
+            ('dwelltime', 'Time to pause to allow the spindle to reach the full speed'),
             ('pp', 'This is the Excellon postprocessor name: case_sensitive, no_quotes'),
             ('outname', 'Name of the resulting Geometry object.'),
             ('opt_type', 'Name of move optimization type. B by default for Basic OR-Tools, M for Metaheuristic OR-Tools'
@@ -177,6 +182,10 @@ class TclCommandDrillcncjob(TclCommandSignaled):
             job_obj.feedrate_rapid = args["feedrate_rapid"] \
                 if "feedrate_rapid" in args and args["feedrate_rapid"] else obj.options["feedrate_rapid"]
 
+            if args['dwell'] and args['dwelltime']:
+                job_obj.dwell = True
+                job_obj.dwelltime = float(args['dwelltime'])
+
             job_obj.spindlespeed = args["spindlespeed"] if "spindlespeed" in args else None
             job_obj.pp_excellon_name = args["pp"] if "pp" in args and args["pp"] \
                 else obj.options["ppname_e"]