From 980339e917de73fecb2f7e8881930ef0ec530102 Mon Sep 17 00:00:00 2001 From: uenz Date: Mon, 28 Dec 2020 22:21:33 +0100 Subject: [PATCH 1/3] Fixed TclCommandMillDrills --- tclCommands/TclCommandMillDrills.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tclCommands/TclCommandMillDrills.py b/tclCommands/TclCommandMillDrills.py index ece29c45..9431bf73 100644 --- a/tclCommands/TclCommandMillDrills.py +++ b/tclCommands/TclCommandMillDrills.py @@ -22,7 +22,8 @@ class TclCommandMillDrills(TclCommandSignaled): # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon) aliases = ['milldrills', 'milld'] - description = '%s %s' % ("--", "Create a Geometry Object for milling drill holes from Excellon.") + description = '%s %s' % ( + "--", "Create a Geometry Object for milling drill holes from Excellon.") # Dictionary of types from Tcl command, needs to be ordered arg_names = collections.OrderedDict([ @@ -126,19 +127,19 @@ class TclCommandMillDrills(TclCommandSignaled): args['tools'] = req_tools - # no longer needed - del args['milled_dias'] - del args['diatol'] - # Split and put back. We are passing the whole dictionary later. # args['milled_dias'] = [x.strip() for x in args['tools'].split(",")] else: args['tools'] = 'all' + # no longer needed, delete from dict if in keys + args.pop('milled_dias', None) + args.pop('diatol', None) except Exception as e: self.raise_tcl_error("Bad tools: %s" % str(e)) if obj.kind != 'excellon': - self.raise_tcl_error('Only Excellon objects can be mill-drilled, got %s %s.' % (name, type(obj))) + self.raise_tcl_error( + 'Only Excellon objects can be mill-drilled, got %s %s.' % (name, type(obj))) if self.app.collection.has_promises(): self.raise_tcl_error('!!!Promises exists, but should not here!!!') @@ -146,7 +147,7 @@ class TclCommandMillDrills(TclCommandSignaled): try: # 'name' is not an argument of obj.generate_milling() del args['name'] - + print(args) # This runs in the background... Is blocking handled? success, msg = obj.generate_milling_drills(plot=False, **args) except Exception as e: From d8880653a4144ff655de51d04a4497b086e35bed Mon Sep 17 00:00:00 2001 From: uenz Date: Mon, 28 Dec 2020 22:27:03 +0100 Subject: [PATCH 2/3] Removed debug output --- tclCommands/TclCommandMillDrills.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tclCommands/TclCommandMillDrills.py b/tclCommands/TclCommandMillDrills.py index 9431bf73..7cd0a9b0 100644 --- a/tclCommands/TclCommandMillDrills.py +++ b/tclCommands/TclCommandMillDrills.py @@ -147,7 +147,7 @@ class TclCommandMillDrills(TclCommandSignaled): try: # 'name' is not an argument of obj.generate_milling() del args['name'] - print(args) + # This runs in the background... Is blocking handled? success, msg = obj.generate_milling_drills(plot=False, **args) except Exception as e: From 048833767261b73b061b0124f34d3c75be117870 Mon Sep 17 00:00:00 2001 From: uenz Date: Thu, 31 Dec 2020 21:18:32 +0100 Subject: [PATCH 3/3] Fix in tooldia acces in tool dict --- tclCommands/TclCommandMillDrills.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tclCommands/TclCommandMillDrills.py b/tclCommands/TclCommandMillDrills.py index 7cd0a9b0..336c1a99 100644 --- a/tclCommands/TclCommandMillDrills.py +++ b/tclCommands/TclCommandMillDrills.py @@ -105,7 +105,7 @@ class TclCommandMillDrills(TclCommandSignaled): req_tools = set() for tool in obj.tools: 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))) if 'diatol' in args: