refactor
Hamilton Kibbe 2014-10-06 23:52:57 -04:00
rodzic 22a6f87e94
commit 2abb7159be
3 zmienionych plików z 11 dodań i 3 usunięć

Wyświetl plik

@ -163,7 +163,7 @@ class ExcellonParser(object):
self.active_tool = self.tools[stmt.tool]
#self.active_tool = self.tools[int(line.strip().split('T')[1])]
self.statements.append(stmt)
elif line[0] in ['X', 'Y']:
stmt = CoordinateStmt.from_excellon(line, fmt, zs)
x = stmt.x
@ -194,7 +194,6 @@ class ExcellonParser(object):
if self.ctx is not None:
self.ctx.drill(self.pos[0], self.pos[1],
self.active_tool.diameter)
else:
self.statements.append(UnknownStmt.from_excellon(line))

Wyświetl plik

@ -151,7 +151,7 @@ class ExcellonTool(ExcellonStatement):
else:
stmt += 'S%g' % self.rpm / 1000.
if self.diameter is not None:
stmt += 'C%s' % decimal_string(self.diameter, 5, True)
stmt += 'C%s' % decimal_string(self.diameter, fmt[1], True)
if self.depth_offset is not None:
stmt += 'Z%s' % write_gerber_value(self.depth_offset, fmt, zs)
return stmt

Wyświetl plik

@ -87,6 +87,15 @@ def test_IPParamStmt_dump():
assert_equal(ip.to_gerber(), '%IPNEG*%')
def test_OFParamStmt_factory():
""" Test OFParamStmt factory correctly handles parameters
"""
stmt = {'param': 'OF', 'a': '0.1234567', 'b':'0.1234567'}
of = OFParamStmt.from_dict(stmt)
assert_equal(of.a, 0.1234567)
assert_equal(of.b, 0.1234567)
def test_OFParamStmt_dump():
""" Test OFParamStmt to_gerber()
"""