aUCBLogo Demos and Tests / nf_amplifier_layout
setCaseIgnored false
to nf_amplifier_layout
elements=
[ [copper
b 4 b 60
s 3 s 60
b 60 e 60
g 60 g 53
i 60 o 60
l 60 l 46
k 50 k 51
m 50 m 51
q 60 q 44
o 57 o 55
f 48 k 48
l 41 l 40
l 40 p 40
p 40 p 41
o 39 o 37
p 44 p 45
D 57 G 57
D 57 D 37
K 59 K 24
q 41 q 39
r 41 s 41
x 43 v 43
v 43 v 35
l 35 l 36
q 34 q 36
x 35 x 36
I 35 I 36
b 30 e 30
g 30 g 23
i 30 o 30
l 30 l 16
k 20 k 21
m 20 m 21
q 30 q 14
o 27 o 25
f 18 k 18
l 11 l 10
l 10 p 10
p 10 p 11
o 9 o 7
p 14 p 15
D 27 G 27
D 7 D 27
q 11 q 9
r 11 s 11
x 13 v 13
v 13 v 5
l 5 l 6
q 4 q 6
x 5 x 6
B 6 B 31
B 31 G 31
f 1 f 4
G 1 G 5
E 3 E 7
E 7 I 7
I 5 I 7
]
[wire
k 51 m 51
o 57 D 57
s 54 K 54
p 45 b 45
o 37 D 37
b 36 l 36
x 36 I 36
k 21 m 21
o 27 D 27
s 24 K 24
p 15 b 15
o 7 D 7
b 6 l 6
x 6 B 6
f 1 F 1
s 3 F 3
]
[clamp
d 60 j 60
n 60 t 60
G 57 K 57
d 30 j 30
n 30 t 30
G 27 K 27
G 33 K 33
G 6 K 6
]
[diode
g 54 k 50
m 50 q 54
g 24 k 20
m 20 q 24
f 4 b 4
]
[resistor
g 53 g 48
b 48 f 48
l 46 l 41
s 43 x 43
q 39 v 39
o 38 s 38
q 36 v 36
l 35 q 35
g 23 g 18
b 18 f 18
l 16 l 11
s 13 x 13
q 9 v 9
o 8 s 8
q 6 v 6
l 5 q 5
]
[condensator
l 55 o 55
k 48 l 48
p 40 o 39
q 40 s 40
q 34 s 34
v 35 x 35
l 25 o 25
k 18 l 18
p 10 o 9
q 10 s 10
q 4 s 4
v 5 x 5
]
[IC
o 42.5 r 42.5
o 12.5 r 12.5
]
]
cs ht WindowMode
size=12
x0=-390
y0= 280
red=rgb 1 0 0
blue=rgb 0 0 1
grey=HSB 0 .05 .9
grey2=HSB 240 .05 .9
grey3=HSB 200 .03 .9
grey4=HSB 300 .03 .9
drawClampboard
yt=Table 20
for [i 97 97+26]
[ c=char i
yt.c=i-96
]
for [i 65 65+12]
[ c=char i
yt.c=i-64+26
]
foreach elements
[ proc=first ?
coors=bf ?
while [not empty? coors]
[ y=yt.(coors.1)
x=coors.2
y2=yt.(coors.3)
x2=coors.4
run proc
coors=bf bf bf bf coors
]
]
end
to drawwire
setPenSize size*0.2
setXY x0+size*x y0-size*y
pd
setFC pc
fillCircle size*0.25
setXY x0+size*x2 y0-size*y2
fillCircle size*0.25
pu
end
to drawblock
setPS (list size*0.7 size*0.7)
setXY x0+size*x y0-size*y
pd setXY x0+size*x2 y0-size*y2 pu
end
to wire
setPC "black
drawwire
end
to copper
setPC HSB 40 .3 .8
drawblock
end
to resistor
setPC "grey
drawwire
sx=x sx2=x2 sy=y sy2=y2
x=(2*sx+sx2)/3
y=(2*sy+sy2)/3
x2=(sx+2*sx2)/3
y2=(sy+2*sy2)/3
setPC HSBA 0 1 .8 .3
drawblock
end
to diode
setPC rgba 0 0 0 .5
drawwire
sx=x sx2=x2 sy=y sy2=y2
x=(2*sx+sx2)/3
y=(2*sy+sy2)/3
x2=(sx+2*sx2)/3
y2=(sy+2*sy2)/3
setPC rgba 0 0 0 .3
drawblock
end
to clamp
setPC rgba 0 1 0 .3
setPS (list size*4 size*4)
disableRoundLineEnds
setXY x0+size*x y0-size*y
pd setXY x0+size*x2 y0-size*y2 pu
enableRoundLineEnds
end
to condensator
setPC HSBA 0 0 0 .2
drawwire
sx=x
sy=y
x=(x+x2)/2
y=(y+y2)/2
setXY x0+size*x y0-size*y
pd circle size*1 pu
x=(2*sx+x2)/3+0.5
y=(2*sy+y2)/3
setXY x0+size*x y0-size*y
setPC 0
pd Label "+ pu
x=(sx+x2*2)/3-0.5
y=(sy+y2*2)/3
setXY x0+size*x y0-size*y
setPC 0
pd Label "- pu
end
to IC
setPC HSBA 0 1 .7 .5
setPS (list size*3 size*3)
disableRoundLineEnds
setXY x0+size*x y0-size*y
pd setXY x0+size*x2 y0-size*y2 pu
enableRoundLineEnds
end
to pix c
pu
setXY x0+x*size y0-y*size
setPC c
pd
setPenSize size*0.1
Circle 0.25*size
pu
end
to connect
setPenSize size*0.2
pu
setXY x0+(x+0.25)*size y0-y*size
pd
setXY x0+(x+0.75)*size y0-y*size
pu
end
to lab ch
pu setXY x0+x*size y0-y*size Label ch
end
to ybse
for [y 5 40 5][lab y]
end
to drawClampboard
for [i 1 19]
[ y=2*i-1
for [j 1 31]
[ x=j*2-1 pix grey connect
x=j*2 pix grey2 connect
] x=63 pix grey
y=y+1
for [j 1 31]
[ x=j*2-1 pix grey connect
x=j*2 pix grey connect
] x=63 pix grey3
]
y=39
for [j 1 31]
[ x=j*2-1 pix grey connect
x=j*2 pix grey2 connect
] x=63 pix grey
setPC "black
home
right 90
x=0
for [y 1 26][lab char 96+y]
for [y 27 39][lab char 65-27+y]
y=0
for [x 1 63][lab char 48+mod x 10]
end