Beispiel #1
0
 def itemize(self):
     return Item('Text', [
         nm(self.x),
         nm(self.y),
         NumericValue(self.dir),
         NumericValue(self.scale),
         StringValue(self.string),
         flags(self.flags)
     ])
Beispiel #2
0
 def itemize(self):
     return Item('Layer', [
         NumericValue(self.number),
         StringValue(self.name),
         flags(self.flags)
     ], True, [
         g.itemize()
         for g in (self.lines + self.texts + self.arcs + self.polygons)
     ])
Beispiel #3
0
 def itemize(self):
     return Item('Rat', [
         nm(self.x1),
         nm(self.y1),
         NumericValue(self.g1),
         nm(self.x2),
         nm(self.y2),
         NumericValue(self.g2),
         flags(self.flags)
     ])
Beispiel #4
0
 def itemize(self):
     return Item('Line', [
         nm(self.x1),
         nm(self.y1),
         nm(self.x2),
         nm(self.y2),
         nm(self.thick),
         nm(self.spacing),
         flags(self.flags)
     ])
Beispiel #5
0
 def itemize(self):
     return Item('Via', [
         nm(self.x),
         nm(self.y),
         nm(self.diameter),
         nm(self.spacing),
         nm(self.mask),
         nm(self.drill)
     ] + ([self.burrFrom, self.burrTo] if self.burrTo else []) +
                 [self.name, flags(self.flags)])
Beispiel #6
0
 def itemize(self):
     return Item('Pin', [
         nm(self.x),
         nm(self.y),
         nm(self.dimater),
         nm(self.spacing),
         nm(self.mask),
         nm(self.drill),
         StringValue(self.name),
         StringValue(self.number),
         flags(self.flags)
     ])
Beispiel #7
0
 def itemize(self):
     return Item('Arc', [
         nm(self.x),
         nm(self.y),
         nm(self.width),
         nm(self.height),
         nm(self.thick),
         nm(self.spacing),
         NumericValue(self.startAngle),
         NumericValue(self.angle),
         flags(self.flags)
     ])
Beispiel #8
0
 def itemize(self):
     return Item('Pad', [
         nm(self.x1),
         nm(self.y1),
         nm(self.x2),
         nm(self.y2),
         nm(self.thick),
         nm(self.spacing),
         nm(self.mask),
         StringValue(self.name),
         StringValue(self.number),
         flags(self.flags)
     ])
Beispiel #9
0
 def itemize(self):
     items = []
     for c in self.comments:
         items.append(Item("comment", [c]))
     items.append(Item("FileVersion", [self.version]))
     items.append(Item("PCB", [self.name, nm(self.width), nm(self.height)]))
     items.append(
         Item("Grid", [
             nm(self.gridStep),
             nm(self.gridX),
             nm(self.gridY), self.gridVisible
         ]))
     items.append(
         Item("PolyArea",
              [NumericValue(self.polyArea)]))  #helper function number
     items.append(Item("Thermal", [NumericValue(self.thermal)]))
     items.append(
         Item("DRC", [
             nm(self.minSpace),
             nm(self.minOverlap),
             nm(self.minWidth),
             nm(self.minSilk),
             nm(self.minDrill),
             nm(self.minRing)
         ]))
     items.append(Item("Flags", [flags(self.flags)], True))
     items.append(
         Item("Groups",
              [StringValue(':'.join([','.join(g) for g in self.groups]))],
              True))
     items.append(
         Item("Styles",
              [StringValue(':'.join([str(s) for s in self.styles]))],
              False))
     for s in self.symbols:
         items.append(s.itemize())
     for k, v in self.attributes.items():
         items.append(
             Item('Attribute',
                  [StringValue(k), StringValue(v)], True))
     for v in self.vias:
         items.append(v.itemize())
     for e in self.elements:
         items.append(e.itemize())
     for r in self.rats:
         items.append(r.itemize())
     for l in self.layers:
         items.append(l.itemize())
     items.append(self.netlist.itemize())
     return items
Beispiel #10
0
 def itemize(self):
     items = []
     for k, v in self.attributes.items():
         items.append(
             Item('Attribute',
                  [StringValue(k), StringValue(v)], True))
     return Item(
         'Element', [
             flags(self.flags),
             StringValue(self.description),
             StringValue(self.name),
             StringValue(self.value),
             nm(self.x),
             nm(self.y),
             nm(self.textx),
             nm(self.texty),
             NumericValue(self.tdir),
             NumericValue(self.tscale),
             flags(self.flags)
         ], False, items + [
             l.itemize()
             for l in (self.lines + self.arcs + self.pins + self.pads)
         ])
Beispiel #11
0
 def itemize(self):
     return Item('Polygon', [flags(self.flags)], True,
                 [Item('', [nm(p[0]), nm(p[1])])
                  for p in self.points] + [h.itemize() for h in self.holes])