Beispiel #1
0
 def itemize(self):
     return Item('ElementLine' if self.element else 'SymbolLine', [
         nm(self.x1),
         nm(self.y1),
         nm(self.x2),
         nm(self.y2),
         nm(self.thick)
     ])
Beispiel #2
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 #3
0
 def itemize(self):
     return Item('ElementArc', [
         nm(self.x),
         nm(self.y),
         nm(self.width),
         nm(self.height),
         NumericValue(self.startAngle),
         NumericValue(self.angle),
         nm(self.thick)
     ])
Beispiel #4
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 #5
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 #6
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 #7
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 #8
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 #9
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 #10
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 #11
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 #12
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])
Beispiel #13
0
 def itemize(self):
     return Item('Hole', None, False,
                 [Item('', [nm(p[0]), nm(p[1])]) for p in self.points])
Beispiel #14
0
 def __str__(self):
     return self.name + ',' + str(nm(self.thick)) + ',' + str(
         nm(self.diameter)) + ',' + str(nm(self.drill)) + ',' + str(
             nm(self.spacing))
Beispiel #15
0
 def itemize(self):
     return Item(
         "Symbol",
         [CharValue(self.char), nm(self.delta)], False,
         [l.itemize() for l in self.lines])