- when using .keys method (in Python3 is no longer atomic operation) to

make it more resilient to multithreading I've added the more costing
operation of copy().
This commit is contained in:
Marius Stanciu
2018-05-29 03:42:35 +03:00
parent 5c6b68d7cb
commit 4c0884e16d

View File

@@ -729,20 +729,20 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
exc_final.drills.append({"point": point, "tool": drill['tool']})
toolsrework=dict()
max_numeric_tool=0
for toolname in list(exc.tools.keys()):
for toolname in list(exc.tools.copy().keys()):
numeric_tool=int(toolname)
if numeric_tool>max_numeric_tool:
max_numeric_tool=numeric_tool
toolsrework[exc.tools[toolname]['C']]=toolname
#exc_final as last because names from final tools will be used
for toolname in list(exc_final.tools.keys()):
for toolname in list(exc_final.tools.copy().keys()):
numeric_tool=int(toolname)
if numeric_tool>max_numeric_tool:
max_numeric_tool=numeric_tool
toolsrework[exc_final.tools[toolname]['C']]=toolname
for toolvalues in list(toolsrework.keys()):
for toolvalues in list(toolsrework.copy().keys()):
if toolsrework[toolvalues] in exc_final.tools:
if exc_final.tools[toolsrework[toolvalues]]!={"C": toolvalues}:
exc_final.tools[str(max_numeric_tool+1)]={"C": toolvalues}