Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excellon parser fix #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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