def __init__(self, parent, title):
     wx.Frame.__init__(self, parent, title=title)
     bb = Breadboard()
     a = OpAmp()
     c = Resistor(50)
     print bb.putComponent(c, 28, 10, 8, 4)
     print bb.putComponent(a, 8, 7)
     BreadboardPanel(self, bb)
     self.Fit()
     self.Show()
Ejemplo n.º 2
0
import sys

if len(sys.argv) != 6:
    sys.exit(
        "This program needs two coordinates from two particles and the distance^2 as input parameters."
    )

#Obtaining the coordinates
sCoordinatesxA = str(sys.argv[1])
sCoordinatesxB = str(sys.argv[2])
sCoordinatesyA = str(sys.argv[3])
sCoordinatesyB = str(sys.argv[4])
sDeltaSqr = str(sys.argv[5])

eng = MainEngine()  # create a default compiler (the back-end is a simulator)
bb = Breadboard(eng)

#Coordinates x of i
if sCoordinatesxA[2] == "1":
    #print("Negating xi0...")
    X | bb.xi0
if sCoordinatesxA[1] == "1":
    #print("Negating xi1...")
    X | bb.xi1
if sCoordinatesxA[0] == "1":
    #print("Negating xi2...")
    X | bb.xi2

#Coordinates x of j
if sCoordinatesxB[2] == "1":
    #print("Negating xj0...")
		because we dont want to do analysis with them in the list"""
		
		scopeNodes =[]
		for i in range(len(bb.componentList)):
			if bb.componentList[i].displayName=='Scope':
				scopeNodes.append(bb.componentList[i])
				del bb.componentList[i]
		return scopeNodes
				
				
				
		
		
if __name__ == '__main__':
	#Yay for debugging!!
	bb = Breadboard()
	source = InputDevice(.01,'DC')
	p = OpAmp()
	W1 = Wire()
	W2 = Wire()
	W3 = Wire()
	W4 = Wire()
	C = Capacitor(.01)
	print bb.putComponent(p,3,10)
	print bb.putComponent(source,5,12)
	print bb.putComponent(W1,4,14,4,17)
	print bb.putComponent(W2,6,14,6,17)
	print bb.putComponent(W3,4,6,4,0)
	print bb.putComponent(W4,5,6,7,17)
	print bb.putComponent(C,5,14,3,16)
	b = B2Spice(bb)