From bd40265bf4a2d3855695acb63fa7a4004233362b Mon Sep 17 00:00:00 2001 From: Adam Coddington Date: Tue, 23 Feb 2021 13:44:05 -0800 Subject: [PATCH 1/2] Do not ignore the name requested by the caller. --- appObjects/FlatCAMExcellon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appObjects/FlatCAMExcellon.py b/appObjects/FlatCAMExcellon.py index c5bac25c..8f62d90f 100644 --- a/appObjects/FlatCAMExcellon.py +++ b/appObjects/FlatCAMExcellon.py @@ -964,7 +964,7 @@ class ExcellonObject(FlatCAMObj, Excellon): tools = self.get_selected_tools_list() if outname is None: - outname = self.options["name"] + "_mill" + outname = self.options["name"] + "_slot" if tooldia is None: tooldia = float(self.options["slot_tooldia"]) @@ -1038,7 +1038,7 @@ class ExcellonObject(FlatCAMObj, Excellon): if use_thread: def geo_thread(a_obj): - a_obj.app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot) + a_obj.app_obj.new_object("geometry", outname, geo_init, plot=plot) # Create a promise with the new name self.app.collection.promise(outname) @@ -1046,7 +1046,7 @@ class ExcellonObject(FlatCAMObj, Excellon): # Send to worker self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]}) else: - self.app.app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot) + self.app.app_obj.new_object("geometry", outname, geo_init, plot=plot) return True, "" From 8f22fe7e5c076b5f36ad441de98576a2b47ca0c0 Mon Sep 17 00:00:00 2001 From: Adam Coddington Date: Tue, 23 Feb 2021 13:44:55 -0800 Subject: [PATCH 2/2] 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 --- tclCommands/TclCommandMillSlots.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tclCommands/TclCommandMillSlots.py b/tclCommands/TclCommandMillSlots.py index 7580a828..8d7eb153 100644 --- a/tclCommands/TclCommandMillSlots.py +++ b/tclCommands/TclCommandMillSlots.py @@ -93,9 +93,9 @@ class TclCommandMillSlots(TclCommandSignaled): else: 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() try: if 'milled_dias' in args and args['milled_dias'] != 'all': @@ -105,7 +105,7 @@ class TclCommandMillSlots(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: @@ -128,8 +128,8 @@ class TclCommandMillSlots(TclCommandSignaled): args['tools'] = req_tools # 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. # args['milled_dias'] = [x.strip() for x in args['tools'].split(",")]