本文整理匯總了Python中upconvert.writer.kicad.KiCAD.write_net方法的典型用法代碼示例。如果您正苦於以下問題:Python KiCAD.write_net方法的具體用法?Python KiCAD.write_net怎麽用?Python KiCAD.write_net使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類upconvert.writer.kicad.KiCAD
的用法示例。
在下文中一共展示了KiCAD.write_net方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_write_net
# 需要導入模塊: from upconvert.writer.kicad import KiCAD [as 別名]
# 或者: from upconvert.writer.kicad.KiCAD import write_net [as 別名]
def test_write_net(self):
"""
The write_net method creates the correct kicad wires from an
openjson net.
"""
net = Net('')
p1 = NetPoint('p1', 0, 0)
p2 = NetPoint('p2', 1, 0)
p3 = NetPoint('p3', 0, 1)
net.add_point(p1)
net.add_point(p2)
net.add_point(p3)
net.conn_point(p1, p2)
net.conn_point(p1, p3)
writer = KiCAD()
buf = StringIO()
writer.write_net(buf, net)
self.assertEqual(
buf.getvalue(),
'Wire Wire Line\n\t0 0 0 ' + str(int(-1 / MULT)) +
'\nWire Wire Line\n\t0 0 ' + str(int(1 / MULT)) +
' 0\n')