Excellon parser fix

This commit is contained in:
Andrei 2021-01-28 20:37:41 +02:00
parent 4961505254
commit 59374373ad
1 changed files with 9 additions and 1 deletions

View File

@ -172,6 +172,7 @@ def writeExcellonHeader(fid):
fid.write("INCH,%s\n" % zerosDef)
else: # metric - mm
fid.write("METRIC,%s\n" % zerosDef)
def writeExcellonHeaderEnd(fid):
fid.write('%\n')
def writeExcellonFooter(fid):
@ -180,6 +181,9 @@ def writeExcellonFooter(fid):
def writeExcellonTool(fid, tool, size):
fid.write('%sC%f\n' % (tool, size))
def writeExcellonToolSelection(fid, tool, size):
fid.write('%s\n' % (tool))
def writeFiducials(fid, drawcode, OriginX, OriginY, MaxXExtent, MaxYExtent):
"""Place fiducials at arbitrary points. The FiducialPoints list in the config specifies
sets of X,Y co-ordinates. Positive values of X/Y represent offsets from the lower left
@ -706,9 +710,13 @@ def merge(opts, args, gui = None):
size = config.GlobalToolMap[tool]
except:
raise RuntimeError, "INTERNAL ERROR: Tool code %s not found in global tool map" % tool
writeExcellonTool(fid, tool, size)
writeExcellonHeaderEnd(fid)
for tool in Tools:
size = config.GlobalToolMap[tool]
writeExcellonToolSelection(fid, tool, size)
#for row in Layout:
# row.writeExcellon(fid, size)
for job in Place.jobs: