示例#1
0
文件: pcb.py 项目: mkovacs/kokopelli
 def layout(self):
     T = []
     if self.part_labels:
         T.append(s2d.color(self.part_labels, (125, 200, 60)))
     if self.pin_labels:
         T.append(s2d.color(self.pin_labels, (255, 90, 60)))
     if self.traces:
         T.append(s2d.color(self.traces, (125, 90, 60)))
     return T
示例#2
0
文件: pcb.py 项目: orb1t/kokopelli
 def layout(self):
     T = []
     if self.part_labels:
         T.append(s2d.color(self.part_labels, (125, 200, 60)))
     if self.pin_labels:
         T.append(s2d.color(self.pin_labels, (255, 90, 60)))
     if self.traces:
         T.append(s2d.color(self.traces, (125, 90, 60)))
     return T
示例#3
0
 def shapes(self, labels=True):
     if labels:
         T = []
         if self.pin_labels:
             T.append(s2d.color(self.pin_labels, (255, 0, 0)))
         if self.part_labels:
             T.append(s2d.color(self.part_labels, (20, 200, 20)))
         if self.traces:
             T.append(s2d.color(self.traces, (125, 90, 60)))
         return T
     else:
         return self.traces,
示例#4
0
 def shapes(self, value):
     if type(value) not in (list, tuple):
         raise TypeError(
             'cad.shapes must be a list or tuple of MathTree objects')
     value = map(MathTree.wrap, value)
     self._shapes = list(value)
     self._shape = reduce(operator.add,
                          [color(s, None) for s in self.shapes])
示例#5
0
 def function(self):
     if len(self.shapes) > 1:
         return reduce(operator.add,
             [color(s, None) for s in self.shapes])
     elif self.shapes:
         return self.shapes[0]
     else:
         return None
示例#6
0
 def shapes(self, value):
     if type(value) not in (list, tuple):
         raise TypeError('cad.shapes must be a list or tuple of MathTree objects')
     value = map(MathTree.wrap, value)
     self._shapes = list(value)
     self._shape = reduce(operator.add,
         [color(s, None) for s in self.shapes]
     )