Skip to content

Commit

Permalink
Excellon parser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei committed Jan 28, 2021
1 parent 4961505 commit 5937437
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gerbmerge/gerbmerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5937437

Please sign in to comment.