Fix AMParamStmt to_gerber to write changes back.
AMParamStmt was not calling to_gerber on each of its primitives on his own to_gerber method. That way primitives that changes after reading, such as when you call to_inch/to_metric was failing because it was writing only the original macro back.
This commit is contained in:
parent
c9c1313d59
commit
49dadd46ee
2 changed files with 3 additions and 3 deletions
|
|
@ -440,7 +440,7 @@ class AMParamStmt(ParamStmt):
|
|||
primitive.to_metric()
|
||||
|
||||
def to_gerber(self, settings=None):
|
||||
return '%AM{0}*{1}*%'.format(self.name, self.macro)
|
||||
return '%AM{0}*{1}%'.format(self.name, "".join([primitive.to_gerber() for primitive in self.primitives]))
|
||||
|
||||
def __str__(self):
|
||||
return '<Aperture Macro %s: %s>' % (self.name, self.macro)
|
||||
|
|
|
|||
|
|
@ -446,11 +446,11 @@ def testAMParamStmt_conversion():
|
|||
|
||||
def test_AMParamStmt_dump():
|
||||
name = 'POLYGON'
|
||||
macro = '5,1,8,25.4,25.4,25.4,0'
|
||||
macro = '5,1,8,25.4,25.4,25.4,0.0'
|
||||
s = AMParamStmt.from_dict({'param': 'AM', 'name': name, 'macro': macro })
|
||||
s.build()
|
||||
|
||||
assert_equal(s.to_gerber(), '%AMPOLYGON*5,1,8,25.4,25.4,25.4,0*%')
|
||||
assert_equal(s.to_gerber(), '%AMPOLYGON*5,1,8,25.4,25.4,25.4,0.0*%')
|
||||
|
||||
def test_AMParamStmt_string():
|
||||
name = 'POLYGON'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue