def __init__(self, name, refDes=defaults.icRefDes, parts=1, package="SOIC"):
     super().__init__(name, refDes)
     if package=="SOIC" and parts==1:
         pinNumbers=[3,2,6,4,7,1,8,5]
         self.symbols.append(symbolOpamp(name,pinNumbers=pinNumbers, variant=2))
         for density in ["N", "L", "M"]:
             self.footprints.append(footprintSoic(8,density=density))
     elif package=="SOT23" and parts==1:
         pinNumbers=[3,4,1,2,5]
         self.symbols.append(symbolOpamp(name,pinNumbers=pinNumbers, variant=1))
         for density in ["N", "L", "M"]:
             self.footprints.append(footprintSot23(5,density=density))
     elif package=="SOIC" and parts==2:
         pinNumbers=[3,2,1]
         self.symbols.append(symbolOpamp(name,pinNumbers=pinNumbers, variant=0))
         pinNumbers2=[5,6,7]
         self.symbols.append(symbolOpamp(name,pinNumbers=pinNumbers2, variant=0))
         pinNumbers3=[4,8]
         self.symbols.append(symbolOpampPower(name,pinNumbers=pinNumbers3))
         for density in ["N", "L", "M"]:
             self.footprints.append(footprintSoic(8,density=density))
     else:
         raise ValueError("Invalid combnation: package=%s, parts=%d"%(package, parts))
 def __init__(self, density, alternativeLibName, h=2.54, name=""):
     """
     density: "L" - least, "N" - nominal, "M" - most
     """
     if not name:
         name="DcDcDsun3A_%1.2f%s" %(h, density)
     super().__init__(name, alternativeLibName)
     # pins - transplant some pinheaders
     pinNames=[[1,2],[3,2]]
     for x in [0,1]:
         for y in [0,1]:
             donor = footprintPinheader(1,2,density=density, textOnSilk=False,\
                 pinLength=h+6, bodyHeight=h)
             donor.renamePads([pinNames[x][y]]*2)
             donor.movePrimitives([mil(365)*(x*2-1),mil(210)*(y*2-1)])
             self.primitives.extend(donor.primitives)
     # body
     self.addSimple3Dbody([0,0,h], [mil(870),mil(660),1], file="cube_green")
     self.addCourtyardAndSilk([mil(870),mil(660)], defaults.court[density])
     self.addSimple3Dbody([mil(140),mil(60),h+1], [7,7,2.8], draw=False)
     self.addSimple3Dbody([mil(150),mil(-250),h+1], [3.5, 3, 1.9], draw=False)
     self.addCylinder3Dbody([mil(150),mil(-250),h+2.9], [2.5, 2.5, 0.1],\
         file="cylinder_metal", draw=False)
     # transplant some parts - for fun and profit
     for x in [-1,1]:
         donor=footprintSmdChip("1206","N","")
         donor.movePrimitives([mil(365)*x,0,h+1], 90)
         self.primitives.extend(donor.get3DBody())
     for y in range(4):
         donor=footprintSmdChip("0603","N","")
         donor.movePrimitives([mil(-275), mil(-235)+mil(115)*y, h+1], 90)
         self.primitives.extend(donor.get3DBody())
     for x in range(2):
         donor=footprintSmdChip("0603","N","")
         donor.movePrimitives([mil(60)+mil(150)*x, mil(-140), h+1])
         self.primitives.extend(donor.get3DBody())
         for y in range(2):
             donor=footprintSmdChip("0603","N","")
             donor.movePrimitives([mil(-175)+mil(125)*x, mil(-260)+mil(60)*y, h+1])
             self.primitives.extend(donor.get3DBody())
     donor=footprintSoic(8)
     donor.movePrimitives([mil(-140),0,h+1])
     self.primitives.extend(donor.get3DBody())
     donor=footprintSmdChip("SMA","N","",body="R")
     donor.movePrimitives([mil(-155),mil(220),h+1],180)
     self.primitives.extend(donor.get3DBody())
     
 def __init__(self, name="CH340G"):
     super().__init__(name, defaults.icRefDes)
     self.symbols.append(symbolCH340G(name))
     for density in ["N", "L", "M"]:
         self.footprints.append(footprintSoic(16, density=density))