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

Replicating fixes from TclCommandMillDrills.

TclCommandMillSlots was clearly based upon TclCommandMillDrills,
and several fixes have been received over the last year for
TclCommandMillDrills that are also necessary for this command.

See these commits for the fixes applied here:

- 048833767261b73b061b0124f34d3c75be117870
- 980339e917de73fecb2f7e8881930ef0ec530102
- 40f5bf9c120adecbed0cba1428e6626fd7f37bcc
Adam Coddington 5 лет назад
Родитель
Сommit
8f22fe7e5c
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      tclCommands/TclCommandMillSlots.py

+ 6 - 6
tclCommands/TclCommandMillSlots.py

@@ -93,9 +93,9 @@ class TclCommandMillSlots(TclCommandSignaled):
         else:
         else:
             args['use_thread'] = False
             args['use_thread'] = False
 
 
-        if not obj.slots:
-            self.raise_tcl_error("The Excellon object has no slots: %s" % name)
-
+#        if not obj.slots:
+#            self.raise_tcl_error("The Excellon object has no slots: %s" % name)
+#
         # units = self.app.defaults['units'].upper()
         # units = self.app.defaults['units'].upper()
         try:
         try:
             if 'milled_dias' in args and args['milled_dias'] != 'all':
             if 'milled_dias' in args and args['milled_dias'] != 'all':
@@ -105,7 +105,7 @@ class TclCommandMillSlots(TclCommandSignaled):
                 req_tools = set()
                 req_tools = set()
                 for tool in obj.tools:
                 for tool in obj.tools:
                     for req_dia in diameters:
                     for req_dia in diameters:
-                        obj_dia_form = float('%.*f' % (obj.decimals, float(obj.tools[tool]["C"])))
+                        obj_dia_form = float('%.*f' % (obj.decimals, float(obj.tools[tool]["tooldia"])))
                         req_dia_form = float('%.*f' % (obj.decimals, float(req_dia)))
                         req_dia_form = float('%.*f' % (obj.decimals, float(req_dia)))
 
 
                         if 'diatol' in args:
                         if 'diatol' in args:
@@ -128,8 +128,8 @@ class TclCommandMillSlots(TclCommandSignaled):
                 args['tools'] = req_tools
                 args['tools'] = req_tools
 
 
                 # no longer needed
                 # no longer needed
-                del args['milled_dias']
-                del args['diatol']
+                args.pop('milled_dias', None)
+                args.pop('diatol', None)
 
 
                 # Split and put back. We are passing the whole dictionary later.
                 # Split and put back. We are passing the whole dictionary later.
                 # args['milled_dias'] = [x.strip() for x in args['tools'].split(",")]
                 # args['milled_dias'] = [x.strip() for x in args['tools'].split(",")]