Modified jobs/writeCutLines to use the boardoutline file (if available

and specified in the layout.cfg file (as CutLineLayers) ) instead of
generated cutlines
This commit is contained in:
Scott Daniels 2013-04-28 14:57:21 -05:00
parent 0b1315952f
commit a65d1c9011
5 changed files with 92 additions and 50 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.pyc
/nbproject/private/

View File

@ -566,6 +566,7 @@ def merge(opts, args, gui = None):
if config.Config['cutlinelayers'] and (layername in config.Config['cutlinelayers']):
fid.write('%s*\n' % drawing_code_cut) # Choose drawing aperture
#print "writing drawcode_cut: %s" % drawing_code_cut
job.writeCutLines(fid, drawing_code_cut, OriginX, OriginY, MaxXExtent, MaxYExtent)
if config.Config['cropmarklayers']:

View File

@ -1138,8 +1138,30 @@ class JobLayout:
def notEdge(x, X):
return round(abs(1000*(x-X)))
assert self.x and self.y
#assert self.x and self.y
#if job has a boardoutline layer, write it, else calculate one
outline_layer = 'boardoutline';
if self.job.hasLayer(outline_layer):
# somewhat of a hack here; making use of code in gerbmerge, around line 516,
# we are going to replace the used of the existing draw code in the boardoutline
# file with the one passed in (which was created from layout.cfg ('CutLineWidth')
# It is a hack in that we are assuming there is only one draw code in the
# boardoutline file. We are just going to ignore that definition and change
# all usages of that code to our new one. As a side effect, it will make
# the merged boardoutline file invalid, but we aren't using it with this method.
temp = []
for x in self.job.commands[outline_layer]:
if x[0] == 'D':
temp.append(drawing_code) ## replace old aperture with new one
else:
temp.append(x) ## keep old command
self.job.commands[outline_layer] = temp
#self.job.writeGerber(fid, outline_layer, X1, Y1)
self.writeGerber(fid, outline_layer)
else:
radius = config.GAT[drawing_code].dimx/2.0
# Start at lower-left, proceed clockwise

View File

@ -0,0 +1,5 @@
gerbmerge.dir=gerbmerge
java.lib.path=
main.file=gerbmerge.py
platform.active=Python_2.7.3
python.lib.path=/home/scott/development/gerbmerge|

13
nbproject/project.xml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.python.project</type>
<configuration>
<data xmlns="http://nbpython.dev.java.net/ns/php-project/1">
<name>NewPythonProject</name>
<sources>
<root id="gerbmerge.dir"/>
</sources>
<tests/>
</data>
</configuration>
</project>