Merged in fixes_for_millslots (pull request #343)

Fixes for TclCommandMillSlots
This commit is contained in:
Adam Coddington 2021-04-05 17:10:31 +00:00 committed by Marius Stanciu
commit a64d01b55c
2 changed files with 9 additions and 9 deletions

View File

@ -965,7 +965,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
tools = self.get_selected_tools_list() tools = self.get_selected_tools_list()
if outname is None: if outname is None:
outname = self.options["name"] + "_mill" outname = self.options["name"] + "_slot"
if tooldia is None: if tooldia is None:
tooldia = float(self.options["slot_tooldia"]) tooldia = float(self.options["slot_tooldia"])
@ -1039,7 +1039,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
if use_thread: if use_thread:
def geo_thread(a_obj): 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 # Create a promise with the new name
self.app.collection.promise(outname) self.app.collection.promise(outname)
@ -1047,7 +1047,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
# Send to worker # Send to worker
self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]}) self.app.worker_task.emit({'fcn': geo_thread, 'params': [self.app]})
else: 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, "" return True, ""

View File

@ -93,9 +93,9 @@ class TclCommandMillSlots(TclCommandSignaled):
else: else:
args['use_thread'] = False args['use_thread'] = False
if not obj.slots: # if not obj.slots:
self.raise_tcl_error("The Excellon object has no slots: %s" % name) # 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'] args.pop('milled_dias', None)
del args['diatol'] 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(",")]