Debian Codegraph @

texmf-dist/tex/context/third/circuitikz/t-circuitikz-0.9.3.tex

raw
1 \def\pgfcircversion{0.9.3}
2 \def\pgfcircversiondate{2019/07/13}
3 \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
4
5 \usemodule[tikz]
6
7 \startmodule[circuitikzgit]
8 \usetikzlibrary[calc]
9 \usetikzlibrary[arrows.meta, bending]
10
11 \unprotect
12
13 \edef\tikzatcode{\the\catcode`\@}
14 \edef\tikzbarcode{\the\catcode`\|}
15 \edef\tikzexclaimcode{\the\catcode`\!}
16 \catcode`\@=11
17 \catcode`\|=12
18 \catcode`\!=12
19
20 \let\tiny=\tfxx
21 \let\small=\tfx
22
23 %%%%%%%%%%% Springe nach tex/pgfcirc.defines
24 %%%---------- open: tex/pgfcirc.defines.tex
25 %% Counters
26
27 \newcount\pgf@circ@count@a
28 \newcount\pgf@circ@count@b
29 \newcount\pgf@circ@count@c
30 %%%%%%%%%%%%
31 %% Dimensions
32
33 % coordinates
34 \newdimen\pgf@circ@res@up
35 \newdimen\pgf@circ@res@down
36 \newdimen\pgf@circ@res@zero
37 \newdimen\pgf@circ@res@left
38 \newdimen\pgf@circ@res@right
39 \newdimen\pgf@circ@res@other
40 \newdimen\pgf@circ@res@step
41 \newdimen\pgf@circ@res@temp
42 % inital thickness
43 \newdimen \pgfstartlinewidth
44
45 % arrow tips, ported over old arrows library (deprecated)
46 % see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
47 % this was the original definition of latex' tips, renamed to avoid clashes
48 %
49 \pgfarrowsdeclare{latexslim}{latexslim}
50 {
51 \pgfutil@tempdima=0.28pt%
52 \advance\pgfutil@tempdima by.3\pgflinewidth%
53 \pgfarrowsleftextend{+-4\pgfutil@tempdima}
54 \pgfarrowsrightextend{+6\pgfutil@tempdima}
55 }
56 {
57 \pgfutil@tempdima=0.28pt%
58 \advance\pgfutil@tempdima by.3\pgflinewidth%
59 \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
60 \pgfpathcurveto
61 {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
62 {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
63 {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
64 \pgfpathcurveto
65 {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
66 {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
67 {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
68 \pgfpathcurveto
69 {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
70 {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
71 {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
72 \pgfpathclose
73 \pgfusepathqfill
74 }
75
76 \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
77
78 %% Macro to fill or draw
79
80 \def\pgf@circ@draworfill{%
81 \ifx\tikz@fillcolor\pgfutil@empty
82 \pgfusepath{draw}
83 \else
84 \pgfsetfillcolor{\tikz@fillcolor}
85 \pgfusepath{draw, fill}
86 \fi
87 }
88
89 \def\pgf@circ@draworfillandclip{%
90 \ifx\tikz@fillcolor\pgfutil@empty
91 \pgfusepath{draw, clip}
92 \else
93 \pgfsetfillcolor{\tikz@fillcolor}
94 \pgfusepath{draw, clip, fill}
95 \fi
96 }
97
98 \def\pgf@circ@maybefill{%
99 \ifx\tikz@fillcolor\pgfutil@empty
100 \pgfusepath{discard}
101 \else
102 \pgfsetfillcolor{\tikz@fillcolor}
103 \pgfusepath{fill}
104 \fi
105 }
106 %% Keys
107
108 \long\def\pgf@circ@comment#1{}
109
110 \def\circuitikzbasekey{/tikz/circuitikz}
111
112 \pgfkeys{\circuitikzbasekey/.is family}
113
114 \def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
115 \let\ctikzset\circuitikzset
116 \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
117 \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
118
119 \newif\ifpgf@circ@siunitx
120 \newif\ifpgf@circuit@compat
121 \newif\ifpgf@circ@oldvoltagedirection % default false
122 \newif\ifpgf@circ@explicitvdir
123 \newif\ifpgf@circ@fixbatteries
124
125 \ctikzset{voltage dir/.is choice}
126 \ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
127 \ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
128 \ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
129 \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
130 \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
131
132
133 % Option ">" for twoports
134 \newif\ifpgf@circuit@inputarrow
135 \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
136 \ctikzset{inputarrow/.is choice}
137 \ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
138 \ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
139
140 % Option "boxed" for nodes and twoports
141 \newif\ifpgf@circuit@boxed
142 \pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
143 \ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
144 \pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
145 \ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
146
147 % Option "dashed" for nodes and twoports
148 \newif\ifpgf@circuit@dashed
149 \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
150 \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
151
152 % Option "t=*" for nodes
153 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
154
155 \ctikzset{current arrow scale/.initial=16}
156
157 \ctikzset{bipoles/.is family}
158 \ctikzset{bipoles/border margin/.initial=1.1}
159 \ctikzset{bipoles/thickness/.initial=2}
160 \ctikzset{tripoles/thickness/.initial=2}
161 \ctikzset{quadpoles/thickness/.initial=2}
162 \ctikzset{nodes width/.initial=.04}
163
164 % Base len for all circuitikz
165 \newdimen\pgf@circ@Rlen
166 \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
167 \pgf@circ@Rlen = 1.4cm
168
169 \ctikzset{monopoles/.is family}
170 \ctikzset{monopoles/ground/width/.initial=.25}
171 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
172 \ctikzset{monopoles/ground/thickness/.initial=2}
173 \ctikzset{monopoles/rground/thickness/.initial=2}
174 \ctikzset{monopoles/tground/thickness/.initial=3}
175 \ctikzset{monopoles/vcc/width/.initial=.2}
176 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
177 \ctikzset{monopoles/vee/arrow/.initial=legacy}
178 \ctikzset{monopoles/match/width/.initial=.4}
179 \ctikzset{monopoles/chassis/width/.initial=.25}
180 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
181 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
182 \ctikzset{monopoles/tlinestub/width/.initial=.25}
183 \ctikzset{monopoles/antenna/width/.initial=.25}
184 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
185 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
186 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
187 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
188 \ctikzset{monopoles/txantenna/width/.initial=.25}
189 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
190 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
191 \ctikzset{monopoles/rxantenna/width/.initial=.25}
192 \ctikzset{monopoles/bareantenna/width/.initial=.25}
193 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
194 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
195 \ctikzset{monopoles/waves/width/.initial=0.5}
196 % microstrips
197 \ctikzset{bipoles/mstline/height/.initial=0.3}
198 \ctikzset{bipoles/mstline/width/.initial=1.2}
199 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
200 \ctikzset{monopoles/msport/width/.initial=.5}
201 \ctikzset{monopoles/msrstub/height/.initial=1.0}
202 \ctikzset{monopoles/msrstub/width/.initial=0.6}
203
204 % microphone and loudspeaker
205 \ctikzset{bipoles/loudspeaker/height/.initial=.8}
206 \ctikzset{bipoles/loudspeaker/depth/.initial=.3}
207 \ctikzset{bipoles/loudspeaker/width/.initial=.8}
208 \ctikzset{bipoles/mic/height/.initial=1.2}
209 \ctikzset{bipoles/mic/depth/.initial=.0}
210 \ctikzset{bipoles/mic/width/.initial=.8}
211
212 \ctikzset{bipoles/resistor/height/.initial=.3}
213 \ctikzset{bipoles/resistor/width/.initial=.8}
214 \ctikzset{bipoles/potentiometer/height/.initial=.8}
215 \ctikzset{bipoles/potentiometer/height 2/.initial=.3}
216 \ctikzset{bipoles/potentiometer/width/.initial=.8}
217 \ctikzset{bipoles/photoresistor/height/.initial=.6}
218 \ctikzset{bipoles/photoresistor/height 2/.initial=.3}
219 \ctikzset{bipoles/photoresistor/width/.initial=.8}
220 \ctikzset{bipoles/thermistor/main/.initial=.7}
221 \ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
222 \ctikzset{bipoles/thermistorntc/width/.initial=.8}
223 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
224 \ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
225 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
226 \ctikzset{bipoles/thermistorptc/width/.initial=.8}
227 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
228 \ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
229 \ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
230 \ctikzset{bipoles/thermistor/width/.initial=.8}
231 \ctikzset{bipoles/varistor/main/.initial=.7}
232 \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
233 \ctikzset{bipoles/varistor/width/.initial=.8}
234 \ctikzset{bipoles/vresistor/height/.initial=.6}
235 \ctikzset{bipoles/vresistor/width/.initial=.8}
236 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
237 \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
238 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
239 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
240 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
241 %% Cute choke settings
242 \ctikzset{bipoles/cutechoke/height/.initial=.3}
243 \ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
244 \ctikzset{bipoles/cutechoke/width/.initial=.6}
245 \ctikzset{bipoles/cutechoke/coils/.initial=5}
246 \ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
247 \ctikzset{bipoles/cutechoke/cstep/.initial=.3}
248 \ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
249 \ctikzset{bipoles/cutechoke/cthick/.initial=1}
250 \newif\ifpgf@circuit@bipole@twolines
251 \pgf@circuit@bipole@twolinesfalse
252 %
253 \ctikzset{bipoles/americaninductor/height/.initial=.3}
254 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
255 \ctikzset{bipoles/americaninductor/width/.initial=.8}
256 \ctikzset{bipoles/americaninductor/coils/.initial=4}
257 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
258 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
259 \ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
260 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
261 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
262 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
263 \ctikzset{bipoles/vamericaninductor/height/.initial=.6}
264 \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
265 \ctikzset{bipoles/vamericaninductor/width/.initial=.8}
266 \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
267 \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
268 \ctikzset{bipoles/esource/height/.initial=.60}
269 \ctikzset{bipoles/esource/width/.initial=.60}
270 \ctikzset{bipoles/pvsource/height/.initial=.60}
271 \ctikzset{bipoles/pvsource/width/.initial=.60}
272 \ctikzset{bipoles/isource/height/.initial=.60}
273 \ctikzset{bipoles/isource/width/.initial=.60}
274 \ctikzset{bipoles/oosource/height/.initial=.60}
275 \ctikzset{bipoles/oosource/width/.initial=.60}
276 \ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
277 \ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
278 \ctikzset{bipoles/dcisource/angle/.initial=80}
279 \ctikzset{bipoles/dcisource/height/.initial=.60}
280 \ctikzset{bipoles/dcisource/width/.initial=.60}
281 \ctikzset{bipoles/dcvsource/height/.initial=.60}
282 \ctikzset{bipoles/dcvsource/width/.initial=.60}
283 \ctikzset{bipoles/vsourcetri/height/.initial=.60}
284 \ctikzset{bipoles/vsourcetri/width/.initial=.60}
285 \ctikzset{bipoles/isourceam/height/.initial=.60}
286 \ctikzset{bipoles/isourceam/width/.initial=.60}
287 \ctikzset{bipoles/vsource/height/.initial=.60}
288 \ctikzset{bipoles/vsource/width/.initial=.60}
289 \ctikzset{bipoles/vsourceam/height/.initial=.60}
290 \ctikzset{bipoles/vsourceam/width/.initial=.60}
291 \ctikzset{bipoles/vsourceam/margin/.initial=.7}
292 \ctikzset{bipoles/isourcesin/height/.initial=.60}
293 \ctikzset{bipoles/isourcesin/width/.initial=.60}
294 \ctikzset{bipoles/vsourcesin/height/.initial=.60}
295 \ctikzset{bipoles/vsourcesin/width/.initial=.60}
296 \ctikzset{bipoles/vsourcesquare/height/.initial=.60}
297 \ctikzset{bipoles/vsourcesquare/width/.initial=.60}
298 \ctikzset{bipoles/cisource/height/.initial=.7}
299 \ctikzset{bipoles/cisource/width/.initial=.7}
300 \ctikzset{bipoles/cisourceam/height/.initial=.7}
301 \ctikzset{bipoles/cisourceam/width/.initial=.7}
302 \ctikzset{bipoles/cvsource/height/.initial=.7}
303 \ctikzset{bipoles/cvsource/width/.initial=.7}
304 \ctikzset{bipoles/cvsourceam/height/.initial=.7}
305 \ctikzset{bipoles/cvsourceam/width/.initial=.7}
306 \ctikzset{bipoles/cvsourceam/margin/.initial=.7}
307 \ctikzset{bipoles/cvsourceam/text scale/.initial=1}
308 \ctikzset{bipoles/cisourcesin/width/.initial=.7}
309 \ctikzset{bipoles/cvsourcesin/height/.initial=.7}
310 \ctikzset{bipoles/cvsourcesin/width/.initial=.7}
311 \ctikzset{bipoles/capacitor/height/.initial=.6}
312 \ctikzset{bipoles/capacitor/width/.initial=.2}
313 \ctikzset{bipoles/ecapacitor/height/.initial=.5}
314 \ctikzset{bipoles/ecapacitor/width/.initial=.2}
315 \ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath}
316 \ctikzset{bipoles/pcapacitor/height/.initial=.6}
317 \ctikzset{bipoles/pcapacitor/width/.initial=.2}
318 \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
319 \ctikzset{bipoles/vcapacitor/height/.initial=.6}
320 \ctikzset{bipoles/vcapacitor/width/.initial=.5}
321 \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
322 \ctikzset{bipoles/piezoelectric/height/.initial=.7}
323 \ctikzset{bipoles/piezoelectric/width/.initial=.5}
324 \ctikzset{bipoles/battery/height/.initial=.6}
325 \ctikzset{bipoles/battery/width/.initial=.3}
326 \ctikzset{bipoles/battery1/height/.initial=.6}
327 \ctikzset{bipoles/battery1/width/.initial=.3}
328 \ctikzset{bipoles/battery2/height/.initial=.6}
329 \ctikzset{bipoles/battery2/width/.initial=.3}
330 \ctikzset{bipoles/diode/height/.initial=.50}
331 \ctikzset{bipoles/diode/width/.initial=.40}
332 \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
333 \ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
334 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
335 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
336 \ctikzset{bipoles/varcap/height/.initial=.50}
337 \ctikzset{bipoles/varcap/width/.initial=.45}
338 \ctikzset{bipoles/spst/height/.initial=.35}
339 \ctikzset{bipoles/spst/width/.initial=.35}
340 \ctikzset{bipoles/spst/depth/.initial=.2}
341 \ctikzset{bipoles/nos/height/.initial=.3}
342 \ctikzset{bipoles/nos/width/.initial=.35}
343 \ctikzset{bipoles/nos/depth/.initial=.2}
344 \ctikzset{bipoles/ncs/height/.initial=.35}
345 \ctikzset{bipoles/ncs/width/.initial=.35}
346 \ctikzset{bipoles/ncs/depth/.initial=.2}
347 \ctikzset{bipoles/generic/height/.initial=.30}
348 \ctikzset{bipoles/generic/width/.initial=.80}
349 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
350 \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
351 \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
352 \ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
353 \ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
354 \ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
355 \ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
356 \ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
357 \ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
358 \ctikzset{bipoles/fuse/height/.initial=.20}
359 \ctikzset{bipoles/fuse/width/.initial=.50}
360 \ctikzset{bipoles/afuse/height/.initial=.20}
361 \ctikzset{bipoles/afuse/width/.initial=.50}
362 \ctikzset{bipoles/generic potentiometer/height/.initial=.80}
363 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
364 \ctikzset{bipoles/generic potentiometer/width/.initial=.80}
365 \ctikzset{bipoles/ageneric/height/.initial=.30}
366 \ctikzset{bipoles/ageneric/width/.initial=.80}
367 \ctikzset{bipoles/memristor/height/.initial=.30}
368 \ctikzset{bipoles/memristor/wave height/.initial=.5}
369 \ctikzset{bipoles/memristor/width/.initial=.80}
370 \ctikzset{bipoles/tgeneric/height/.initial=.70}
371 \ctikzset{bipoles/tgeneric/width/.initial=.80}
372 \ctikzset{bipoles/tfullgeneric/height/.initial=.70}
373 \ctikzset{bipoles/tfullgeneric/width/.initial=.80}
374 \ctikzset{bipoles/fullgeneric/height/.initial=.30}
375 \ctikzset{bipoles/fullgeneric/width/.initial=.80}
376 \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
377 \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
378 \ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
379 \ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
380 \ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
381 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
382 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
383 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
384 \ctikzset{bipoles/ammeter/height/.initial=.60}
385 \ctikzset{bipoles/ammeter/width/.initial=.60}
386 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
387 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
388 \ctikzset{bipoles/voltmeter/height/.initial=.60}
389 \ctikzset{bipoles/voltmeter/width/.initial=.60}
390 \ctikzset{bipoles/smeter/height/.initial=.60}
391 \ctikzset{bipoles/smeter/width/.initial=.60}
392 \ctikzset{bipoles/qmeter/depth/.initial=.40}
393 \ctikzset{bipoles/qmeter/height/.initial=.80}
394 \ctikzset{bipoles/qmeter/width/.initial=.60}
395 \ctikzset{bipoles/iloop/width/.initial=.40}
396 \ctikzset{bipoles/iloop/height/.initial=.60}
397 \ctikzset{bipoles/oscope/height/.initial=.60}
398 \ctikzset{bipoles/oscope/width/.initial=.60}
399 \ctikzset{bipoles/buffer/height/.initial=1}
400 \ctikzset{bipoles/buffer/width/.initial=1}
401 \ctikzset{bipoles/not port/width/.initial=1}
402 \ctikzset{bipoles/not port/height/.initial=.8}
403 \ctikzset{bipoles/not port/circle width/.initial=.15}
404 \ctikzset{bipoles/lamp/height/.initial=.60}
405 \ctikzset{bipoles/lamp/width/.initial=.60}
406 \ctikzset{bipoles/bulb/height/.initial=.8}
407 \ctikzset{bipoles/bulb/width/.initial=.8}
408 \ctikzset{bipoles/tline/height/.initial=.3}
409 \ctikzset{bipoles/tline/width/.initial=.8}
410 \ctikzset{bipoles/squid/height/.initial=.60}
411 \ctikzset{bipoles/squid/width/.initial=.60}
412 \ctikzset{bipoles/barrier/height/.initial=.60}
413 \ctikzset{bipoles/barrier/width/.initial=.60}
414 \ctikzset{bipoles/thermocouple/height/.initial=.250}
415 \ctikzset{bipoles/thermocouple/height 2/.initial=.60}
416 \ctikzset{bipoles/thermocouple/width/.initial=.140}
417 \ctikzset{bipoles/pushbutton/height/.initial=.5}
418 \ctikzset{bipoles/pushbutton/height 2/.initial=.2}
419 \ctikzset{bipoles/pushbutton/width/.initial=.50}
420
421 \ctikzset{bipoles/twoport/width/.initial=.7}
422 \ctikzset{bipoles/twoport/height/.initial=.7}
423 \ctikzset{bipoles/twoport/text/.initial=}
424 \ctikzset{bipoles/vco/width/.initial=.7}
425 \ctikzset{bipoles/bandpass/width/.initial=.7}
426 \ctikzset{bipoles/bandstop/width/.initial=.7}
427 \ctikzset{bipoles/highpass/width/.initial=.7}
428 \ctikzset{bipoles/lowpass/width/.initial=.7}
429 \ctikzset{bipoles/adc/width/.initial=.7}
430 \ctikzset{bipoles/dac/width/.initial=.7}
431 \ctikzset{bipoles/dsp/width/.initial=.7}
432 \ctikzset{bipoles/fft/width/.initial=.7}
433 \ctikzset{bipoles/amp/width/.initial=.7}
434 \ctikzset{bipoles/vamp/width/.initial=.7}
435 \ctikzset{bipoles/piattenuator/width/.initial=.7}
436 \ctikzset{bipoles/vpiattenuator/width/.initial=.7}
437 \ctikzset{bipoles/tattenuator/width/.initial=.7}
438 \ctikzset{bipoles/vtattenuator/width/.initial=.7}
439 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
440 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
441 \ctikzset{bipoles/detector/width/.initial=.7}
442 % resistive sensor american style
443 \ctikzset{bipoles/resistivesens/height/.initial=.6}
444 \ctikzset{bipoles/resistivesens/width/.initial=.8}
445
446 % crossing wires
447 \ctikzset{bipoles/crossing/size/.initial=.2}
448
449 \newif\ifpgf@circuit@trans@depletiontype
450 \pgf@circuit@trans@depletiontypefalse
451
452 \newif\ifpgf@circuit@mos@arrows
453 \ctikzset{tripoles/mos style/.is choice}
454 \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
455 \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
456 \pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
457 \pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
458
459 % Option solderdot for fet
460 \newif\ifpgf@circuit@fet@solderdot
461 \pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
462 \ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
463 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
464 \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
465
466 % Option bodydiode for fet
467 \newif\ifpgf@circuit@fet@bodydiode
468 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
469 \ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
470 \pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
471 \ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
472
473 % Option draw fet without gate connection
474 \newif\ifpgf@circuit@bpt@drawgate
475 \pgf@circuit@bpt@drawgatetrue
476 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
477 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
478 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
479 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
480
481 % Option draw bpt without base connection
482 \newif\ifpgf@circuit@bpt@drawbase
483 \pgf@circuit@bpt@drawbasetrue
484 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
485 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
486 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
487 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
488
489 % Option draw bpt with optical input
490 \newif\ifpgf@circuit@bpt@drawphoto
491 \pgf@circuit@bpt@drawphotofalse
492 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
493 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
494 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
495 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
496
497 % Option draw pmos with empty circle
498 \newif\ifpgf@circuit@pmos@emptycircle
499 \pgf@circuit@pmos@emptycirclefalse
500 \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
501 \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
502 % Option draw pmos with no circle
503 \newif\ifpgf@circuit@pmos@nocircle
504 \pgf@circuit@pmos@nocirclefalse
505 \pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
506 \ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
507 % back to normal
508 \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
509 \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
510
511
512 \newif\ifpgf@circuit@trans@ntype
513 \pgf@circuit@trans@ntypetrue %default true
514 %\newif\ifpgf@circuit@trans@ptype
515 %\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
516 \ctikzset{tripoles/nmos/width/.initial=.7}
517 \ctikzset{tripoles/nmos/gate height/.initial=.35}
518 \ctikzset{tripoles/nmos/base height/.initial=.5}
519 \ctikzset{tripoles/nmos/conn height/.initial=0}
520 \ctikzset{tripoles/nmos/height/.initial=1.1}
521 \ctikzset{tripoles/nmos/base width/.initial=.5}
522 \ctikzset{tripoles/nmos/gate width/.initial=.62}
523 \ctikzset{tripoles/nmos/arrow pos/.initial=.6}
524 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
525 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
526 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
527 \ctikzset{tripoles/nmos/curr direction/.initial=1}
528
529 \ctikzset{tripoles/pmos/width/.initial=.7}
530 \ctikzset{tripoles/pmos/gate height/.initial=.35}
531 \ctikzset{tripoles/pmos/base height/.initial=.5}
532 \ctikzset{tripoles/pmos/conn height/.initial=0}
533 \ctikzset{tripoles/pmos/height/.initial=1.1}
534 \ctikzset{tripoles/pmos/base width/.initial=.5}
535 \ctikzset{tripoles/pmos/gate width/.initial=.62}
536 \ctikzset{tripoles/pmos/arrow pos/.initial=.4}
537 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
538 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
539 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
540 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
541
542 \ctikzset{tripoles/hemt/width/.initial=.7}
543 \ctikzset{tripoles/hemt/gate height/.initial=.35}
544 \ctikzset{tripoles/hemt/base height/.initial=.5}
545 \ctikzset{tripoles/hemt/conn height/.initial=0}
546 \ctikzset{tripoles/hemt/height/.initial=1.1}
547 \ctikzset{tripoles/hemt/base width/.initial=.5}
548 \ctikzset{tripoles/hemt/gate width/.initial=.62}
549 \ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
550 \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
551 \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
552 \ctikzset{tripoles/hemt/curr direction/.initial=1}
553
554 \ctikzset{tripoles/nfet/width/.initial=.7}
555 \ctikzset{tripoles/nfet/gate height/.initial=.35}
556 \ctikzset{tripoles/nfet/base height/.initial=.5}
557 \ctikzset{tripoles/nfet/conn height/.initial=0}
558 \ctikzset{tripoles/nfet/height/.initial=1.1}
559 \ctikzset{tripoles/nfet/base width/.initial=.5}
560 \ctikzset{tripoles/nfet/gate width/.initial=.62}
561 \ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
562 \ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
563 \ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
564 \ctikzset{tripoles/nfet/curr direction/.initial=1}
565
566 \ctikzset{tripoles/pfet/width/.initial=.7}
567 \ctikzset{tripoles/pfet/gate height/.initial=.35}
568 \ctikzset{tripoles/pfet/base height/.initial=.5}
569 \ctikzset{tripoles/pfet/conn height/.initial=0}
570 \ctikzset{tripoles/pfet/height/.initial=1.1}
571 \ctikzset{tripoles/pfet/base width/.initial=.5}
572 \ctikzset{tripoles/pfet/gate width/.initial=.62}
573 \ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
574 \ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
575 \ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
576 \ctikzset{tripoles/pfet/curr direction/.initial=-1}
577
578 \ctikzset{tripoles/nigfete/width/.initial=.7}
579 \ctikzset{tripoles/nigfete/gate height/.initial=.35}
580 \ctikzset{tripoles/nigfete/base height/.initial=.5}
581 \ctikzset{tripoles/nigfete/conn height/.initial=.35}
582 \ctikzset{tripoles/nigfete/height/.initial=1.1}
583 \ctikzset{tripoles/nigfete/base width/.initial=.5}
584 \ctikzset{tripoles/nigfete/gate width/.initial=.62}
585 \ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
586 \ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
587 \ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
588 \ctikzset{tripoles/nigfete/curr direction/.initial=1}
589
590 \ctikzset{tripoles/nigfetd/width/.initial=.7}
591 \ctikzset{tripoles/nigfetd/gate height/.initial=.35}
592 \ctikzset{tripoles/nigfetd/base height/.initial=.5}
593 \ctikzset{tripoles/nigfetd/conn height/.initial=.35}
594 \ctikzset{tripoles/nigfetd/height/.initial=1.1}
595 \ctikzset{tripoles/nigfetd/base width/.initial=.5}
596 \ctikzset{tripoles/nigfetd/gate width/.initial=.62}
597 \ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
598 \ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
599 \ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
600 \ctikzset{tripoles/nigfetd/curr direction/.initial=1}
601
602 \ctikzset{tripoles/nigfetebulk/width/.initial=.7}
603 \ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
604 \ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
605 \ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
606 \ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
607 \ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
608 \ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
609 \ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
610 \ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
611 \ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
612 \ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
613
614 \ctikzset{tripoles/pigfete/width/.initial=.7}
615 \ctikzset{tripoles/pigfete/gate height/.initial=.35}
616 \ctikzset{tripoles/pigfete/base height/.initial=.5}
617 \ctikzset{tripoles/pigfete/conn height/.initial=.35}
618 \ctikzset{tripoles/pigfete/height/.initial=1.1}
619 \ctikzset{tripoles/pigfete/base width/.initial=.5}
620 \ctikzset{tripoles/pigfete/gate width/.initial=.62}
621 \ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
622 \ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
623 \ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
624 \ctikzset{tripoles/pigfete/curr direction/.initial=-1}
625
626 \ctikzset{tripoles/pigfetd/width/.initial=.7}
627 \ctikzset{tripoles/pigfetd/gate height/.initial=.35}
628 \ctikzset{tripoles/pigfetd/base height/.initial=.5}
629 \ctikzset{tripoles/pigfetd/conn height/.initial=.35}
630 \ctikzset{tripoles/pigfetd/height/.initial=1.1}
631 \ctikzset{tripoles/pigfetd/base width/.initial=.5}
632 \ctikzset{tripoles/pigfetd/gate width/.initial=.62}
633 \ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
634 \ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
635 \ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
636 \ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
637
638 \ctikzset{tripoles/pigfetebulk/width/.initial=.7}
639 \ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
640 \ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
641 \ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
642 \ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
643 \ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
644 \ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
645 \ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
646 \ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
647 \ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
648 \ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
649
650 \ctikzset{tripoles/npn/width/.initial=.6}
651 \ctikzset{tripoles/npn/base height/.initial=.45}
652 \ctikzset{tripoles/npn/base height 2/.initial=.15}
653 \ctikzset{tripoles/npn/base height/.initial=.4}
654 \ctikzset{tripoles/npn/conn height/.initial=0}
655 \ctikzset{tripoles/npn/height/.initial=1.1}
656 \ctikzset{tripoles/npn/base width/.initial=.5}
657 \ctikzset{tripoles/npn/arrow pos/.initial=.5}
658 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
659 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
660 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
661 \ctikzset{tripoles/npn/curr direction/.initial=1}
662
663 \ctikzset{tripoles/pnp/width/.initial=.6}
664 \ctikzset{tripoles/pnp/base height/.initial=.45}
665 \ctikzset{tripoles/pnp/base height 2/.initial=.15}
666 \ctikzset{tripoles/pnp/base height/.initial=.4}
667 \ctikzset{tripoles/pnp/conn height/.initial=0}
668 \ctikzset{tripoles/pnp/height/.initial=1.1}
669 \ctikzset{tripoles/pnp/base width/.initial=.5}
670 \ctikzset{tripoles/pnp/arrow pos/.initial=.5}
671 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
672 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
673 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
674 \ctikzset{tripoles/pnp/curr direction/.initial=-1}
675
676 \ctikzset{tripoles/pigbt/width/.initial=.6}
677 \ctikzset{tripoles/pigbt/gate height/.initial=.45}
678 \ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
679 \ctikzset{tripoles/pigbt/base height/.initial=.4}
680 \ctikzset{tripoles/pigbt/conn height/.initial=0}
681 \ctikzset{tripoles/pigbt/height/.initial=1.1}
682 \ctikzset{tripoles/pigbt/gate width/.initial=.62}
683 \ctikzset{tripoles/pigbt/base width/.initial=.5}
684 \ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
685 \ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
686 \ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
687 \ctikzset{tripoles/pigbt/curr direction/.initial=-1}
688
689 \ctikzset{tripoles/nigbt/width/.initial=.6}
690 \ctikzset{tripoles/nigbt/gate height/.initial=.45}
691 \ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
692 \ctikzset{tripoles/nigbt/base height/.initial=.4}
693 \ctikzset{tripoles/nigbt/conn height/.initial=0}
694 \ctikzset{tripoles/nigbt/height/.initial=1.1}
695 \ctikzset{tripoles/nigbt/gate width/.initial=.62}
696 \ctikzset{tripoles/nigbt/base width/.initial=.5}
697 \ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
698 \ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
699 \ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
700 \ctikzset{tripoles/nigbt/curr direction/.initial=1}
701
702 \ctikzset{tripoles/Lpigbt/width/.initial=.6}
703 \ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
704 \ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
705 \ctikzset{tripoles/Lpigbt/base height/.initial=.4}
706 \ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
707 \ctikzset{tripoles/Lpigbt/height/.initial=1.1}
708 \ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
709 \ctikzset{tripoles/Lpigbt/base width/.initial=.5}
710 \ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
711 \ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
712 \ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
713 \ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
714
715 \ctikzset{tripoles/Lnigbt/width/.initial=.6}
716 \ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
717 \ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
718 \ctikzset{tripoles/Lnigbt/base height/.initial=.4}
719 \ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
720 \ctikzset{tripoles/Lnigbt/height/.initial=1.1}
721 \ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
722 \ctikzset{tripoles/Lnigbt/base width/.initial=.5}
723 \ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
724 \ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
725 \ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
726 \ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
727
728 \ctikzset{tripoles/njfet/width/.initial=.7}
729 \ctikzset{tripoles/njfet/gate height/.initial=.5}
730 \ctikzset{tripoles/njfet/gate height 2/.initial=.35}
731 \ctikzset{tripoles/njfet/gate width/.initial=.5}
732 \ctikzset{tripoles/njfet/conn height/.initial=.35}
733 \ctikzset{tripoles/njfet/height/.initial=1.1}
734 \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
735 \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
736 \ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
737 \ctikzset{tripoles/njfet/curr direction/.initial=1}
738
739 \ctikzset{tripoles/pjfet/width/.initial=.7}
740 \ctikzset{tripoles/pjfet/gate height/.initial=.5}
741 \ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
742 \ctikzset{tripoles/pjfet/gate width/.initial=.5}
743 \ctikzset{tripoles/pjfet/conn height/.initial=.35}
744 \ctikzset{tripoles/pjfet/height/.initial=1.1}
745 \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
746 \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
747 \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
748 \ctikzset{tripoles/pjfet/curr direction/.initial=-1}
749
750 \ctikzset{tripoles/isfet/width/.initial=1}
751 \ctikzset{tripoles/isfet/gate height/.initial=.35}
752 \ctikzset{tripoles/isfet/base height/.initial=.5}
753 \ctikzset{tripoles/isfet/height/.initial=1.1}
754 \ctikzset{tripoles/isfet/base width/.initial=.3}
755 \ctikzset{tripoles/isfet/gate width/.initial=.5}
756 \ctikzset{tripoles/isfet/conn height/.initial=0}
757 \ctikzset{tripoles/isfet/wave width/.initial=.16}
758 \ctikzset{tripoles/isfet/wave amp/.initial=.06}
759 \ctikzset{tripoles/isfet/waves y sep/.initial=.22}
760 \ctikzset{tripoles/isfet/waves x sep/.initial=.8}
761 \ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
762 \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
763 \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
764 \ctikzset{tripoles/isfet/curr direction/.initial=1}
765
766 \newif\ifpgf@circuit@europeanlogicport
767 \ctikzset{logic ports/.is choice}
768 \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
769 \tikzset{and port/.style={shape=european and port}}
770 \tikzset{or port/.style={shape=european or port}}
771 \tikzset{xor port/.style={shape=european xor port}}
772 \tikzset{not port/.style={shape=european not port}}
773 \tikzset{nand port/.style={shape=european nand port}}
774 \tikzset{nor port/.style={shape=european nor port}}
775 \tikzset{xnor port/.style={shape=european xnor port}}
776 } }
777 \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
778 \tikzset{and port/.style={shape=american and port}}
779 \tikzset{or port/.style={shape=american or port}}
780 \tikzset{xor port/.style={shape=american xor port}}
781 \tikzset{not port/.style={shape=american not port}}
782 \tikzset{nand port/.style={shape=american nand port}}
783 \tikzset{nor port/.style={shape=american nor port}}
784 \tikzset{xnor port/.style={shape=american xnor port}}
785 } }
786
787 \ctikzset{logic ports origin/.is choice}
788 \ctikzset{logic ports origin/legacy/.code= {
789 \ctikzset{tripoles/american and port/origin/.initial=0.8}
790 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
791 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
792 \ctikzset{tripoles/american or port/origin/.initial=0.8}
793 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
794 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
795 \ctikzset{tripoles/european and port/origin/.initial=0.8}
796 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
797 \ctikzset{tripoles/european or port/origin/.initial=0.8}
798 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
799 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
800 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
801 \ctikzset{tripoles/european not port/origin/.initial=0.8}
802 }
803 }
804 \ctikzset{logic ports origin/center/.code= {
805 \ctikzset{tripoles/american and port/origin/.initial=0}
806 \ctikzset{tripoles/american nand port/origin/.initial=0}
807 \ctikzset{tripoles/american nor port/origin/.initial=0}
808 \ctikzset{tripoles/american or port/origin/.initial=0}
809 \ctikzset{tripoles/american xor port/origin/.initial=0}
810 \ctikzset{tripoles/american xnor port/origin/.initial=0}
811 \ctikzset{tripoles/european and port/origin/.initial=0}
812 \ctikzset{tripoles/european nand port/origin/.initial=0}
813 \ctikzset{tripoles/european or port/origin/.initial=0}
814 \ctikzset{tripoles/european nor port/origin/.initial=0}
815 \ctikzset{tripoles/european xor port/origin/.initial=0}
816 \ctikzset{tripoles/european xnor port/origin/.initial=0}
817 \ctikzset{tripoles/european not port/origin/.initial=0}
818 }
819 }
820
821
822 \ctikzset{tripoles/american and port/width/.initial=1.1}
823 \ctikzset{tripoles/american and port/height/.initial=.8}
824 \ctikzset{tripoles/american and port/port width/.initial=.7}
825 \ctikzset{tripoles/american and port/input height/.initial=.5}
826 \ctikzset{tripoles/american nand port/width/.initial=1.1}
827 \ctikzset{tripoles/american nand port/height/.initial=.8}
828 \ctikzset{tripoles/american nand port/port width/.initial=.7}
829 \ctikzset{tripoles/american nand port/circle width/.initial=.15}
830 \ctikzset{tripoles/american nand port/input height/.initial=.5}
831 \ctikzset{tripoles/american or port/width/.initial=1.1}
832 \ctikzset{tripoles/american or port/height/.initial=.8}
833 \ctikzset{tripoles/american or port/port width/.initial=.7}
834 \ctikzset{tripoles/american or port/input height/.initial=.5}
835 \ctikzset{tripoles/american or port/input skip/.initial=.25}
836 \ctikzset{tripoles/american or port/aaa/.initial=.6}
837 \ctikzset{tripoles/american or port/bbb/.initial=.4}
838 \ctikzset{tripoles/american or port/ccc/.initial=.5}
839 \ctikzset{tripoles/american or port/ddd/.initial=.0}
840 \ctikzset{tripoles/american nor port/width/.initial=1.1}
841 \ctikzset{tripoles/american nor port/height/.initial=.8}
842 \ctikzset{tripoles/american nor port/port width/.initial=.7}
843 \ctikzset{tripoles/american nor port/input height/.initial=.5}
844 \ctikzset{tripoles/american nor port/input skip/.initial=.25}
845 \ctikzset{tripoles/american nor port/circle width/.initial=.15}
846 \ctikzset{tripoles/american nor port/aaa/.initial=.6}
847 \ctikzset{tripoles/american nor port/bbb/.initial=.4}
848 \ctikzset{tripoles/american nor port/ccc/.initial=.5}
849 \ctikzset{tripoles/american nor port/ddd/.initial=.0}
850 \ctikzset{tripoles/american xor port/width/.initial=1.1}
851 \ctikzset{tripoles/american xor port/height/.initial=.8}
852 \ctikzset{tripoles/american xor port/port width/.initial=.7}
853 \ctikzset{tripoles/american xor port/input height/.initial=.5}
854 \ctikzset{tripoles/american xor port/input skip/.initial=.15}
855 \ctikzset{tripoles/american xor port/distance/.initial=.1}
856 \ctikzset{tripoles/american xnor port/width/.initial=1.1}
857 \ctikzset{tripoles/american xnor port/height/.initial=.8}
858 \ctikzset{tripoles/american xnor port/port width/.initial=.7}
859 \ctikzset{tripoles/american xnor port/input height/.initial=.5}
860 \ctikzset{tripoles/american xnor port/input skip/.initial=.15}
861 \ctikzset{tripoles/american xnor port/distance/.initial=.1}
862 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
863 \ctikzset{tripoles/american and port/origin/.initial=0.8}
864 \ctikzset{tripoles/american and port/inputs/.initial=2}
865 % variable number of inputs
866 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
867 \ctikzset{tripoles/american nand port/inputs/.initial=2}
868 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
869 \ctikzset{tripoles/american nor port/inputs/.initial=2}
870 \ctikzset{tripoles/american nor port/angle/.initial=70}
871 \ctikzset{tripoles/american nor port/inner/.initial=0.3}
872 \ctikzset{tripoles/american or port/origin/.initial=0.8}
873 \ctikzset{tripoles/american or port/inputs/.initial=2}
874 \ctikzset{tripoles/american or port/angle/.initial=70}
875 \ctikzset{tripoles/american or port/inner/.initial=0.3}
876 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
877 \ctikzset{tripoles/american xor port/inputs/.initial=2}
878 \ctikzset{tripoles/american xor port/angle/.initial=70}
879 \ctikzset{tripoles/american xor port/inner/.initial=0.3}
880 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
881 \ctikzset{tripoles/american xnor port/inputs/.initial=2}
882 \ctikzset{tripoles/american xnor port/angle/.initial=70}
883 \ctikzset{tripoles/american xnor port/inner/.initial=0.3}
884
885 \ctikzset{tripoles/european and port/width/.initial=1.4}
886 \ctikzset{tripoles/european and port/height/.initial=.65}
887 \ctikzset{tripoles/european and port/reserved/.initial=.6}
888 \ctikzset{tripoles/european and port/input height/.initial=.6}
889 \ctikzset{tripoles/european or port/width/.initial=1.4}
890 \ctikzset{tripoles/european or port/height/.initial=.65}
891 \ctikzset{tripoles/european or port/reserved/.initial=.6}
892 \ctikzset{tripoles/european or port/input height/.initial=.6}
893 \ctikzset{tripoles/european xor port/width/.initial=1.4}
894 \ctikzset{tripoles/european xor port/height/.initial=.65}
895 \ctikzset{tripoles/european xor port/reserved/.initial=.6}
896 \ctikzset{tripoles/european xor port/input height/.initial=.6}
897 \ctikzset{tripoles/european nand port/width/.initial=1.4}
898 \ctikzset{tripoles/european nand port/not height/.initial=.3}
899 \ctikzset{tripoles/european nand port/not width/.initial=.8}
900 \ctikzset{tripoles/european nand port/height/.initial=.65}
901 \ctikzset{tripoles/european nand port/reserved/.initial=.6}
902 \ctikzset{tripoles/european nand port/input height/.initial=.6}
903 \ctikzset{tripoles/european not port/width/.initial=1.4}
904 \ctikzset{tripoles/european not port/not height/.initial=.3}
905 \ctikzset{tripoles/european not port/not width/.initial=.8}
906 \ctikzset{tripoles/european not port/height/.initial=.65}
907 \ctikzset{tripoles/european not port/reserved/.initial=.6}
908 \ctikzset{tripoles/european not port/input height/.initial=0}
909 \ctikzset{tripoles/european xnor port/width/.initial=1.4}
910 \ctikzset{tripoles/european xnor port/not height/.initial=.3}
911 \ctikzset{tripoles/european xnor port/not width/.initial=.8}
912 \ctikzset{tripoles/european xnor port/height/.initial=.65}
913 \ctikzset{tripoles/european xnor port/reserved/.initial=.6}
914 \ctikzset{tripoles/european xnor port/input height/.initial=.6}
915 \ctikzset{tripoles/european nor port/width/.initial=1.4}
916 \ctikzset{tripoles/european nor port/not height/.initial=.3}
917 \ctikzset{tripoles/european nor port/not width/.initial=.8}
918 \ctikzset{tripoles/european nor port/height/.initial=.65}
919 \ctikzset{tripoles/european nor port/reserved/.initial=.6}
920 \ctikzset{tripoles/european nor port/input height/.initial=.6}
921 % variable number of inputs
922 \ctikzset{tripoles/european and port/origin/.initial=0.8}
923 \ctikzset{tripoles/european and port/inputs/.initial=2}
924 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
925 \ctikzset{tripoles/european nand port/inputs/.initial=2}
926 \ctikzset{tripoles/european or port/origin/.initial=0.8}
927 \ctikzset{tripoles/european or port/inputs/.initial=2}
928 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
929 \ctikzset{tripoles/european nor port/inputs/.initial=2}
930 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
931 \ctikzset{tripoles/european xor port/inputs/.initial=2}
932 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
933 \ctikzset{tripoles/european xnor port/inputs/.initial=2}
934 \ctikzset{tripoles/european not port/origin/.initial=0.8}
935 \ctikzset{tripoles/european not port/inputs/.initial=1}%
936 %%% parameters that are not used anymore after multi-input
937 %%% gates --- left for compatibility of source code.
938 \ctikzset{tripoles/american xor port/aaa/.initial=.6}
939 \ctikzset{tripoles/american xor port/bbb/.initial=.4}
940 \ctikzset{tripoles/american xor port/ccc/.initial=.5}
941 \ctikzset{tripoles/american xor port/ddd/.initial=.0}
942 \ctikzset{tripoles/american xnor port/aaa/.initial=.6}
943 \ctikzset{tripoles/american xnor port/bbb/.initial=.4}
944 \ctikzset{tripoles/american xnor port/ccc/.initial=.5}
945 \ctikzset{tripoles/american xnor port/ddd/.initial=.0}
946 % switches for logic gates
947 %
948 \pgfkeys{/tikz/number inputs/.initial=0}
949 \pgfkeys{/tikz/number inputs/.default=0}
950 %
951 % switches for op amps
952 % changing input polarity
953 %
954 \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
955 \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
956 \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
957 \pgfkeys{/tikz/input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
958 \ctikzset{input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
959 %
960 % changing output polarity (for fully diff objects)
961 %
962 \newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
963 \pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
964 \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
965 \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
966 \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
967 %
968 \ctikzset{tripoles/op amp/width/.initial=1.7}
969 \ctikzset{tripoles/op amp/port width/.initial=.7}
970 \ctikzset{tripoles/op amp/height/.initial=1.4}
971 \ctikzset{tripoles/op amp/input height/.initial=.5}
972 \ctikzset{tripoles/op amp/up pos/.initial=.45}
973 \ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath}%absolute font size needed!
974 \ctikzset{tripoles/en amp/width/.initial=1.7}
975 \ctikzset{tripoles/en amp/port width/.initial=.7}
976 \ctikzset{tripoles/en amp/height/.initial=1.6}
977 \ctikzset{tripoles/en amp/input height/.initial=.3}
978 \ctikzset{tripoles/en amp/up pos/.initial=.45}
979 \ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{12}\selectfont}%absolute font size needed!
980 \ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont}%absolute font size needed!
981 \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
982 \tikzset{
983 en amp text/.code = {
984 \ctikzsetvalof{tripoles/en amp/text}{#1}
985 },
986 en amp text A/.code = {
987 \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}
988 },
989 }
990 \ctikzset{tripoles/gm amp/width/.initial=1.7}
991 \ctikzset{tripoles/gm amp/port width/.initial=.7}
992 \ctikzset{tripoles/gm amp/height/.initial=1.4}
993 \ctikzset{tripoles/gm amp/input height/.initial=.5}
994 \ctikzset{tripoles/gm amp/up pos/.initial=.45}
995 \ctikzset{tripoles/inst amp/width/.initial=1.7} % instrumentation amplifier, simple
996 \ctikzset{tripoles/inst amp/port width/.initial=.7}
997 \ctikzset{tripoles/inst amp/height/.initial=1.4}
998 \ctikzset{tripoles/inst amp/input height/.initial=.5}
999 \ctikzset{tripoles/inst amp/up pos/.initial=.4}
1000 \ctikzset{tripoles/inst amp/refv pos/.initial=.7}
1001 \ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1002 \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % instrumentation amplifier, diff output
1003 \ctikzset{tripoles/fd inst amp/port width/.initial=.7}
1004 \ctikzset{tripoles/fd inst amp/height/.initial=1.4}
1005 \ctikzset{tripoles/fd inst amp/input height/.initial=.5}
1006 \ctikzset{tripoles/fd inst amp/up pos/.initial=.4}
1007 \ctikzset{tripoles/fd inst amp/refv pos/.initial=.7}
1008 \ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1009 \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % instrumentation amplifier with ra gain resistance added
1010 \ctikzset{tripoles/inst amp ra/port width/.initial=.7}
1011 \ctikzset{tripoles/inst amp ra/height/.initial=2.9}
1012 \ctikzset{tripoles/inst amp ra/input height/.initial=.7}
1013 \ctikzset{tripoles/inst amp ra/up pos/.initial=.4}
1014 \ctikzset{tripoles/inst amp ra/refv pos/.initial=.7}
1015 \ctikzset{tripoles/inst amp ra/ra pos/.initial=.6}
1016 \ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1017 \ctikzset{tripoles/plain amp/width/.initial=1.7}
1018 \ctikzset{tripoles/plain amp/port width/.initial=.7}
1019 \ctikzset{tripoles/plain amp/height/.initial=1.4}
1020 \ctikzset{tripoles/plain amp/input height/.initial=.5}
1021 \ctikzset{tripoles/plain amp/up pos/.initial=.45}
1022
1023 \ctikzset{tripoles/thyristor/height/.initial=1.10}
1024 \ctikzset{tripoles/thyristor/height 2/.initial=.5}
1025 \ctikzset{tripoles/thyristor/width/.initial=1.0}
1026 \ctikzset{tripoles/thyristor/diode height/.initial=.5}
1027 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
1028 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
1029
1030 \ctikzset{tripoles/triac/height/.initial=1.1}
1031 \ctikzset{tripoles/triac/width/.initial=1}
1032 \ctikzset{tripoles/triac/diode width left/.initial=.3}
1033 \ctikzset{tripoles/triac/diode width right/.initial=.3}
1034
1035 %% Cute switches
1036 \ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
1037 \ctikzset{bipoles/cuteswitch/height/.initial=.6}
1038 \ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
1039 \ctikzset{bipoles/cuteswitch/width/.initial=.50}
1040 \ctikzset{bipoles/cuteswitch/thickness/.initial=1}
1041
1042 \ctikzset{tripoles/spdt/width/.initial=.85}
1043 \ctikzset{tripoles/spdt/height/.initial=.45}
1044 \ctikzset{tripoles/spdt/margin/.initial=.45}
1045
1046 \ctikzset{tripoles/toggleswitch/height/.initial=.8}
1047 \ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
1048 \ctikzset{tripoles/toggleswitch/width/.initial=.80}
1049
1050 \ctikzset{tripoles/mixer/width/.initial=0.7}
1051 \ctikzset{tripoles/adder/width/.initial=0.7}
1052 \ctikzset{tripoles/circulator/width/.initial=.7}
1053 \ctikzset{tripoles/oscillator/width/.initial=.7}
1054
1055
1056 \ctikzset{tripoles/wilkinson/height/.initial=1.3}
1057 \ctikzset{tripoles/wilkinson/width/.initial=1.3}
1058
1059 \ctikzset{quadpoles/transformer/inner/.initial=0.4}
1060 \ctikzset{quadpoles/transformer/width/.initial=1.5}
1061 \ctikzset{quadpoles/transformer/width1/.initial=.4}
1062 \ctikzset{quadpoles/transformer/height/.initial=1.5}
1063 \ctikzset{quadpoles/transformer/height1/.initial=.8}
1064 \ctikzset{quadpoles/transformer core/inner/.initial=0.4}
1065 \ctikzset{quadpoles/transformer core/width/.initial=1.5}
1066 \ctikzset{quadpoles/transformer core/height/.initial=1.5}
1067 \ctikzset{quadpoles/transformer core/core height/.initial=.5}
1068 \ctikzset{quadpoles/transformer core/core width/.initial=.05}
1069 \ctikzset{quadpoles/gyrator/inner/.initial=0.4}
1070 \ctikzset{quadpoles/gyrator/width/.initial=1.5}
1071 \ctikzset{quadpoles/gyrator/height/.initial=1.5}
1072 \ctikzset{quadpoles/fourport/width/.initial=1.3}
1073 \ctikzset{quadpoles/fourport/height/.initial=1.3}
1074 \ctikzset{quadpoles/coupler/width/.initial=1.3}
1075 \ctikzset{quadpoles/coupler/height/.initial=1.3}
1076 \ctikzset{quadpoles/coupler2/width/.initial=1.3}
1077 \ctikzset{quadpoles/coupler2/height/.initial=1.3}
1078
1079 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
1080
1081 \ctikzset{quadpoles style/.is choice}
1082 \ctikzset{quadpoles style/inward/.code={ % default value
1083 \ctikzset{quadpoles/transformer/inner=0.4}
1084 \ctikzset{quadpoles/transformer/width=1.5}
1085 \ctikzset{quadpoles/transformer core/inner=0.4}
1086 \ctikzset{quadpoles/transformer core/width=1.5}
1087 \ctikzset{quadpoles/gyrator/inner=0.4}
1088 \ctikzset{quadpoles/gyrator/width=1.5}
1089 }
1090 }
1091 \ctikzset{quadpoles style/inline/.code={ % now horizontal baffle
1092 \ctikzset{quadpoles/transformer/inner=1}
1093 \ctikzset{quadpoles/transformer/width=0.6}
1094 \ctikzset{quadpoles/transformer core/inner=1}
1095 \ctikzset{quadpoles/transformer core/width=0.6}
1096 \ctikzset{quadpoles/gyrator/inner=1}
1097 \ctikzset{quadpoles/gyrator/width=0.6}
1098 }
1099 }
1100
1101
1102 %
1103 % multipoles
1104 %
1105 \ctikzset{multipoles/thickness/.initial=2}
1106 \ctikzset{multipoles/font/.initial=\tiny}
1107 % DIP (dual in line package) chips
1108 \ctikzset{multipoles/dipchip/width/.initial=1.2}
1109 \ctikzset{multipoles/dipchip/num pins/.initial=8}
1110 \ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
1111 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
1112 % QFP (quad flat package) chips
1113 \ctikzset{multipoles/qfpchip/num pins/.initial=8}
1114 \ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
1115 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
1116 % chip numbers
1117 \newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
1118 \pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1119 \ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1120 \pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1121 \ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1122 \newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
1123 \pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1124 \ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1125 \pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1126 \ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1127 % external chip pins
1128 \ctikzset{multipoles/external pins thickness/.initial=1}
1129 \ctikzset{multipoles/external pins width/.initial=0.2}
1130 \ctikzset{multipoles/external pad fraction/.initial=0}
1131 \pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
1132 \pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
1133 % topmarks
1134 \newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
1135 \pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1136 \ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1137 \pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1138 \ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1139
1140 % rotary switch by Romano
1141 \ctikzset{multipoles/rotary/thickness/.initial=1}
1142 \ctikzset{multipoles/rotary/shape/.initial=ocirc}
1143 \ctikzset{multipoles/rotary/channels/.initial=5}
1144 \ctikzset{multipoles/rotary/angle/.initial=60}
1145 \ctikzset{multipoles/rotary/wiper/.initial=20}
1146 \ctikzset{multipoles/rotary/arrow/.is choice}
1147 \newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
1148 \newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
1149 \newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
1150 \ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
1151 \ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
1152 \ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
1153 \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
1154
1155 \tikzset{%
1156 rotary switch/.style args={#1in#2wiper#3}{
1157 shape=rotaryswitch,
1158 /tikz/circuitikz/multipoles/rotary/channels=#1,
1159 /tikz/circuitikz/multipoles/rotary/angle=#2,
1160 /tikz/circuitikz/multipoles/rotary/wiper=#3,
1161 },
1162 rotary switch -/.style args={#1in#2wiper#3}{
1163 rotary switch=#1 in #2 wiper #3,
1164 /tikz/circuitikz/multipoles/rotary/arrow=none,
1165 },
1166 rotary switch <-/.style args={#1in#2wiper#3}{
1167 rotary switch=#1 in #2 wiper #3,
1168 /tikz/circuitikz/multipoles/rotary/arrow=ccw,
1169 },
1170 rotary switch ->/.style args={#1in#2wiper#3}{
1171 rotary switch=#1 in #2 wiper #3,
1172 /tikz/circuitikz/multipoles/rotary/arrow=cw,
1173 },
1174 rotary switch <->/.style args={#1in#2wiper#3}{
1175 rotary switch=#1 in #2 wiper #3,
1176 /tikz/circuitikz/multipoles/rotary/arrow=both,
1177 },
1178 % Notice that these should be the same as the initial values of the keys
1179 rotary switch/.default={5 in 60 wiper 20 },
1180 rotary switch -/.default={5 in 60 wiper 20 },
1181 rotary switch <-/.default={5 in 60 wiper 20 },
1182 rotary switch ->/.default={5 in 60 wiper 20 },
1183 rotary switch <->/.default={5 in 60 wiper 20 },
1184 }
1185
1186 % %Mechanical section
1187 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
1188 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
1189 \ctikzset{bipoles/spring/height/.initial=.5}
1190 \ctikzset{bipoles/spring/width/.initial=.5}
1191 \ctikzset{bipoles/mass/height/.initial=.55}
1192 \ctikzset{bipoles/mass/box height/.initial=.4}
1193 \ctikzset{bipoles/mass/width/.initial=.5}
1194
1195 \ctikzset{bipoles/damper/height/.initial=.35}
1196 \ctikzset{bipoles/damper/length/.initial=.3}
1197 \ctikzset{bipoles/damper/width/.initial=.4}
1198
1199
1200 \ctikzset{bipole/.is family}
1201 \ctikzset{bipole/kind/.initial = }
1202 \ctikzset{bipole/name/.initial = }
1203 \newif\ifpgf@circuit@bipole@isvoltage
1204 \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
1205 \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
1206 \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
1207 \newif\ifpgf@circuit@bipole@strokedsymbol
1208 \ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
1209 \newif\ifpgf@circuit@bipole@iscurrent
1210 \ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
1211
1212 \ctikzset{bipole/voltage/.is family}
1213 \newif\ifpgf@circuit@bipole@voltage@backward
1214 \ctikzset{bipole/voltage/direction/.is choice}
1215 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
1216 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
1217 \newif\ifpgf@circuit@bipole@voltage@below
1218 \ctikzset{bipole/voltage/position/.is choice}
1219 \ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
1220 \ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
1221
1222 \ctikzset{bipole/voltage/label/unit/.initial=}
1223 \ctikzset{bipole/voltage/label/name/.initial=}
1224
1225 \ctikzset{bipole/current/.is family}
1226 \newif\ifpgf@circuit@bipole@current@backward
1227 \ctikzset{bipole/current/direction/.is choice}
1228 \ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
1229 \ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
1230 \newif\ifpgf@circuit@bipole@current@before
1231 \ctikzset{bipole/current/x position/.is choice}
1232 \ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
1233 \ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
1234 \newif\ifpgf@circuit@bipole@current@below
1235 \ctikzset{bipole/current/y position/.is choice}
1236 \ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
1237 \ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
1238 \ctikzset{bipole/current/label/unit/.initial=}
1239 \ctikzset{bipole/current/label/name/.initial=}
1240
1241 \ctikzset{bipole/flow/.is family}
1242 \newif\ifpgf@circuit@bipole@flow@backward
1243 \ctikzset{bipole/flow/direction/.is choice}
1244 \ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
1245 \ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
1246 \newif\ifpgf@circuit@bipole@flow@before
1247 \ctikzset{bipole/flow/x position/.is choice}
1248 \ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
1249 \ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
1250 \newif\ifpgf@circuit@bipole@flow@below
1251 \ctikzset{bipole/flow/y position/.is choice}
1252 \ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
1253 \ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
1254 \ctikzset{bipole/flow/label/unit/.initial=}
1255 \ctikzset{bipole/flow/label/name/.initial=}
1256 \ctikzset{flow/distance/.initial = .5}
1257 \ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
1258
1259 \ctikzset{bipole/label/.is family}
1260 \ctikzset{bipole/label/position/.initial=90}
1261 \ctikzset{bipole/label/unit/.initial=}
1262 \ctikzset{bipole/label/name/.initial=}
1263 \ctikzset{bipole/annotation/.is family}
1264 \ctikzset{bipole/annotation/position/.initial=-90}
1265 \ctikzset{bipole/annotation/unit/.initial=}
1266 \ctikzset{bipole/annotation/name/.initial=}
1267
1268 \newif\ifpgf@circuit@europeanresistor
1269 \ctikzset{resistor/.is choice}
1270 \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
1271 \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
1272
1273 \ctikzset{inductor/.is choice}
1274 \ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
1275 \ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
1276 \ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
1277
1278 \newif\ifpgf@circuit@strokediode
1279 \newif\ifpgf@circuit@fulldiode
1280 \pgf@circuit@strokediodefalse
1281 \pgf@circuit@fulldiodefalse
1282
1283 \ctikzset{diode/.is choice}
1284 \ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
1285 \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
1286 \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
1287
1288 \tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }}
1289 \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }}
1290 \tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }}
1291
1292 \ctikzset{thickness/.initial=2}
1293 \ctikzset{color/.initial=black}
1294 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
1295
1296 \newif\ifpgf@circ@siunitx
1297 \newif\ifpgf@circ@siunitx@res
1298
1299 \ctikzset{straight/.is choice}
1300 \ctikzset{straightvoltage value/.initial=true}
1301 \ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
1302 \ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
1303 \ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
1304 \newif\ifpgf@circuit@bipole@voltage@straight
1305 \ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
1306
1307
1308 \ctikzset{voltage/.is family}
1309 \ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
1310 \ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
1311 \ctikzset{voltage/bump a/.initial=1.2}
1312 \ctikzset{voltage/bump b/.initial=1.5}
1313 \ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
1314 \ctikzset{voltage shift/.style={voltage/shift=#1}}
1315 \tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
1316 \ctikzset{voltage/european label distance/.initial=1.4}
1317 \ctikzset{voltage/american label distance/.initial=1.1}
1318 % shaping the +/- sign, see pgfcircvoltage.tex
1319 \ctikzset{voltage/american font/.initial={}}
1320 \ctikzset{voltage/american plus/.initial={$+$}}
1321 \ctikzset{voltage/american minus/.initial={$-$}}
1322
1323 % special cases
1324 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
1325 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
1326 \ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
1327 %\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
1328 \ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
1329 \ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
1330 \ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
1331 \ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
1332 \ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
1333 \ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
1334 \ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
1335 \ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
1336 \ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
1337 \ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
1338 \ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
1339 %\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
1340 \ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
1341 \ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
1342 %\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
1343 \ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
1344 \ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
1345 %\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
1346 \ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
1347 \ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
1348 %\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
1349 \ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
1350 \ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
1351 %\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
1352 \ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
1353 %\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
1354 \ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
1355
1356 \ctikzset{current/.is family}
1357 \ctikzset{current/distance/.initial = .5}
1358
1359
1360 \tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
1361 \tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
1362 \tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
1363 \tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
1364 \tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
1365 \tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
1366
1367 \newif\ifpgf@circuit@europeangfsurgearrester
1368 \ctikzset{gas filled surge arrester choice/.is choice}
1369 \ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
1370 \ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
1371
1372 \tikzset{american gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=american } }
1373 \tikzset{european gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=european } }
1374 \tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
1375 \tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
1376 \tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
1377 \tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
1378 \tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
1379 \tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set} }
1380 \tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set} }
1381 \tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
1382
1383 % I should try to make the tree clearer (this voltage conflicts with the options above)
1384
1385 \newif\ifpgf@circuit@europeanvoltage
1386 \ctikzset{voltage/.is choice}
1387 \ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
1388 \ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
1389
1390 \newif\ifpgf@circuit@europeancurrent
1391 \ctikzset{current/.is choice}
1392 \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
1393 \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
1394
1395 % noise sources
1396 \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
1397
1398 \ctikzset{label/align/.is choice}
1399 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
1400 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
1401 \ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
1402
1403 % seven segment displays by RGtti
1404
1405 \newif\ifpgf@circ@sevenseg@dot
1406 \newif\ifpgf@circ@sevenseg@box
1407 \def\pgf@circ@sevenseg@dotstate{empty}
1408 \ctikzset{seven seg/.is family}
1409 \ctikzset{seven seg/dot/.is choice}
1410 % none means no dot, not space for it. Empty means no dot, but space
1411 \ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
1412 \ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
1413 \ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
1414 \ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
1415 %
1416 \ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
1417 \ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
1418 \ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
1419 \ctikzset{seven seg/box sep/.initial=1pt}% external box gap
1420 \ctikzset{seven seg/color on/.initial=red}% color for segment "on"
1421 \ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
1422 \ctikzset{seven seg/box/.is choice}
1423 \ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
1424 \ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
1425
1426 \ctikzset{seven seg/bits/.initial=0000000}
1427
1428 \ctikzset{seven seg/value/.code={
1429 \edef\@@tmp{#1}
1430 \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
1431 \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
1432 \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
1433 \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
1434 \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
1435 \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
1436 \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
1437 \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
1438 \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
1439 \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
1440 \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1441 \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1442 \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1443 \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1444 \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1445 \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1446 \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1447 \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1448 \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1449 \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1450 \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1451 \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1452 \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1453 \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1454 \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1455 \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1456 \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1457 \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1458 \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
1459 }}
1460
1461 \tikzset{%
1462 seven segment val/.style args={#1dot#2box#3}{
1463 shape=bare7seg,
1464 /tikz/circuitikz/seven seg/value=#1,
1465 /tikz/circuitikz/seven seg/dot=#2,
1466 /tikz/circuitikz/seven seg/box=#3,
1467 },
1468 seven segment bits/.style args={#1dot#2box#3}{
1469 shape=bare7seg,
1470 /tikz/circuitikz/seven seg/bits=#1,
1471 /tikz/circuitikz/seven seg/dot=#2,
1472 /tikz/circuitikz/seven seg/box=#3,
1473 },
1474 }
1475
1476
1477 %%%%%%%%%% new
1478 \pgfkeys{\circuitikzbasekey/.search also={/tikz}}
1479
1480 % Electronic tubes: diodetube, triode, tetrode and pentode
1481 \ctikzset{tubes/width/.initial=1} % relative width
1482 \ctikzset{tubes/height/.initial=1.4} % relative height
1483 \ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
1484 \ctikzset{tubes/anode distance/.initial=0.40} % distance from center
1485 \ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
1486 \ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
1487 \ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
1488 \ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
1489 \ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
1490 \ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
1491 \ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
1492 \ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
1493 \ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
1494 \ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
1495 \ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
1496
1497 \newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
1498 \pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1499 \ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1500 \newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
1501 \pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1502 \ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1503 \newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
1504 \pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1505 \ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1506
1507 %%%---------- close: tex/pgfcirc.defines
1508 %%%%%%%%%%% Springe nach tex/pgfcircutils
1509 %%%---------- open: tex/pgfcircutils.tex
1510 % Copyright 2007-2009 by Massimo Redaelli
1511 %
1512 % This file may be distributed and/or modified
1513 %
1514 % 1. under the LaTeX Project Public License and/or
1515 % 2. under the GNU Public License.
1516 %
1517 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1518
1519 %\def\pgf@circ@handleSI#1{%
1520 % \pgf@circ@siunitx@resfalse
1521 %
1522 % \edef\len{\stringlength[e]{#1}}
1523 %\testmatchingchar[e]{#1}{\len}{>}%
1524 %\ifmatchingchar%
1525 % \ifnum\findchars{#1}{<}=0
1526 % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
1527 %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
1528 %\pgf@circ@siunitx@restrue
1529 % \else
1530 % \fi
1531 %\else
1532 %\fi
1533 %}
1534
1535 \def\pgf@circ@handleSI#1{
1536 \noexpandarg
1537 \def\pgf@temp{}
1538 \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
1539 \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
1540
1541 \ifnum\pgf@circ@handleSI@unit@len=0
1542 \pgf@circ@siunitx@resfalse
1543 \else
1544 \IfEndWith{#1}{>}{
1545 \pgf@circ@siunitx@restrue
1546 \noexpandarg
1547 \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
1548 %\typeout{si |#1|}
1549 }{
1550 \pgf@circ@siunitx@resfalse
1551 %\typeout{no si |#1|}
1552 }
1553 \fi
1554 }
1555
1556 \def\pgf@circ@ifkeyempty#1{
1557 \pgfextra{
1558 \ctikzset{#1/.get=\pgf@circ@temp}
1559 \edef\pgf@temp{}
1560 }
1561 \ifx\pgf@circ@temp\pgf@temp
1562 }
1563
1564 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1565 %% Math routines
1566
1567 \def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
1568
1569 %%%---------- close: tex/pgfcircutils
1570
1571 %%%%%%%%%%% Springe nach tex/pgfcircshapes
1572 %%%---------- open: tex/pgfcircshapes.tex
1573 % Copyright 2007-2009 by Massimo Redaelli
1574 %
1575 % This file may be distributed and/or modified
1576 %
1577 % 1. under the LaTeX Project Public License and/or
1578 % 2. under the GNU Public License.
1579 %
1580 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1581
1582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1583 %% Other shapes
1584
1585 %% Nothing
1586
1587 \pgfdeclareshape{emptyshape}{
1588 \savedanchor{\northeast}{%
1589 \pgf@x=.5\wd\pgfnodeparttextbox%
1590 \pgf@y=.5\ht\pgfnodeparttextbox%
1591 }
1592 \anchor{north}{\northeast\pgf@x=0cm\relax}
1593 \anchor{east}{\northeast\pgf@y=0cm\relax}
1594 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
1595 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
1596 \anchor{north east}{\northeast}
1597 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
1598 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
1599 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
1600 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
1601 \anchor{center}{
1602 \pgfpointorigin
1603 }
1604 }
1605
1606 %% Full terminal
1607
1608 \pgfdeclareshape{circ}{
1609 \anchor{center}{
1610 \pgfpointorigin
1611 }
1612 \savedanchor\northwest{%
1613 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1614 \pgf@x=-\pgf@y
1615 }
1616 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1617 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1618 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1619 \anchor{west}{ \northwest \pgf@y=0pt }
1620 \anchor{w}{ \northwest \pgf@y=0pt }
1621 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1622 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1623 \anchor{north}{ \northwest \pgf@x=0pt }
1624 \anchor{n}{ \northwest \pgf@x=0pt }
1625 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1626 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1627 \anchor{north west}{ \northwest }
1628 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1629 \anchorborder{
1630 \pgf@circ@res@left=\pgf@x
1631 \pgf@circ@res@up=\pgf@y
1632 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1633 }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
1634 }
1635 \behindforegroundpath{
1636
1637 \pgfscope
1638 \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
1639 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1640 \pgfsetfillopacity{1.0}
1641 \pgfusepath{draw,fill}
1642 \endpgfscope
1643
1644 }
1645 }
1646
1647 %% Empty terminal
1648
1649 \pgfdeclareshape{ocirc}{
1650 \anchor{center}{
1651 \pgfpointorigin
1652 }
1653 \savedanchor\northwest{%
1654 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1655 \pgf@x=-\pgf@y
1656 }
1657 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1658 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1659 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1660 \anchor{west}{ \northwest \pgf@y=0pt }
1661 \anchor{w}{ \northwest \pgf@y=0pt }
1662 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1663 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1664 \anchor{north}{ \northwest \pgf@x=0pt }
1665 \anchor{n}{ \northwest \pgf@x=0pt }
1666 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1667 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1668 \anchor{north west}{ \northwest }
1669 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1670 \anchorborder{
1671 \pgf@circ@res@left=\pgf@x
1672 \pgf@circ@res@up=\pgf@y
1673 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1674 }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
1675 }
1676
1677 \behindforegroundpath{
1678
1679 \pgfscope
1680 \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
1681 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1682 \ifx\tikz@fillcolor\pgfutil@empty
1683 \pgfsetfillcolor{white}
1684 \else
1685 \pgfsetfillcolor{\tikz@fillcolor}
1686 \fi
1687 \pgfsetfillopacity{1.0}
1688 \pgfusepath{draw,fill}
1689 \endpgfscope
1690
1691 }
1692 }
1693
1694 %% Diamond terminal
1695
1696 \pgfdeclareshape{diamondpole}{
1697 \anchor{center}{
1698 \pgfpointorigin
1699 }
1700 \savedanchor\northwest{%
1701 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1702 \pgf@x=-\pgf@y
1703 }
1704 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1705 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1706 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1707 \anchor{west}{ \northwest \pgf@y=0pt }
1708 \anchor{w}{ \northwest \pgf@y=0pt }
1709 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1710 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1711 \anchor{north}{ \northwest \pgf@x=0pt }
1712 \anchor{n}{ \northwest \pgf@x=0pt }
1713 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1714 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1715 \anchor{north west}{ \northwest }
1716 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1717 \anchorborder{
1718 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
1719 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
1720 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
1721 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
1722 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
1723 \pgfextracty{\pgf@circ@res@up}{\northwest}
1724 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
1725 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
1726 \pgfpointintersectionoflines
1727 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
1728 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
1729 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
1730 \pgf@x=\@@switchx\pgf@x
1731 \pgf@y=\@@switchy\pgf@y
1732 }
1733 \behindforegroundpath{
1734 \pgfscope
1735 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1736 \pgftransformrotate{45}
1737 \pgfpathrectanglecorners
1738 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
1739 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
1740 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1741 \pgfsetfillopacity{1.0}
1742 \pgfusepath{draw,fill}
1743 \endpgfscope
1744 }
1745 }
1746
1747 %% Diamond terminal, unfilled
1748
1749 \pgfdeclareshape{odiamondpole}{
1750 \anchor{center}{
1751 \pgfpointorigin
1752 }
1753 \savedanchor\northwest{%
1754 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1755 \pgf@x=-\pgf@y
1756 }
1757 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1758 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1759 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1760 \anchor{west}{ \northwest \pgf@y=0pt }
1761 \anchor{w}{ \northwest \pgf@y=0pt }
1762 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1763 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1764 \anchor{north}{ \northwest \pgf@x=0pt }
1765 \anchor{n}{ \northwest \pgf@x=0pt }
1766 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1767 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1768 \anchor{north west}{ \northwest }
1769 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1770 \anchorborder{
1771 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
1772 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
1773 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
1774 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
1775 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
1776 \pgfextracty{\pgf@circ@res@up}{\northwest}
1777 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
1778 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
1779 \pgfpointintersectionoflines
1780 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
1781 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
1782 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
1783 \pgf@x=\@@switchx\pgf@x
1784 \pgf@y=\@@switchy\pgf@y
1785 }
1786 \behindforegroundpath{
1787 \pgfscope
1788 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1789 \pgftransformrotate{45}
1790 \pgfpathrectanglecorners
1791 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
1792 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
1793 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1794 \ifx\tikz@fillcolor\pgfutil@empty
1795 \pgfsetfillcolor{white}
1796 \else
1797 \pgfsetfillcolor{\tikz@fillcolor}
1798 \fi
1799 \pgfsetfillopacity{1.0}
1800 \pgfusepath{draw,fill}
1801 \endpgfscope
1802 }
1803 }
1804
1805 %% square terminal, filled
1806
1807 \pgfdeclareshape{squarepole}{
1808 \anchor{center}{
1809 \pgfpointorigin
1810 }
1811 \savedanchor\northwest{%
1812 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1813 \pgf@x=-\pgf@y
1814 }
1815 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1816 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1817 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1818 \anchor{west}{ \northwest \pgf@y=0pt }
1819 \anchor{w}{ \northwest \pgf@y=0pt }
1820 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1821 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1822 \anchor{north}{ \northwest \pgf@x=0pt }
1823 \anchor{n}{ \northwest \pgf@x=0pt }
1824 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1825 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1826 \anchor{north west}{ \northwest }
1827 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1828 \anchorborder{
1829 \pgf@xa=\pgf@x
1830 \pgf@ya=\pgf@y
1831 \pgfextracty{\pgf@circ@res@up}{\northwest}
1832 \pgfpointborderrectangle
1833 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
1834 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
1835 }
1836 \behindforegroundpath{
1837 \pgfscope
1838 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1839 \pgfpathrectanglecorners
1840 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
1841 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
1842 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1843 \pgfsetfillopacity{1.0}
1844 \pgfusepath{draw,fill}
1845 \endpgfscope
1846 }
1847 }
1848 %% square terminal, unfilled
1849
1850 \pgfdeclareshape{osquarepole}{
1851 \anchor{center}{
1852 \pgfpointorigin
1853 }
1854 \savedanchor\northwest{%
1855 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1856 \pgf@x=-\pgf@y
1857 }
1858 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1859 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1860 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1861 \anchor{west}{ \northwest \pgf@y=0pt }
1862 \anchor{w}{ \northwest \pgf@y=0pt }
1863 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1864 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1865 \anchor{north}{ \northwest \pgf@x=0pt }
1866 \anchor{n}{ \northwest \pgf@x=0pt }
1867 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1868 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1869 \anchor{north west}{ \northwest }
1870 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1871 \anchorborder{
1872 \pgf@xa=\pgf@x
1873 \pgf@ya=\pgf@y
1874 \pgfextracty{\pgf@circ@res@up}{\northwest}
1875 \pgfpointborderrectangle
1876 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
1877 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
1878 }
1879 \behindforegroundpath{
1880 \pgfscope
1881 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1882 \pgfpathrectanglecorners
1883 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
1884 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
1885 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1886 \ifx\tikz@fillcolor\pgfutil@empty
1887 \pgfsetfillcolor{white}
1888 \else
1889 \pgfsetfillcolor{\tikz@fillcolor}
1890 \fi
1891 \pgfsetfillopacity{1.0}
1892 \pgfusepath{draw,fill}
1893 \endpgfscope
1894 }
1895 }
1896 % BNC connector
1897
1898 \pgfdeclareshape{bnc}{
1899 \anchor{center}{
1900 \pgfpointorigin
1901 }
1902 % BNC size is 2.5 times the size of the internal "ocirc"
1903 \savedanchor\northwest{%
1904 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1905 \pgf@y=2.5\pgf@y
1906 \pgf@x=-\pgf@y
1907 }
1908 % center is on the opening
1909 \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1910 \anchor{zero}{ \pgfpointorigin }
1911 \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1912 \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1913 % geo-anchors
1914 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1915 \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1916 \anchor{west}{ \northwest \pgf@y=0pt }
1917 \anchor{left}{ \northwest \pgf@y=0pt }
1918 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1919 \anchor{north}{ \northwest \pgf@x=0pt }
1920 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1921 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1922 \anchor{north west}{ \northwest }
1923 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1924 % put the node text above and centered
1925 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
1926 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
1927 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
1928 }
1929 }
1930 \anchorborder{
1931 \pgf@circ@res@left=\pgf@x
1932 \pgf@circ@res@up=\pgf@y
1933 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1934 }{\pgfpoint{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
1935 }
1936 \behindforegroundpath{
1937 \pgfextracty{\pgf@circ@res@other}{\northwest}
1938 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1939 \pgfscope
1940 \pgfstartlinewidth=\pgflinewidth
1941 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
1942 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1943 % external circle
1944 \pgfscope
1945 % clipping path: first a rectangle bigger then the shape
1946 % to avoid problems with the line thickness
1947 \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
1948 {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
1949 % next the opening to the right
1950 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
1951 {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
1952 % do the difference and clip before drawing
1953 \pgfseteorule
1954 \pgfusepath{clip}
1955 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
1956 \pgfusepath{draw}
1957 \endpgfscope
1958 % internal circle
1959 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
1960 \pgf@circ@draworfill
1961 % and the contact line to the right
1962 \pgfsetlinewidth{\pgfstartlinewidth}
1963 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
1964 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
1965 \pgfusepath{draw}
1966 \endpgfscope
1967 }
1968 }
1969
1970 %% Fill for correct rectangular joins
1971
1972 \pgfdeclareshape{rectjoinfill}{
1973 \savedanchor{\northeast}{%
1974 \pgf@x=.5\pgflinewidth%
1975 \pgf@y=.5\pgflinewidth%
1976 }
1977 \anchor{north}{\northeast\pgf@x=0cm\relax}
1978 \anchor{east}{\northeast\pgf@y=0cm\relax}
1979 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
1980 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
1981 \anchor{north east}{\northeast}
1982 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
1983 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
1984 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
1985 \anchor{center}{
1986 \pgfpointorigin
1987 }
1988 \anchorborder{
1989 \pgf@circ@res@left=\pgf@x
1990 \pgf@circ@res@up=\pgf@y
1991 }
1992 \behindforegroundpath{
1993 \pgfscope
1994 \pgfpathrectanglecorners
1995 {\pgfpoint{0}{.5\pgflinewidth}}
1996 {\pgfpoint{0}{-.5\pgflinewidth}}
1997 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1998 \pgfusepath{draw,fill}
1999 \endpgfscope
2000 }
2001 }
2002
2003
2004 %% Current arrow
2005
2006 \pgfdeclareshape{currarrow}{
2007 \savedanchor{\northeast}{%
2008 \pgf@circ@res@step = \pgf@circ@Rlen
2009 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2010 \pgf@x=.5\pgf@circ@res@step
2011 \pgf@y=\pgf@x%
2012 }
2013 \anchor{north}{\northeast\pgf@x=0cm\relax}
2014 \anchor{east}{\northeast\pgf@y=0cm\relax}
2015 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2016 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2017 \anchor{north east}{\northeast}
2018 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2019 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2020 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2021 \anchor{center}{
2022 \pgfpointorigin
2023 }
2024 \anchor{tip}{
2025 \pgfpointorigin
2026 \pgf@circ@res@step = \pgf@circ@Rlen
2027 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2028 \pgf@x =\pgf@circ@res@step
2029 }
2030 \behindforegroundpath{
2031 \pgfscope
2032 \pgf@circ@res@step = \pgf@circ@Rlen
2033 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2034
2035 \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2036 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2037 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2038 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2039 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2040 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2041 \pgfusepath{draw,fill}
2042
2043 \endpgfscope
2044 }
2045 }
2046
2047 %% Flow arrow
2048
2049 \pgfdeclareshape{flowarrow}{
2050 \savedanchor{\northeast}{%
2051 \pgf@circ@res@step = \pgf@circ@Rlen
2052 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2053 \pgf@y=.5\pgf@circ@res@step
2054 \pgf@circ@res@step = \pgf@circ@Rlen
2055 \divide \pgf@circ@res@step by 4
2056 \pgf@x=\pgf@circ@res@step%
2057 }
2058 \anchor{north}{\northeast\pgf@x=0cm\relax}
2059 \anchor{east}{\northeast\pgf@y=0cm\relax}
2060 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2061 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2062 \anchor{north east}{\northeast}
2063 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2064 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2065 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2066 \anchor{center}{
2067 \pgfpointorigin
2068 }
2069 \anchor{tip}{
2070 \pgfpointorigin
2071 \pgf@circ@res@step = \pgf@circ@Rlen
2072 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2073 \pgf@x =\pgf@circ@res@step
2074 }
2075 \behindforegroundpath{
2076 \pgfscope
2077 \pgf@circ@res@step = \pgf@circ@Rlen
2078 \divide \pgf@circ@res@step by 4
2079 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
2080 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2081 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2082 \pgfusepath{draw}
2083 \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
2084 \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
2085 \endpgfscope
2086 }
2087 }
2088
2089 %% Input arrow
2090
2091 \pgfdeclareshape{inputarrow}{
2092 \savedanchor{\northeast}{% this is really not northeast, really -northwest
2093 \pgf@circ@res@step = \pgf@circ@Rlen
2094 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2095 \pgf@y=.5\pgf@circ@res@step
2096 \pgf@x=1.7\pgf@circ@res@step
2097 }
2098 \anchor{north}{\northeast\pgf@x=0cm\relax}
2099 \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
2100 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2101 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2102 \anchor{north east}{\northeast\pgf@x=0cm\relax}
2103 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2104 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
2105 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2106 \savedanchor{\tip}{
2107 \pgfpointorigin
2108 }
2109 \anchor{center}{
2110 \tip
2111 }
2112 \anchor{tip}{
2113 \tip
2114 }
2115 \behindforegroundpath{
2116
2117 \pgfscope
2118 \pgf@circ@res@step = \pgf@circ@Rlen
2119 \divide \pgf@circ@res@step by 16
2120
2121 \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2122 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2123 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
2124 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2125 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2126 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2127 \pgfusepath{fill}
2128
2129 \endpgfscope
2130 }
2131 }
2132
2133
2134 %% box
2135
2136 \pgfdeclareshape{box}{
2137 \anchor{center}{
2138 \pgfpointorigin
2139 }
2140 \behindforegroundpath{
2141
2142 \pgfscope
2143 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
2144 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2145 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2146 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2147 \pgf@circ@draworfill
2148 \endpgfscope
2149 }
2150
2151 }
2152
2153
2154 % full nodes for wire crossing
2155
2156 \pgfdeclareshape{jump crossing}
2157 {
2158 \savedanchor\northwest{%
2159 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2160 \pgf@y=.5\pgf@y
2161 \pgf@x=-\pgf@y
2162 }
2163 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2164 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2165 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2166 \anchor{west}{ \northwest \pgf@y=0pt }
2167 \anchor{w}{ \northwest \pgf@y=0pt }
2168 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2169 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2170 \anchor{north}{ \northwest \pgf@x=0pt }
2171 \anchor{n}{ \northwest \pgf@x=0pt }
2172 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2173 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2174 \anchor{north west}{ \northwest }
2175 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2176 \behindbackgroundpath{
2177 \northwest
2178 \pgf@circ@res@up = \pgf@y
2179 \pgf@circ@res@down = -\pgf@y
2180 \pgf@circ@res@right = -\pgf@x
2181 \pgf@circ@res@left = \pgf@x
2182 % horizontal jumper
2183 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2184 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
2185 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
2186 \pgfsetbeveljoin
2187 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2188 % vertical, broken path
2189 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2190 \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
2191 \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
2192 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2193 \pgfusepath{draw}
2194
2195 }
2196 }
2197 \pgfdeclareshape{plain crossing}
2198 {
2199 \savedanchor\northwest{%
2200 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2201 \pgf@y=.5\pgf@y
2202 \pgf@x=-\pgf@y
2203 }
2204 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2205 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2206 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2207 \anchor{west}{ \northwest \pgf@y=0pt }
2208 \anchor{w}{ \northwest \pgf@y=0pt }
2209 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2210 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2211 \anchor{north}{ \northwest \pgf@x=0pt }
2212 \anchor{n}{ \northwest \pgf@x=0pt }
2213 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2214 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2215 \anchor{north west}{ \northwest }
2216 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2217 \behindbackgroundpath{
2218 \northwest
2219 \pgf@circ@res@up = \pgf@y
2220 \pgf@circ@res@down = -\pgf@y
2221 \pgf@circ@res@right = -\pgf@x
2222 \pgf@circ@res@left = \pgf@x
2223 % horizontal jumper
2224 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2225 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2226 % vertical, broken path
2227 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2228 \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
2229 \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
2230 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2231 \pgfusepath{draw}
2232
2233 }
2234 }
2235
2236 %%%---------- close: tex/pgfcircshapes
2237 %%%%%%%%%%% Springe nach tex/pgfcircmonopoles
2238 %%%---------- open: tex/pgfcircmonopoles.tex
2239 % Copyright 2007-2009 by Massimo Redaelli
2240 %
2241 % This file may be distributed and/or modified
2242 %
2243 % 1. under the LaTeX Project Public License and/or
2244 % 2. under the GNU Public License.
2245 %
2246 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2247
2248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2249 %% Monopoles
2250
2251 %% Ground symbol
2252 % #1 -> name
2253 % #2 -> width
2254 % #3 -> depth
2255 % #4 -> code
2256 \long\def\pgf@circ@declareground#1#2#3#4{
2257 \pgfdeclareshape{#1}{
2258 \savedanchor{\southeast}{
2259 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2260 \pgf@x=#2\pgf@x
2261 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2262 \pgf@y=-#3\pgf@y
2263 }
2264 \anchor{north}{\pgfpointorigin}
2265 \anchor{north east}{\southeast\pgf@y=0pt\relax}
2266 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
2267 \anchor{south east}{\southeast}
2268 \anchor{south}{\southeast\pgf@x=0pt\relax}
2269 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2270 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
2271 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
2272 \anchor{left}{\pgfpointorigin}
2273 \anchor{right}{\pgfpointorigin}
2274 \anchor{center}{\pgfpointorigin}
2275 \behindforegroundpath{
2276 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2277 \pgfscope
2278 \pgfstartlinewidth=\pgflinewidth
2279 #4
2280 \endpgfscope
2281 }
2282 }
2283 }
2284
2285
2286 \pgf@circ@declareground{ground}{0.6}{1.6}{
2287 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2288 \pgfpathmoveto{\pgfpointorigin}
2289 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2290 \pgfusepath{draw}
2291 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2292 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2293 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2294 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2295 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2296 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2297 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2298 \pgfusepath{draw}
2299 }
2300
2301 \pgf@circ@declareground{tlground}{0.6}{0.4}{
2302 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2303 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2304 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2305 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2306 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2307 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2308 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2309 \pgfusepath{draw}
2310 }
2311
2312
2313 \pgf@circ@declareground{rground}{0.6}{1}{
2314 \pgfpathmoveto{\pgfpointorigin}
2315 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2316 \pgfusepath{draw}
2317
2318 \pgfstartlinewidth=\pgflinewidth
2319 \pgfsetlinewidth{\ctikzvalof{monopoles/rground/thickness}\pgfstartlinewidth}
2320
2321 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2322 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2323 \pgfsetroundcap\pgfusepath{draw}
2324 }
2325
2326 \pgf@circ@declareground{tground}{0.6}{0}{
2327 \pgfpathmoveto{\pgfpointorigin}
2328 \pgfusepath{draw}
2329
2330 \pgfstartlinewidth=\pgflinewidth
2331 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2332
2333 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2334 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2335 \pgfusepath{draw}
2336 }
2337
2338 \pgf@circ@declareground{sground}{0.6}{1.8}{
2339 \pgfpathmoveto{\pgfpointorigin}
2340 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2341 \pgfusepath{draw}
2342
2343 \pgfstartlinewidth=\pgflinewidth
2344 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2345
2346 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2347 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2348 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
2349 \pgfpathclose
2350 \pgf@circ@draworfill
2351 }
2352
2353 % noiseless ground
2354 \pgf@circ@declareground{nground}{0.9}{1.6}{
2355 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2356 \pgfpathmoveto{\pgfpointorigin}
2357 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2358 \pgfusepath{draw}
2359 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2360 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2361 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2362 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2363 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2364 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2365 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2366 \pgfusepath{draw}
2367 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2368 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
2369 \pgfusepath{draw}
2370 }
2371
2372 % protective ground
2373 \pgf@circ@declareground{pground}{0.9}{1.8}{
2374 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2375 \pgfpathmoveto{\pgfpointorigin}
2376 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
2377 \pgfusepath{draw}
2378 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2379 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2380 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2381 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2382 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2383 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2384 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2385 \pgfusepath{draw}
2386 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
2387 \pgfusepath{draw}
2388 }
2389
2390 % chassis ground
2391 \pgf@circ@declareground{cground}{1}{2}{
2392 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2393 \pgfpathmoveto{\pgfpointorigin}
2394 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
2395 \pgfusepath{draw}
2396 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2397 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2398 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2399 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2400 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2401 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2402 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2403 \pgfusepath{draw}
2404 }
2405
2406 % Contributed by @fotesan https://github.com/fotesan
2407
2408 \pgf@circ@declareground{eground}{1.1}{1.7}{
2409 \pgfpathmoveto{\pgfpointorigin}
2410 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2411 \pgfusepath{draw}
2412
2413 \pgfstartlinewidth=\pgflinewidth
2414 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2415
2416 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2417 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2418 \pgfusepath{draw}
2419
2420 \pgfsetlinewidth{\pgfstartlinewidth}
2421 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2422 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2423 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2424 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2425 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2426 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2427 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2428 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2429 \pgfusepath{draw}
2430 }
2431
2432 \pgf@circ@declareground{eground2}{1.1}{1.7}{
2433 \pgfpathmoveto{\pgfpointorigin}
2434 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2435 \pgfusepath{draw}
2436
2437 \pgfstartlinewidth=\pgflinewidth
2438 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2439
2440 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2441 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2442 \pgfusepath{draw}
2443
2444 \pgfsetlinewidth{\pgfstartlinewidth}
2445 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2446 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2447 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2448 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2449 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2450 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2451 \pgfusepath{draw}
2452 }
2453
2454 % Contributed by Leonardo Azzinnari
2455 \pgfdeclareshape{tlinestub}{
2456 \savedanchor{\northeast}{%
2457 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2458 \pgf@x=1.625\pgf@circ@res@step
2459 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2460 \pgf@y=.25\pgf@circ@res@step%
2461 }
2462 % the center is on the left side of the shape for facility of usage
2463 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
2464 \anchor{east}{\northeast\pgf@y=0cm\relax}
2465 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
2466 \anchor{west}{\pgfpointorigin}
2467 \anchor{north east}{\northeast}
2468 \anchor{north west}{\northeast\pgf@x=0cm\relax}
2469 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2470 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
2471 \anchor{center}{\pgfpointorigin}
2472 \behindforegroundpath{
2473 \pgfstartlinewidth=\pgflinewidth
2474
2475 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2476
2477 \pgfscope\begin{pgftransparencygroup}
2478 \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2479 \pgf@circ@maybefill
2480 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2481 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2482 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
2483 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
2484 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2485 \pgf@circ@draworfill
2486 \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2487 \pgfusepath{draw}
2488 \end{pgftransparencygroup} \endpgfscope
2489 \pgfpathmoveto{\pgfpointorigin}
2490 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
2491 \pgfusepath{draw}
2492 }
2493 }
2494
2495 %% New antennas without tails
2496
2497 % main body
2498 \def\pgf@circ@antennabody{%
2499 \pgfstartlinewidth=\pgflinewidth
2500 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2501 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2502 \pgfscope
2503 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2504 \pgfpathmoveto{\pgfpointorigin}
2505 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
2506 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
2507 \pgfsetbeveljoin
2508 \pgfpathclose
2509 \pgf@circ@draworfill
2510 \endpgfscope
2511 \pgfsetlinewidth{\pgfstartlinewidth}
2512 \pgfpathmoveto{\pgfpointorigin}
2513 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
2514 \pgfusepath{draw}
2515 }
2516
2517 % Waves for the antennas.
2518 \def\pgf@circ@antennawaves{%
2519 \pgfscope
2520 % define a triangle for clipping the waves
2521 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
2522 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
2523 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2524 \pgfpathclose
2525 \pgfusepath{clip}
2526 % ...and build the waves as clipped circles
2527 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
2528 \pgfmathloop%
2529 \ifnum\pgf@circ@count@a>2
2530 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
2531 \advance\pgf@circ@count@a-1\relax%
2532 \repeatpgfmathloop
2533 \pgfusepath{draw}
2534 \endpgfscope
2535 }
2536
2537
2538 % additional shape with the waves
2539 \pgfdeclareshape{waves}{
2540 \anchor{center}{\pgfpointorigin}
2541 \savedanchor{\northeast}{
2542 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
2543 \pgf@x=\pgf@circ@res@step
2544 \pgf@y=\pgf@circ@res@step
2545 }
2546 \anchor{text}{
2547 \northeast
2548 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2549 }
2550 \anchor{top}{\northeast\pgf@x=0pt}
2551 \anchor{right}{\northeast\pgf@y=0pt}
2552 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
2553 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
2554 \anchor{north}{\northeast\pgf@x=0pt}
2555 \anchor{north east}{\northeast}
2556 \anchor{east}{\northeast\pgf@y=0pt}
2557 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2558 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
2559 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2560 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
2561 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2562 \behindforegroundpath{
2563 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
2564 \pgf@circ@res@step=0.5\pgf@circ@res@step
2565 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2566 \pgfscope
2567 % define a triangle for clipping the waves
2568 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
2569 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
2570 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
2571 \pgfpathclose
2572 \pgfusepath{clip}
2573 % ...and build the waves as clipped circles
2574 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
2575 \pgfmathloop%
2576 \ifnum\c@pgf@counta>1
2577 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
2578 \advance\c@pgf@counta-1\relax%
2579 \repeatpgfmathloop
2580 \pgfusepath{draw}
2581 \endpgfscope
2582 }
2583 }
2584
2585 % the three types of antennas: simple, TX, RX. Notice that you can flip them...
2586
2587 \pgfdeclareshape{bareantenna}{
2588 \anchor{center}{\pgfpointorigin}
2589 \savedanchor{\northeast}{
2590 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2591 \pgf@x=\pgf@circ@res@step
2592 \pgf@y=2\pgf@circ@res@step
2593 }
2594 \anchor{text}{
2595 \northeast
2596 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2597 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2598 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2599 }
2600 \anchor{top}{\northeast\pgf@x=0pt}
2601 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2602 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2603 \anchor{bottom}{\pgfpointorigin}
2604 \anchor{north}{\northeast\pgf@x=0pt}
2605 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2606 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2607 \anchor{south}{\pgfpointorigin}
2608 \anchor{north east}{\northeast}
2609 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2610 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2611 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2612 \behindforegroundpath{
2613 \pgf@circ@antennabody
2614 }
2615 }
2616
2617 \pgfdeclareshape{bareTXantenna}{
2618 \anchor{center}{\pgfpointorigin}
2619 \savedanchor{\northeast}{
2620 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2621 \pgf@x=\pgf@circ@res@step
2622 \pgf@y=2\pgf@circ@res@step
2623 }
2624 \anchor{text}{
2625 \northeast
2626 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2627 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2628 \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
2629 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2630 }
2631 \anchor{waves}{
2632 \northeast
2633 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2634 \pgf@x=4.2\pgf@circ@res@step
2635 \pgf@y=\pgf@circ@res@step
2636 }
2637 \anchor{top}{\northeast\pgf@x=0pt}
2638 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2639 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2640 \anchor{bottom}{\pgfpointorigin}
2641 \anchor{north}{\northeast\pgf@x=0pt}
2642 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2643 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2644 \anchor{south}{\pgfpointorigin}
2645 \anchor{north east}{\northeast}
2646 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2647 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2648 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2649 \behindforegroundpath{
2650 \pgf@circ@antennabody
2651 \pgf@circ@antennawaves
2652 }
2653 }
2654
2655 \pgfdeclareshape{bareRXantenna}{
2656 \anchor{center}{\pgfpointorigin}
2657 \savedanchor{\northeast}{
2658 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2659 \pgf@x=\pgf@circ@res@step
2660 \pgf@y=2\pgf@circ@res@step
2661 }
2662 \anchor{text}{
2663 \northeast
2664 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2665 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2666 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2667 }
2668 \anchor{waves}{
2669 \northeast
2670 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2671 \pgf@x=-4.2\pgf@circ@res@step
2672 \pgf@y=\pgf@circ@res@step
2673 }
2674 \anchor{top}{\northeast\pgf@x=0pt}
2675 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2676 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2677 \anchor{bottom}{\pgfpointorigin}
2678 \anchor{north}{\northeast\pgf@x=0pt}
2679 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2680 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2681 \anchor{south}{\pgfpointorigin}
2682 \anchor{north east}{\northeast}
2683 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2684 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2685 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2686 \behindforegroundpath{
2687 \pgf@circ@antennabody
2688 \pgftransformxshift{-5.2\pgf@circ@res@step}
2689 \pgf@circ@antennawaves
2690 }
2691 }
2692
2693 % Microstrip monopoles
2694
2695 \pgfdeclareshape{mslstub}{
2696 \savedanchor{\southeast}{
2697 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
2698 \pgf@x=.5\pgf@x
2699 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
2700 \pgf@y=-.5\pgf@y
2701 }
2702 \savedanchor{\northwest}{
2703 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
2704 \pgf@x=-.5\pgf@x
2705 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
2706 \pgf@y=.5\pgf@y
2707 }
2708 \anchor{north}{\northwest\pgf@x=0pt\relax}
2709 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
2710 \anchor{east}{\southeast\pgf@y=0pt\relax}
2711 \anchor{south east}{\southeast}
2712 \anchor{south}{\southeast\pgf@x=0pt\relax}
2713 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2714 \anchor{west}{\northwest\pgf@y=0pt\relax}
2715 \anchor{north west}{\northwest}
2716 %
2717 \anchor{center}{\northwest\pgf@y=0pt\relax}
2718 \anchor{left}{\northwest\pgf@y=0pt\relax}
2719 \anchor{right}{\southeast\pgf@y=0pt\relax}
2720 % put the node text above and centered
2721 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2722 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2723 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2724 }
2725 }
2726 \behindbackgroundpath{
2727 \pgfextracty{\pgf@circ@res@up}{\northwest}
2728 \pgfextractx{\pgf@circ@res@right}{\southeast}
2729 \pgfextractx{\pgf@circ@res@left}{\northwest}
2730 \pgfextracty{\pgf@circ@res@down}{\southeast}
2731 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
2732 \pgfstartlinewidth=\pgflinewidth
2733 \pgfscope
2734 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
2735 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
2736 \pgf@circ@draworfill
2737 \endpgfscope
2738 }
2739 }
2740
2741 \pgfdeclareshape{msrstub}{
2742 \savedanchor{\southeast}{
2743 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
2744 \pgf@x=.5\pgf@x
2745 \pgf@y=0pt\relax
2746 }
2747 \savedanchor{\northwest}{
2748 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
2749 \pgf@x=-.5\pgf@x
2750 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@Rlen
2751 \pgf@y=.5\pgf@y
2752 }
2753 \anchor{north}{\northwest\pgf@x=0pt\relax}
2754 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
2755 \anchor{east}{\southeast\pgf@y=0pt\relax}
2756 \anchor{south east}{\southeast}
2757 \anchor{south}{\southeast\pgf@x=0pt\relax}
2758 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2759 \anchor{west}{\northwest\pgf@y=0pt\relax}
2760 \anchor{north west}{\northwest}
2761 %
2762 \anchor{center}{\pgfpointorigin}
2763 \anchor{left}{\pgfpointorigin}
2764 \anchor{right}{\pgfpointorigin}
2765 % put the node text above and centered
2766 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2767 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2768 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2769 }
2770 }
2771 \behindbackgroundpath{
2772 \pgfextracty{\pgf@circ@res@up}{\northwest}
2773 \pgfextractx{\pgf@circ@res@right}{\southeast}
2774 \pgfextractx{\pgf@circ@res@left}{\northwest}
2775 \pgfextracty{\pgf@circ@res@down}{\southeast}
2776 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
2777 \pgfstartlinewidth=\pgflinewidth
2778 \pgfscope
2779 \pgfpathmoveto{\pgfpointorigin}
2780 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
2781 \pgfusepath{draw}
2782 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
2783 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
2784 \pgfpatharc{135}{45}{\pgf@circ@res@step}
2785 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
2786 \pgfpatharc{45}{135}{\pgf@circ@res@up}
2787 \pgfclosepath
2788 % \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
2789 \pgf@circ@draworfill
2790 \endpgfscope
2791 }
2792 }
2793
2794 \pgfdeclareshape{msport}{
2795 \savedanchor{\southeast}{
2796 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
2797 \pgf@x=.5\pgf@x
2798 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
2799 \pgf@y=-.5\pgf@y
2800 }
2801 \savedanchor{\northwest}{
2802 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
2803 \pgf@x=-.5\pgf@x
2804 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
2805 \pgf@y=.5\pgf@y
2806 }
2807 \anchor{north}{\northwest\pgf@x=0pt\relax}
2808 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
2809 \anchor{east}{\southeast\pgf@y=0pt\relax}
2810 \anchor{south east}{\southeast}
2811 \anchor{south}{\southeast\pgf@x=0pt\relax}
2812 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2813 \anchor{west}{\northwest\pgf@y=0pt\relax}
2814 \anchor{north west}{\northwest}
2815 %
2816 \anchor{center}{\northwest\pgf@y=0pt\relax}
2817 \anchor{left}{\northwest\pgf@y=0pt\relax}
2818 \anchor{right}{\southeast\pgf@y=0pt\relax}
2819 % put the node text above and centered
2820 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2821 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2822 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2823 }
2824 }
2825 \behindbackgroundpath{
2826 \pgfextracty{\pgf@circ@res@up}{\northwest}
2827 \pgfextractx{\pgf@circ@res@right}{\southeast}
2828 \pgfextractx{\pgf@circ@res@left}{\northwest}
2829 \pgfextracty{\pgf@circ@res@down}{\southeast}
2830 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
2831 \pgfstartlinewidth=\pgflinewidth
2832 \pgfscope
2833 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
2834 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2835 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
2836 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
2837 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
2838 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
2839 \pgfpathclose
2840 \pgf@circ@draworfill
2841 \endpgfscope
2842 }
2843 }
2844 % Legacy antennas (with tails)
2845
2846 \def\pgf@circ@shift@antenna@xy#1#2{%
2847 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
2848 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
2849 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
2850 \relax}
2851
2852 \pgfdeclareshape{antenna}{
2853 \anchor{center}{\pgfpointorigin}
2854 \savedanchor{\northeast}{
2855 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
2856 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
2857 \pgf@y=4\pgf@circ@res@step
2858 }
2859 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
2860 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
2861 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
2862 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
2863 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{0}{2}}
2864 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
2865 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
2866 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
2867 \anchor{text}{
2868 \northeast
2869 \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
2870 \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
2871 }
2872 \behindforegroundpath{
2873 \pgfstartlinewidth=\pgflinewidth
2874 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
2875
2876 \pgftransformxshift{ -4\pgf@circ@res@step }
2877
2878 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
2879 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2880
2881 \pgfusepath{draw}
2882
2883 \pgfscope
2884 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2885 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2886 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
2887 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2888 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2889 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2890 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2891 \pgfusepath{draw}
2892 \endpgfscope
2893 \pgfsetlinewidth{\pgfstartlinewidth}
2894
2895 }
2896 }
2897
2898
2899 \pgfdeclareshape{txantenna}{
2900 \anchor{center}{\pgfpointorigin}
2901 \savedanchor{\northeast}{
2902 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
2903 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
2904 \pgf@y=4\pgf@circ@res@step
2905 }
2906 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
2907 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
2908 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
2909 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
2910 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
2911 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
2912 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
2913 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
2914 \anchor{text}{
2915 \northeast
2916 \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
2917 \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
2918 }
2919 \behindforegroundpath{
2920 \pgfstartlinewidth=\pgflinewidth
2921 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
2922
2923 \pgfpathmoveto{\pgfpointorigin}
2924 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
2925 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
2926 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2927
2928 \pgfusepath{draw}
2929
2930 \pgfscope
2931 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2932 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2933 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
2934 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2935 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2936 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2937 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2938 \pgfusepath{draw}
2939 \endpgfscope
2940 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
2941 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
2942 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
2943 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
2944 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
2945 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
2946 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
2947 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
2948 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
2949 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
2950 \pgfusepath{draw}
2951 \pgfsetlinewidth{\pgfstartlinewidth}
2952
2953 }
2954 }
2955
2956
2957 \pgfdeclareshape{rxantenna}{
2958 \anchor{center}{\pgfpointorigin}
2959 \savedanchor{\northeast}{
2960 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
2961 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
2962 \pgf@y=4\pgf@circ@res@step
2963 }
2964 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
2965 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
2966 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
2967 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
2968 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
2969 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
2970 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
2971 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
2972 \anchor{text}{
2973 \northeast
2974 \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
2975 \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
2976 }
2977 \behindforegroundpath{
2978 \pgfstartlinewidth=\pgflinewidth
2979 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
2980
2981 \pgfpathmoveto{\pgfpointorigin}
2982 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
2983 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
2984 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2985
2986 \pgfusepath{draw}
2987
2988 \pgfscope
2989 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2990 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2991 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
2992 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2993 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
2994 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2995 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2996 \pgfusepath{draw}
2997 \endpgfscope
2998
2999 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
3000 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3001 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3002 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
3003 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3004 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
3005 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3006 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
3007 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
3008 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
3009 \pgfusepath{draw}
3010 \pgfsetlinewidth{\pgfstartlinewidth}
3011
3012 }
3013 }
3014
3015 % Vcc
3016 \pgfdeclareshape{vcc}{
3017 \savedanchor{\northeast}{%
3018 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3019 \pgf@x=.5\pgf@circ@res@step
3020 \pgf@y=3\pgf@x%
3021 }
3022 \anchor{north}{\northeast\pgf@x=0cm\relax}
3023 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3024 \anchor{south}{\pgfpointorigin}
3025 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3026 \anchor{north east}{\northeast}
3027 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3028 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3029 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3030 \anchor{center}{\pgfpointorigin}
3031 \anchor{text}{
3032 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3033 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3034 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3035 \pgf@x=0pt
3036 \pgf@y=2\pgf@circ@res@step
3037 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
3038 \pgf@x=-.5\wd\pgfnodeparttextbox
3039 }
3040 \behindforegroundpath{
3041 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3042 \pgfscope
3043 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
3044 \ifx\pgf@temp\pgf@circ@temp
3045 \pgfstartlinewidth=\pgflinewidth
3046 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3047
3048 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3049 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
3050 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3051 \pgfusepath{draw}
3052
3053 \pgfsetlinewidth{\pgfstartlinewidth}
3054 \else
3055 \pgfsetarrowsend{\pgf@circ@temp}
3056 \fi
3057 \pgfpathmoveto{\pgfpointorigin}
3058 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
3059 \pgfusepath{draw}
3060 \endpgfscope
3061 }
3062 }
3063
3064 % Vee
3065 \pgfdeclareshape{vee}{
3066 \savedanchor{\northeast}{%
3067 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3068 \pgf@x=.5\pgf@circ@res@step
3069 \pgf@y=-3\pgf@x%
3070 }
3071 \anchor{south}{\northeast\pgf@x=0cm\relax}
3072 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3073 \anchor{north}{\pgfpointorigin}
3074 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3075 \anchor{south east}{\northeast}
3076 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
3077 \anchor{north east}{\northeast\pgf@y=0pt\relax}
3078 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3079 \anchor{center}{\pgfpointorigin}
3080 \anchor{text}{
3081 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3082 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3083 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3084 \pgf@x=0pt
3085 \pgf@y=-2\pgf@circ@res@step
3086 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
3087 \pgf@x=-.5\wd\pgfnodeparttextbox
3088 }
3089
3090 \behindforegroundpath{
3091 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3092 \pgfscope
3093 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
3094 \ifx\pgf@temp\pgf@circ@temp
3095
3096 \pgfstartlinewidth=\pgflinewidth
3097 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3098
3099 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3100 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
3101 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3102 \pgfusepath{draw}
3103 \pgfsetlinewidth{\pgfstartlinewidth}
3104 \else
3105 \pgfsetarrowsend{\pgf@circ@temp}
3106 \fi
3107 \pgfpathmoveto{\pgfpointorigin}
3108 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3109 \pgfusepath{draw}
3110 \endpgfscope
3111 }
3112 }
3113
3114 % match
3115 \pgfdeclareshape{match}{
3116 \savedanchor{\northeast}{%
3117 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
3118 \pgf@x=2\pgf@circ@res@step
3119 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
3120 \pgf@y=.5\pgf@circ@res@step%
3121 }
3122 % the center is on the left side of the shape for facility of usage
3123 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3124 \anchor{east}{\northeast\pgf@y=0cm\relax}
3125 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
3126 \anchor{west}{\pgfpointorigin}
3127 \anchor{north east}{\northeast}
3128 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3129 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3130 \anchor{south west}{\pgfpointorigin}
3131 \anchor{center}{
3132 \pgfpointorigin
3133 }
3134 \anchor{text}{
3135 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
3136 \pgf@x=1.5\pgf@x
3137 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
3138 \pgf@y=-1.5\ht\pgfnodeparttextbox
3139 }
3140 \behindforegroundpath{
3141 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
3142
3143 \pgfscope
3144 \pgfpathmoveto{\pgfpointorigin}
3145 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
3146 \pgfusepath{draw}
3147
3148 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
3149 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
3150 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
3151 \pgfusepath{fill}
3152
3153 \pgfsetlinewidth{\pgfstartlinewidth}
3154
3155 \endpgfscope
3156 }
3157 }
3158
3159 %%%---------- close: tex/pgfcircmonopoles
3160 %%%%%%%%%%% Springe nach tex/pgfcircbipoles
3161 %%%---------- open: tex/pgfcircbipoles.tex
3162 % Copyright 2007-2009 by Massimo Redaelli
3163 %
3164 % This file may be distributed and/or modified
3165 %
3166 % 1. under the LaTeX Project Public License and/or
3167 % 2. under the GNU Public License.
3168 %
3169 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
3170
3171 %% Generic macro for defining a bipole shape
3172 % #1 - additional anchors
3173 % #2 - lower y-size of the bipole (from the center).
3174 % #3 - #shape is the name of the shape
3175 % #4 - upper y-size of the bipole (from the center)
3176 % #5 - width of the bipole
3177 % #6 - macros drawing the bipole
3178
3179
3180 \long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
3181 \pgfdeclareshape{#3shape}{
3182
3183 \savedanchor{\northeast}{
3184 \pgf@y=#4\pgf@circ@Rlen
3185 \pgf@y=.5\pgf@y
3186 \pgf@x=#5\pgf@circ@Rlen
3187 \pgf@x=.5\pgf@x
3188 }
3189 \savedanchor{\northeastborder}{
3190 \pgf@y=#4\pgf@circ@Rlen
3191 \pgf@y=.5\pgf@y
3192 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3193 \pgf@x=#5\pgf@circ@Rlen
3194 \pgf@x=.5\pgf@x
3195 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3196 }
3197 \savedanchor{\southwestborder}{
3198 \pgf@y=-#2\pgf@circ@Rlen
3199 \pgf@y=.5\pgf@y
3200 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3201 \pgf@x=-#5\pgf@circ@Rlen
3202 \pgf@x=.5\pgf@x
3203 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3204 }
3205 \savedanchor{\southwest}{
3206 \pgf@y=-#2\pgf@circ@Rlen
3207 \pgf@y=.5\pgf@y
3208 \pgf@x=-#5\pgf@circ@Rlen
3209 \pgf@x=.5\pgf@x
3210 }
3211 \savedanchor{\centerpoint}{
3212 \pgf@circ@res@down=-#2\pgf@circ@Rlen
3213 \pgf@circ@res@up=#4\pgf@circ@Rlen
3214 \pgfpointorigin
3215 \pgf@y=\pgf@circ@res@up
3216 \advance\pgf@y by\pgf@circ@res@down
3217 \pgf@y=.5\pgf@y
3218 }
3219 \anchor{center}{\pgfpointorigin}
3220 \anchor{n}{
3221 \northeast
3222 \pgf@x=0cm
3223 }
3224 \anchor{north east}{
3225 \northeast
3226 }
3227 \anchor{north west}{
3228 \northeast
3229 \pgf@x=-\pgf@x
3230 }
3231 \anchor{ne}{
3232 \northeast
3233 }
3234 \anchor{nw}{
3235 \northeast
3236 \pgf@x=-\pgf@x
3237 }
3238 \anchor{e}{
3239 \northeast
3240 \pgf@y=0cm
3241 }
3242 \anchor{s}{
3243 \southwest
3244 \pgf@x=0cm
3245 }
3246 \anchor{south east}{
3247 \southwest
3248 \pgf@x=-\pgf@x
3249 }
3250 \anchor{south west}{
3251 \southwest
3252 }
3253 \anchor{se}{
3254 \southwest
3255 \pgf@x=-\pgf@x
3256 }
3257 \anchor{sw}{
3258 \southwest
3259 }
3260 \anchor{w}{
3261 \southwest
3262 \pgf@y=0cm
3263 }
3264 \anchor{north}{
3265 \northeast
3266 \pgf@x=0cm
3267 }
3268 \anchor{east}{
3269 \northeast
3270 \pgf@y=0cm
3271 }
3272 \anchor{south}{
3273 \southwest
3274 \pgf@x=0cm
3275 }
3276 \anchor{west}{
3277 \southwest
3278 \pgf@y=0cm
3279 }
3280 \anchor{right}{
3281 \northeast
3282 \pgf@y=0cm
3283 }
3284 \anchor{above}{
3285 \northeast
3286 \pgf@x=0cm
3287 }
3288 \anchor{left}{
3289 \southwest
3290 \pgf@y=0cm
3291 }
3292 \anchor{below}{
3293 \southwest
3294 \pgf@x=0cm
3295 }
3296 \anchor{a}{
3297 \northeast
3298 \pgf@y=0cm
3299 }
3300 \anchor{b}{
3301 \southwest
3302 \pgf@y=0cm
3303 }
3304 \savedanchor{\textanchor}{%
3305 \pgf@y=\ht\pgfnodeparttextbox
3306 \pgf@x=-.5\wd\pgfnodeparttextbox
3307 }
3308 \anchor{text}{
3309 \textanchor
3310 }
3311 \anchorborder{%
3312 \ifpgf@circuit@bipole@inverted
3313 \pgf@circ@res@left=-\pgf@x
3314 \pgf@circ@res@right=-\pgf@y
3315 \else
3316 \pgf@circ@res@left=\pgf@x
3317 \pgf@circ@res@right=\pgf@y
3318 \fi
3319 \ifdim\pgf@circ@res@right>0cm
3320 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
3321 \else
3322 \southwestborder
3323 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
3324 \fi
3325 }
3326
3327 #1
3328
3329 \backgroundpath{
3330 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3331
3332 \northeast
3333 \pgf@circ@res@up = \pgf@y
3334 \pgf@circ@res@zero = 0cm
3335 \pgf@circ@res@left = -\pgf@x
3336 \pgf@circ@res@right = \pgf@x
3337 \southwest
3338 \pgf@circ@res@down = \pgf@y
3339
3340 \pgfstartlinewidth=\pgflinewidth
3341 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
3342 #6
3343
3344 \pgfsetlinewidth{\pgfstartlinewidth}
3345 }
3346 }
3347 }
3348
3349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3350 %% Standard bipole shapes declarations
3351
3352 %% Resistor
3353 \pgfcircdeclarebipole
3354 {}
3355 {\ctikzvalof{bipoles/resistor/height}}
3356 {resistor}
3357 {\ctikzvalof{bipoles/resistor/height}}
3358 {\ctikzvalof{bipoles/resistor/width}}
3359 {
3360 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3361 \pgftransformationadjustments
3362 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
3363 \divide \pgf@circ@res@step by 12
3364
3365 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
3366 \pgf@circ@res@other = \pgf@circ@res@left
3367 \advance\pgf@circ@res@other by \pgf@circ@res@step
3368 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3369 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3370 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3371 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3372 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3373 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3374 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3375 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3376 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3377 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3378 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3379 \advance\pgf@circ@res@other by \pgf@circ@res@step
3380 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
3381 \pgfsetbeveljoin
3382 \pgfusepath{draw}
3383 }
3384
3385
3386
3387 %% Variable resistor
3388 \pgfcircdeclarebipole
3389 {}
3390 {\ctikzvalof{bipoles/vresistor/height}}
3391 {vresistor}
3392 {\ctikzvalof{bipoles/vresistor/height}}
3393 {\ctikzvalof{bipoles/vresistor/width}}
3394 {
3395 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3396 \pgftransformationadjustments
3397 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
3398 \divide \pgf@circ@res@step by 12
3399
3400 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
3401
3402 \pgf@circ@res@other = \pgf@circ@res@left
3403 \advance\pgf@circ@res@other by \pgf@circ@res@step
3404 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3405 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3406 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3407 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3408 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3409 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3410 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3411 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3412 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3413 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3414 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3415 \advance\pgf@circ@res@other by \pgf@circ@res@step
3416 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
3417 \pgfsetbeveljoin
3418 \pgfusepath{draw}
3419
3420 \pgfscope
3421 \pgfsetarrowsend{latexslim}
3422 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
3423 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
3424 \pgfusepath{draw}
3425 \endpgfscope
3426 }
3427
3428
3429
3430 %% Capacitor
3431
3432 \pgfcircdeclarebipole
3433 {}
3434 {\ctikzvalof{bipoles/capacitor/height}}
3435 {capacitor}
3436 {\ctikzvalof{bipoles/capacitor/height}}
3437 {\ctikzvalof{bipoles/capacitor/width}}
3438 {
3439 \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
3440 \divide \pgf@circ@res@step by 5
3441
3442 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3443 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3444 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3445
3446 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3447 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3448 \pgfusepath{draw}
3449
3450 }
3451
3452 %% Capacitive sensor
3453 \pgfcircdeclarebipole
3454 {\anchor{label}{%
3455 \southwest
3456 \pgf@x=2.6\pgf@x
3457 \pgf@y=1.4\pgf@y
3458 }%
3459 }
3460 {\ctikzvalof{bipoles/capacitor/height}}
3461 {capacitivesens}
3462 {\ctikzvalof{bipoles/capacitor/height}}
3463 {\ctikzvalof{bipoles/capacitor/width}}
3464 {
3465 \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
3466 \divide \pgf@circ@res@step by 5
3467
3468 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3469 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3470 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3471
3472 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3473 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3474 \pgfusepath{draw}
3475 \pgfscope
3476 \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
3477 \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
3478 \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
3479 \pgfusepath{draw}
3480 \endpgfscope
3481 }
3482
3483 %% Polar Capacitor
3484
3485 \pgfcircdeclarebipole
3486 {}
3487 {\ctikzvalof{bipoles/pcapacitor/height}}
3488 {polarcapacitor}
3489 {\ctikzvalof{bipoles/pcapacitor/height}}
3490 {\ctikzvalof{bipoles/pcapacitor/width}}
3491 {
3492 \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
3493 \divide \pgf@circ@res@step by 5
3494
3495 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3496
3497 \pgfscope
3498 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
3499 \pgftransformrotate{-90}
3500 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
3501 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
3502 \pgfusepath{draw}
3503 \endpgfscope
3504
3505 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3506 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3507 \pgfusepath{draw}
3508
3509 }
3510
3511 %% Electrolytic Capacitor
3512
3513 \pgfcircdeclarebipole
3514 {}
3515 {\ctikzvalof{bipoles/ecapacitor/height}}
3516 {ecapacitor}
3517 {\ctikzvalof{bipoles/ecapacitor/height}}
3518 {\ctikzvalof{bipoles/ecapacitor/width}}
3519 {
3520 \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen
3521 \divide \pgf@circ@res@step by 5
3522 \pgfsetrectcap
3523 % % % Draw plus pole
3524 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3525 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3526 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
3527 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
3528 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3529 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3530 \pgf@circ@draworfill
3531 % % Draw minus pole
3532 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3533 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
3534 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
3535 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3536 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3537 \pgfsetfillcolor{black}
3538 \pgfusepath{draw,fill}
3539 \pgfsetfillcolor{black}
3540 % % plus pole annotation
3541 \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
3542 {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
3543 }
3544
3545 %% Battery
3546
3547 \pgfcircdeclarebipole
3548 {}
3549 {\ctikzvalof{bipoles/battery/height}}
3550 {battery}
3551 {\ctikzvalof{bipoles/battery/height}}
3552 {\ctikzvalof{bipoles/battery/width}}
3553 {
3554 \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
3555 \divide \pgf@circ@res@step by 6
3556
3557 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3558
3559 \ifpgf@circ@fixbatteries
3560 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3561 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3562
3563 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
3564 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
3565
3566 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
3567 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
3568
3569 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3570 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3571 \else
3572 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3573 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3574
3575 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
3576 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
3577
3578 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
3579 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
3580
3581 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3582 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3583 \fi
3584 \pgfusepath{draw}
3585 }
3586
3587
3588 %% Battery 1 % poles with equl thickness
3589
3590 \pgfcircdeclarebipole
3591 {}
3592 {\ctikzvalof{bipoles/battery1/height}}
3593 {battery1}
3594 {\ctikzvalof{bipoles/battery1/height}}
3595 {\ctikzvalof{bipoles/battery1/width}}
3596 {
3597 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
3598 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
3599 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
3600 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
3601 \pgfusepath{draw}
3602
3603 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3604 \ifpgf@circ@fixbatteries
3605 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
3606 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
3607
3608 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3609 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3610 \else
3611 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3612 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3613
3614 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
3615 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
3616 \fi
3617 \pgfusepath{draw}
3618 }
3619
3620 %% Battery 2 % negative pole thicker
3621
3622 \pgfcircdeclarebipole
3623 {}
3624 {\ctikzvalof{bipoles/battery2/height}}
3625 {battery2}
3626 {\ctikzvalof{bipoles/battery2/height}}
3627 {\ctikzvalof{bipoles/battery2/width}}
3628 {
3629 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
3630 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
3631 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
3632 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
3633 \pgfusepath{draw}
3634
3635 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3636 \ifpgf@circ@fixbatteries
3637 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
3638 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
3639 \pgfusepath{draw}
3640 \pgfsetlinewidth{3\pgflinewidth}
3641 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3642 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3643 \else
3644 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
3645 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
3646 \pgfusepath{draw}
3647 \pgfsetlinewidth{3\pgflinewidth}
3648 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3649 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3650 \fi
3651 \pgfusepath{draw}
3652 }
3653
3654
3655 %% cute inductor
3656
3657 \pgfcircdeclarebipole
3658 {}
3659 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
3660 {cuteinductor}
3661 {\ctikzvalof{bipoles/cuteinductor/height}}
3662 {\ctikzvalof{bipoles/cuteinductor/width}}
3663 {
3664 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3665 \pgftransformationadjustments
3666
3667 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
3668 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
3669
3670
3671 \pgfmathsetlength{\pgf@circ@res@step}
3672 {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
3673
3674 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3675 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
3676 {
3677 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3678 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
3679 }
3680 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3681 \pgfsetbuttcap
3682 \pgfsetbeveljoin
3683 \pgfusepath{stroke}
3684 }
3685
3686 %% cute inductive sensor
3687
3688 \pgfcircdeclarebipole
3689 {%
3690 {% anchor for labelling the type of dependency
3691 \anchor{label}{%
3692 \southwest
3693 \pgf@x=0.8\pgf@x
3694 \pgf@y=2.6\pgf@y
3695 }%
3696 }}
3697 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
3698 {scuteinductor}
3699 {\ctikzvalof{bipoles/cuteinductor/height}}
3700 {\ctikzvalof{bipoles/cuteinductor/width}}
3701 {
3702 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3703 \pgftransformationadjustments
3704
3705 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
3706 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
3707
3708
3709 \pgfmathsetlength{\pgf@circ@res@step}
3710 {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
3711
3712 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3713 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
3714 {
3715 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3716 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
3717 }
3718 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3719 \pgfsetbuttcap
3720 \pgfsetbeveljoin
3721 \pgfusepath{stroke}
3722 \pgfscope
3723 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
3724 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
3725 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
3726 \pgfusepath{draw}
3727 \endpgfscope
3728 }
3729
3730 %% cute choke
3731
3732 \pgfcircdeclarebipole
3733 {}
3734 {\ctikzvalof{bipoles/cutechoke/lower coil height}}
3735 {cutechoke}
3736 {\ctikzvalof{bipoles/cutechoke/height}}
3737 {\ctikzvalof{bipoles/cutechoke/width}}
3738 {
3739 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3740 \pgftransformationadjustments
3741
3742 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
3743 {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
3744
3745
3746 \pgfmathsetlength{\pgf@circ@res@step}
3747 {(\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
3748
3749 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3750 \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
3751 {
3752 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3753 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
3754 }
3755 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3756 \pgfsetbuttcap
3757 \pgfsetbeveljoin
3758 \pgfusepath{stroke}
3759
3760 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
3761 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
3762 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
3763 \pgfusepath{stroke}
3764
3765 \ifpgf@circuit@bipole@twolines
3766 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
3767 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
3768 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
3769 \pgfusepath{stroke}
3770 \fi
3771 }
3772
3773 %% variable cute inductor
3774
3775 \pgfcircdeclarebipole
3776 {}
3777 {\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
3778 {vcuteinductor}
3779 {\ctikzvalof{bipoles/vcuteinductor/height}}
3780 {\ctikzvalof{bipoles/vcuteinductor/width}}
3781 {
3782 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3783 \pgftransformationadjustments
3784
3785 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
3786 {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
3787
3788
3789 \pgfmathsetlength{\pgf@circ@res@step}
3790 {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
3791
3792 \pgfscope
3793 \pgfsetarrowsend{latexslim}
3794 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
3795 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
3796 \pgfusepath{draw}
3797 \endpgfscope
3798
3799 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3800 \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
3801 {
3802 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
3803 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
3804 }
3805 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
3806 \pgfsetbuttcap
3807 \pgfsetbeveljoin
3808 \pgfusepath{stroke}
3809 }
3810 %% american inductor
3811
3812 \pgfcircdeclarebipole
3813 {}
3814 {\ctikzvalof{bipoles/americaninductor/height 2}}
3815 {americaninductor}
3816 {\ctikzvalof{bipoles/americaninductor/height}}
3817 {\ctikzvalof{bipoles/americaninductor/width}}
3818 {
3819 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
3820 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3821 \pgftransformationadjustments
3822 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
3823 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
3824 \divide \pgf@circ@res@step by 2
3825 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
3826
3827 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3828 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
3829 {
3830 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
3831 }
3832 \pgfsetbuttcap
3833 \pgfsetbeveljoin
3834 \pgfusepath{stroke}
3835 }
3836
3837
3838 %% american inductive sensor
3839
3840 \pgfcircdeclarebipole
3841 {%
3842 {% anchor for labelling the type of dependency
3843 \anchor{label}{%
3844 \southwest
3845 \pgf@x=0.8\pgf@x
3846 \pgf@y=2.6\pgf@y
3847 }%
3848 }}
3849 {\ctikzvalof{bipoles/americaninductor/height 2}}
3850 {samericaninductor}
3851 {\ctikzvalof{bipoles/americaninductor/height}}
3852 {\ctikzvalof{bipoles/americaninductor/width}}
3853 {
3854 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
3855 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3856 \pgftransformationadjustments
3857 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
3858 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
3859 \divide \pgf@circ@res@step by 2
3860 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
3861
3862 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3863 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
3864 {
3865 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
3866 }
3867 \pgfsetbuttcap
3868 \pgfsetbeveljoin
3869 \pgfusepath{stroke}
3870 \pgfscope
3871 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
3872 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
3873 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
3874 \pgfusepath{draw}
3875 \endpgfscope
3876 }
3877
3878 %% variable american inductor
3879
3880 \pgfcircdeclarebipole
3881 {}
3882 {\ctikzvalof{bipoles/vamericaninductor/height 2}}
3883 {vamericaninductor}
3884 {\ctikzvalof{bipoles/vamericaninductor/height}}
3885 {\ctikzvalof{bipoles/vamericaninductor/width}}
3886 {
3887 \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
3888 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3889 \pgftransformationadjustments
3890 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
3891 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
3892 \divide \pgf@circ@res@step by 2
3893 \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
3894
3895 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
3896 \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
3897 {
3898 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
3899 }
3900 \pgfsetbuttcap
3901 \pgfsetbeveljoin
3902 \pgfusepath{stroke}
3903
3904 \pgfscope
3905 \pgfsetarrowsend{latexslim}
3906 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
3907 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
3908 \pgfusepath{draw}
3909 \endpgfscope
3910 }
3911
3912
3913 %% Independent voltage source
3914
3915 \pgfcircdeclarebipole
3916 {}
3917 {\ctikzvalof{bipoles/vsource/height}}
3918 {vsource}
3919 {\ctikzvalof{bipoles/vsource/height}}
3920 {\ctikzvalof{bipoles/vsource/width}}
3921 {
3922
3923 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3924
3925 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
3926 \pgf@circ@draworfill
3927 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
3928 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
3929 \pgfusepath{draw}
3930 }
3931
3932
3933 %% Independent voltage source - American style
3934
3935 \pgfcircdeclarebipole
3936 {}
3937 {\ctikzvalof{bipoles/vsourceam/height}}
3938 {vsourceAM}
3939 {\ctikzvalof{bipoles/vsourceam/height}}
3940 {\ctikzvalof{bipoles/vsourceam/width}}
3941 {
3942
3943 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3944 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
3945 \pgf@circ@draworfill
3946 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3947 \ifpgf@circ@oldvoltagedirection
3948 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
3949 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
3950 \else
3951 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
3952 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
3953 \fi
3954 }
3955
3956
3957
3958 %% Independent sinusoidal voltage source
3959
3960 \pgfcircdeclarebipole
3961 {}
3962 {\ctikzvalof{bipoles/vsourcesin/height}}
3963 {vsourcesin}
3964 {\ctikzvalof{bipoles/vsourcesin/height}}
3965 {\ctikzvalof{bipoles/vsourcesin/width}}
3966 {
3967
3968 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3969 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
3970 \pgf@circ@draworfill
3971
3972 \pgf@circ@res@up = .5\pgf@circ@res@up
3973 \pgfscope
3974 \pgftransformrotate{90}
3975 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
3976 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
3977 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
3978 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
3979 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
3980 \pgfusepath{draw}
3981 \endpgfscope
3982 }
3983
3984 % Square Voltage source - contributed by Alistair Kwan
3985 \pgfcircdeclarebipole
3986 {}
3987 {\ctikzvalof{bipoles/vsourcesquare/height}}
3988 {vsourcesquare}
3989 {\ctikzvalof{bipoles/vsourcesquare/height}}
3990 {\ctikzvalof{bipoles/vsourcesquare/width}}
3991 {
3992 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3993 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
3994 \pgf@circ@draworfill
3995 \pgf@circ@res@up = .5\pgf@circ@res@up
3996 \pgfscope
3997 \pgftransformrotate{90}
3998 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
3999 \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
4000 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
4001 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
4002 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
4003 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
4004 \pgfusepath{draw}
4005 \endpgfscope
4006 }
4007
4008 % Triangle Voltage source - contributed by Ralf Farkas
4009 \pgfcircdeclarebipole
4010 {}
4011 {\ctikzvalof{bipoles/vsourcetri/height}}
4012 {vsourcetri}
4013 {\ctikzvalof{bipoles/vsourcetri/height}}
4014 {\ctikzvalof{bipoles/vsourcetri/width}}
4015 {
4016
4017 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4018 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4019 \pgf@circ@draworfill
4020
4021 \pgf@circ@res@up = .5\pgf@circ@res@up
4022 \pgfscope
4023 \pgftransformrotate{90}
4024 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
4025 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
4026 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
4027 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
4028 \pgfusepath{draw}
4029 \endpgfscope
4030 }
4031
4032
4033 %% PV Source
4034 \pgfcircdeclarebipole
4035 {}
4036 {\ctikzvalof{bipoles/pvsource/height}}
4037 {pvsource}
4038 {\ctikzvalof{bipoles/pvsource/height}}
4039 {\ctikzvalof{bipoles/pvsource/width}}
4040 {
4041 \pgfpointorigin
4042 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4043 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4044 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4045 \pgf@circ@draworfill
4046
4047 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
4048 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
4049 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
4050 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
4051 \pgfusepath{draw}
4052
4053 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4054 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
4055 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
4056
4057 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
4058 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
4059 \pgfusepath{draw}
4060
4061 %Arrow Part
4062 \pgfscope
4063 \pgfsetarrowsend{latex}
4064 \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
4065 \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
4066 \pgfusepath{draw}
4067 \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
4068 \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
4069 \pgfusepath{draw}
4070 \endpgfscope
4071
4072 }
4073
4074 %% Empty Source
4075 \pgfcircdeclarebipole
4076 {}
4077 {\ctikzvalof{bipoles/esource/height}}
4078 {esource}
4079 {\ctikzvalof{bipoles/esource/height}}
4080 {\ctikzvalof{bipoles/esource/width}}
4081 {
4082 \pgfpointorigin
4083 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4084 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4085 \pgf@circ@draworfill
4086 }
4087
4088 %% DC Current Source with open shape
4089 \pgfcircdeclarebipole
4090 {}
4091 {\ctikzvalof{bipoles/dcisource/height}}
4092 {dcisource}
4093 {\ctikzvalof{bipoles/dcisource/height}}
4094 {\ctikzvalof{bipoles/dcisource/width}}
4095 {
4096 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4097 \pgfpathmoveto{\pgfpointorigin}
4098 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4099 \pgf@circ@maybefill
4100 \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
4101 \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
4102 \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
4103 \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
4104 \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
4105 \pgfusepath{draw}
4106
4107 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4108 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4109 \pgfusepath{draw}
4110 \pgfscope
4111 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4112 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4113 \endpgfscope
4114 }
4115 %% DC-Voltage source
4116 \pgfcircdeclarebipole
4117 {}
4118 {\ctikzvalof{bipoles/dcvsource/height}}
4119 {dcvsource}
4120 {\ctikzvalof{bipoles/dcvsource/height}}
4121 {\ctikzvalof{bipoles/dcvsource/width}}
4122 {
4123 \pgfpointorigin
4124 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4125 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4126 \pgf@circ@draworfill
4127 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
4128 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
4129 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
4130 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
4131 \pgfusepath{draw}
4132 }
4133
4134
4135 %% Independent current source
4136
4137 \pgfcircdeclarebipole
4138 {}
4139 {\ctikzvalof{bipoles/isource/height}}
4140 {isource}
4141 {\ctikzvalof{bipoles/isource/height}}
4142 {\ctikzvalof{bipoles/isource/width}}
4143 {
4144 \pgfpointorigin
4145 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4146 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4147 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4148 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4149 \pgf@circ@draworfill
4150 }
4151
4152 %% Independent double oo source
4153
4154 \pgfcircdeclarebipole
4155 {}
4156 {\ctikzvalof{bipoles/oosource/height}}
4157 {oosource}
4158 {\ctikzvalof{bipoles/oosource/height}}
4159 {\ctikzvalof{bipoles/oosource/width}}
4160 {
4161 \pgfpointorigin
4162 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4163 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
4164 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
4165 \pgf@circ@maybefill
4166 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
4167 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
4168 \pgf@circ@draworfill
4169 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
4170 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
4171 \pgfusepath{draw}
4172 }
4173
4174
4175 %% Independent current source - American
4176
4177 \pgfcircdeclarebipole
4178 {}
4179 {\ctikzvalof{bipoles/isourceam/height}}
4180 {isourceAM}
4181 {\ctikzvalof{bipoles/isourceam/height}}
4182 {\ctikzvalof{bipoles/isourceam/width}}
4183 {
4184 \pgfpointorigin
4185 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4186 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4187 \pgf@circ@draworfill
4188
4189 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4190 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
4191 \pgfusepath{draw}
4192 \pgfscope
4193 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4194 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4195 \endpgfscope
4196 }
4197
4198
4199 %% Independent sinusoidal current source
4200
4201 \pgfcircdeclarebipole
4202 {}
4203 {\ctikzvalof{bipoles/isource/height}}
4204 {isourcesin}
4205 {\ctikzvalof{bipoles/isource/height}}
4206 {\ctikzvalof{bipoles/isource/width}}
4207 {
4208 \pgfpointorigin
4209 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4210 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4211 \pgf@circ@draworfill
4212
4213 \pgf@circ@res@up = .5\pgf@circ@res@up
4214 \pgfscope
4215 \pgftransformrotate{90}
4216 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4217 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4218 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4219 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4220 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4221 \pgfusepath{draw}
4222 \endpgfscope
4223
4224 }
4225
4226
4227 %% Controlled voltage source
4228
4229 \pgfcircdeclarebipole
4230 {}
4231 {\ctikzvalof{bipoles/cvsource/height}}
4232 {cvsource}
4233 {\ctikzvalof{bipoles/cvsource/height}}
4234 {\ctikzvalof{bipoles/cvsource/width}}
4235 {
4236
4237 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4238
4239 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4240 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4241 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4242 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4243 \pgfpathclose
4244 \pgf@circ@draworfill
4245
4246 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4247 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4248 \pgfusepath{draw}
4249 }
4250
4251
4252
4253
4254 %% Controlled voltage source - American
4255 \pgfcircdeclarebipole
4256 {}
4257 {\ctikzvalof{bipoles/cvsourceam/height}}
4258 {cvsourceAM}
4259 {\ctikzvalof{bipoles/cvsourceam/height}}
4260 {\ctikzvalof{bipoles/cvsourceam/width}}
4261 {
4262 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4263 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4264 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4265 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4266 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4267 \pgfpathclose
4268 \pgf@circ@draworfill
4269
4270 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
4271 \ifpgf@circ@oldvoltagedirection
4272 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
4273 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
4274 \else
4275 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
4276 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
4277 \fi
4278 }
4279
4280
4281 %% Controlled sinusoidal voltage source
4282 \pgfcircdeclarebipole
4283 {}
4284 {\ctikzvalof{bipoles/cvsourcesin/height}}
4285 {cvsourcesin}
4286 {\ctikzvalof{bipoles/cvsourcesin/height}}
4287 {\ctikzvalof{bipoles/cvsourcesin/width}}
4288 {
4289
4290 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4291
4292 \pgfscope
4293 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4294 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4295 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4296 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4297 \pgfpathclose
4298 \pgf@circ@draworfill
4299 \endpgfscope
4300
4301 \pgf@circ@res@up = .5\pgf@circ@res@up
4302 \pgfscope
4303 \pgftransformrotate{90}
4304 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4305 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4306 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4307 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4308 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4309 \pgfusepath{draw}
4310 \endpgfscope
4311 }
4312
4313
4314
4315 %% Controlled sinusoidal current source
4316
4317 \pgfcircdeclarebipole
4318 {}
4319 {\ctikzvalof{bipoles/cvsourcesin/height}}
4320 {cisourcesin}
4321 {\ctikzvalof{bipoles/cvsourcesin/height}}
4322 {\ctikzvalof{bipoles/cvsourcesin/width}}
4323 {
4324
4325 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4326
4327 \pgfscope
4328 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4329 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4330 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4331 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4332 \pgfpathclose
4333 \pgf@circ@draworfill
4334 \endpgfscope
4335
4336 \pgf@circ@res@up = .5\pgf@circ@res@up
4337 \pgfscope
4338 \pgftransformrotate{90}
4339 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4340 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4341 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4342 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4343 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4344 \pgfusepath{draw}
4345 \endpgfscope
4346 }
4347
4348 %% Controlled current source
4349
4350 \pgfcircdeclarebipole
4351 {}
4352 {\ctikzvalof{bipoles/cisource/height}}
4353 {cisource}
4354 {\ctikzvalof{bipoles/cisource/height}}
4355 {\ctikzvalof{bipoles/cisource/width}}
4356 {
4357
4358 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4359
4360 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4361 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4362 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4363 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4364 \pgfpathclose
4365 \pgf@circ@draworfill
4366
4367 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4368 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4369 \pgfusepath{draw}
4370 }
4371
4372
4373 %% Controlled current source - American
4374
4375 \pgfcircdeclarebipole
4376 {}
4377 {\ctikzvalof{bipoles/cisourceam/height}}
4378 {cisourceAM}
4379 {\ctikzvalof{bipoles/cisourceam/height}}
4380 {\ctikzvalof{bipoles/cisourceam/width}}
4381 {
4382 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4383
4384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4385 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4386 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4387 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4388 \pgfpathclose
4389 \pgf@circ@draworfill
4390 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4391 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
4392 \pgfusepath{draw}
4393 \pgfscope
4394 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4395 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4396 \endpgfscope
4397 }
4398
4399 %% Cute Independent voltage source
4400
4401 \pgfcircdeclarebipole
4402 {}
4403 {\ctikzvalof{bipoles/vsource/height}}
4404 {vsourceC}
4405 {\ctikzvalof{bipoles/vsource/height}}
4406 {\ctikzvalof{bipoles/vsource/width}}
4407 {
4408 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4409 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4410 \pgf@circ@draworfill
4411 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4412 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4413 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4414 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4415 \pgfsetroundcap\pgfusepath{draw}
4416 }
4417 %% Cute Independent current source
4418
4419 \pgfcircdeclarebipole
4420 {}
4421 {\ctikzvalof{bipoles/isource/height}}
4422 {isourceC}
4423 {\ctikzvalof{bipoles/isource/height}}
4424 {\ctikzvalof{bipoles/isource/width}}
4425 {
4426 \pgfpointorigin
4427 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4428 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4429 \pgf@circ@draworfill
4430 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4431 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
4433 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
4434 \pgfsetroundcap\pgfusepath{draw}
4435 }
4436 %% Cute Controlled voltage source
4437
4438 \pgfcircdeclarebipole
4439 {}
4440 {\ctikzvalof{bipoles/cvsource/height}}
4441 {cvsourceC}
4442 {\ctikzvalof{bipoles/cvsource/height}}
4443 {\ctikzvalof{bipoles/cvsource/width}}
4444 {
4445 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4446 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4447 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4448 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4449 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4450 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4451 \pgf@circ@draworfill
4452 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4453 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4454 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4455 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4456 \pgfsetroundcap\pgfusepath{draw}
4457 }
4458
4459 %% Cute Controlled current source
4460
4461 \pgfcircdeclarebipole
4462 {}
4463 {\ctikzvalof{bipoles/cisource/height}}
4464 {cisourceC}
4465 {\ctikzvalof{bipoles/cisource/height}}
4466 {\ctikzvalof{bipoles/cisource/width}}
4467 {
4468 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4469 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4470 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4471 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4472 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4473 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4474 \pgf@circ@draworfill
4475 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4476 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4477 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
4478 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
4479 \pgfsetroundcap\pgfusepath{draw}
4480 }
4481
4482 %% Noise voltage source
4483
4484 \pgfcircdeclarebipole
4485 {}
4486 {\ctikzvalof{bipoles/vsource/height}}
4487 {vsourceN}
4488 {\ctikzvalof{bipoles/vsource/height}}
4489 {\ctikzvalof{bipoles/vsource/width}}
4490 {
4491 \pgfscope
4492 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4493 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4494 %
4495 \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
4496 \edef\pgf@noise@temp{dashed}
4497 \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
4498 \ifx\pgf@noise@temp\pgf@noise@fill
4499 % fillable in this case
4500 \pgf@circ@draworfillandclip
4501 \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4502 \pgfsetlinewidth{\thinner\pgfstartlinewidth}
4503 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4504 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4505 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4506 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4507 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4508 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4509 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4510 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4511 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4512 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4513 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4514 %
4515 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
4516 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4517 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4518 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4519 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4520 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4521 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4522 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4523 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4524 \pgfusepath{draw}
4525 \else
4526 \pgfsetfillcolor{\pgf@noise@fill}
4527 \pgfusepath{draw,fill}
4528 \fi
4529 \endpgfscope
4530 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4531 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4532 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4533 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4534 \pgfsetroundcap\pgfusepath{draw}
4535 }
4536 %% Noise current source
4537
4538 \pgfcircdeclarebipole
4539 {}
4540 {\ctikzvalof{bipoles/isource/height}}
4541 {isourceN}
4542 {\ctikzvalof{bipoles/isource/height}}
4543 {\ctikzvalof{bipoles/isource/width}}
4544 {
4545 \pgfpointorigin
4546 \pgfscope
4547 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4548 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4549 %
4550 \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
4551 \edef\pgf@noise@temp{dashed}
4552 \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
4553 \ifx\pgf@noise@temp\pgf@noise@fill
4554 % fillable in this case
4555 \pgf@circ@draworfillandclip
4556 \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4557 \pgfsetlinewidth{\thinner\pgfstartlinewidth}
4558 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4559 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4560 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4561 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4562 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4563 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4564 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4565 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4566 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4567 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4568 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4569 %
4570 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
4571 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4572 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4573 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4574 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4575 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4576 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4577 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4578 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4579 \pgfusepath{draw}
4580 \else
4581 \pgfsetfillcolor{\pgf@noise@fill}
4582 \pgfusepath{draw,fill}
4583 \fi
4584 \endpgfscope
4585 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4586 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4587 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
4588 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
4589 \pgfsetroundcap\pgfusepath{draw}
4590 }
4591 %% Black generic diode
4592
4593 \pgfcircdeclarebipole
4594 {}
4595 {\ctikzvalof{bipoles/diode/height}}
4596 {fulldiode}
4597 {\ctikzvalof{bipoles/diode/height}}
4598 {\ctikzvalof{bipoles/diode/width}}
4599 {
4600
4601 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4602
4603 \pgfscope
4604 \pgftransformxshift{\pgf@circ@res@left}
4605 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4606 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4607 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4608 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4609 \pgfusepath{draw,fill}
4610 \endpgfscope
4611 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4612 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4613 \pgfusepath{draw}
4614 }
4615
4616 %% Black Zener diode
4617
4618 \pgfcircdeclarebipole
4619 {}
4620 {\ctikzvalof{bipoles/diode/height}}
4621 {fullzdiode}
4622 {\ctikzvalof{bipoles/diode/height}}
4623 {\ctikzvalof{bipoles/diode/width}}
4624 {
4625
4626 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4627
4628 \pgfscope
4629 \pgftransformxshift{\pgf@circ@res@left}
4630 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4631 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4632 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4633 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4634 \pgfusepath{draw,fill}
4635 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4636 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4637 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4638 \pgfusepath{draw}
4639 \endpgfscope
4640 }
4641
4642 %% Black alternative zigzag Zener diode
4643 \pgfcircdeclarebipole
4644 {}
4645 {\ctikzvalof{bipoles/diode/height}}
4646 {fullzzdiode}
4647 {\ctikzvalof{bipoles/diode/height}}
4648 {\ctikzvalof{bipoles/diode/width}}
4649 {
4650
4651 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4652
4653 \pgfscope
4654 \pgftransformxshift{\pgf@circ@res@left}
4655 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4656 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4657 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4658 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4659 \pgfusepath{draw,fill}
4660 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
4661 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4662 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4663 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
4664 \pgfusepath{draw}
4665 \endpgfscope
4666 }
4667
4668 %% Black Schottky diode
4669
4670 \pgfcircdeclarebipole
4671 {}
4672 {\ctikzvalof{bipoles/diode/height}}
4673 {fullsdiode}
4674 {\ctikzvalof{bipoles/diode/height}}
4675 {\ctikzvalof{bipoles/diode/width}}
4676 {
4677
4678 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4679 \pgfscope
4680 \pgftransformxshift{\pgf@circ@res@left}
4681 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4682 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4683 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4684 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4685 \pgfusepath{draw,fill}
4686
4687 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
4688 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
4689 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4690 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4691 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4692 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4693 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
4694 \pgfusepath{draw}
4695 \endpgfscope
4696
4697 }
4698
4699 %% Black tunnel diode
4700
4701 \pgfcircdeclarebipole
4702 {}
4703 {\ctikzvalof{bipoles/diode/height}}
4704 {fulltdiode}
4705 {\ctikzvalof{bipoles/diode/height}}
4706 {\ctikzvalof{bipoles/diode/width}}
4707 {
4708
4709 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4710 \pgfscope
4711 \pgftransformxshift{\pgf@circ@res@left}
4712 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4713 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4714 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4715 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4716 \pgfusepath{draw,fill}
4717
4718 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
4719 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4720 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4721 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4722 \pgfusepath{draw}
4723 \endpgfscope
4724 }
4725
4726 %% Black light emitting diode
4727
4728 \pgfcircdeclarebipole
4729 {}
4730 {\ctikzvalof{bipoles/diode/height}}
4731 {fulllediode}
4732 {\ctikzvalof{bipoles/diode/height}}
4733 {\ctikzvalof{bipoles/diode/width}}
4734 {
4735
4736 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4737 \pgfscope
4738 \pgftransformxshift{\pgf@circ@res@left}
4739 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4740 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4741 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4742 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4743 \pgfusepath{draw,fill}
4744 \endpgfscope
4745 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4746 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4747 \pgfusepath{draw}
4748
4749 \pgfsetlinewidth{\pgfstartlinewidth}
4750 \pgfsetarrowsend{latexslim}
4751 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4752 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
4753 \pgfusepath{draw}
4754 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
4755 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
4756 \pgfusepath{draw}
4757
4758 }
4759
4760 %% Black photodiode
4761
4762 \pgfcircdeclarebipole
4763 {}
4764 {\ctikzvalof{bipoles/diode/height}}
4765 {fullpdiode}
4766 {\ctikzvalof{bipoles/diode/height}}
4767 {\ctikzvalof{bipoles/diode/width}}
4768 {
4769
4770 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4771 \pgfscope
4772 \pgftransformxshift{\pgf@circ@res@left}
4773 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4774 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4775 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4776 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4777 \pgfusepath{draw,fill}
4778 \endpgfscope
4779 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4780 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4781 \pgfusepath{draw}
4782
4783 \pgfsetlinewidth{\pgfstartlinewidth}
4784 \pgfsetarrowsstart{latexslim}
4785 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4786 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
4787 \pgfusepath{draw}
4788 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
4789 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
4790 \pgfusepath{draw}
4791 }
4792
4793 %% Black varcap
4794
4795 \pgfcircdeclarebipole
4796 {}
4797 {\ctikzvalof{bipoles/varcap/height}}
4798 {fullvarcap}
4799 {\ctikzvalof{bipoles/varcap/height}}
4800 {\ctikzvalof{bipoles/varcap/width}}
4801 {
4802 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
4803 \pgfsetlinewidth{\pgf@circ@res@temp}
4804 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
4805 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4806 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4807 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
4808 \pgfusepath{draw,fill}
4809 %
4810 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
4811 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
4812 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4813 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4814 \pgfusepath{draw}
4815 }
4816
4817 %% Code for the diode triangle
4818 \def\pgf@circ@basicdiodeshape{
4819 % \pgfscope
4820 \pgftransformxshift{\pgf@circ@res@left}
4821 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4822 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4823 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4824 \pgfpathclose
4825 \pgf@circ@draworfill
4826 \pgfscope
4827 % to allow filling, we need to draw explicitily the stroke here.
4828 \pgfsetlinewidth{\pgfstartlinewidth}
4829 \ifpgf@circuit@bipole@strokedsymbol
4830 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4831 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
4832 \pgfusepath{draw}
4833 \fi
4834 \endpgfscope
4835 % \endpgfscope
4836 }
4837
4838
4839 %% Empty generic diode
4840
4841 \pgfcircdeclarebipole
4842 {}
4843 {\ctikzvalof{bipoles/diode/height}}
4844 {emptydiode}
4845 {\ctikzvalof{bipoles/diode/height}}
4846 {\ctikzvalof{bipoles/diode/width}}
4847 {
4848 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4849 \pgfscope
4850 \pgf@circ@basicdiodeshape
4851 \endpgfscope
4852 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4853 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4854 \pgfusepath{draw}
4855 }
4856
4857 %% Empty Zener diode
4858
4859 \pgfcircdeclarebipole
4860 {}
4861 {\ctikzvalof{bipoles/diode/height}}
4862 {emptyzdiode}
4863 {\ctikzvalof{bipoles/diode/height}}
4864 {\ctikzvalof{bipoles/diode/width}}
4865 {
4866
4867 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4868
4869 \pgfscope
4870 \pgf@circ@basicdiodeshape
4871 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4872 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4873 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4874 \pgfusepath{draw}
4875 \endpgfscope
4876 }
4877
4878 %% Empty alternative zigzag Zener diode
4879 \pgfcircdeclarebipole
4880 {}
4881 {\ctikzvalof{bipoles/diode/height}}
4882 {emptyzzdiode}
4883 {\ctikzvalof{bipoles/diode/height}}
4884 {\ctikzvalof{bipoles/diode/width}}
4885 {
4886
4887 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4888
4889 \pgfscope
4890 \pgf@circ@basicdiodeshape
4891 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
4892 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4893 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4894 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
4895 \pgfusepath{draw}
4896 \endpgfscope
4897 }
4898 %% Empty Schottky diode
4899
4900 \pgfcircdeclarebipole
4901 {}
4902 {\ctikzvalof{bipoles/diode/height}}
4903 {emptysdiode}
4904 {\ctikzvalof{bipoles/diode/height}}
4905 {\ctikzvalof{bipoles/diode/width}}
4906 {
4907
4908 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4909 \pgfscope
4910 \pgf@circ@basicdiodeshape
4911 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
4912 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
4913 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4914 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4915 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4916 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4917 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
4918 \pgfusepath{draw}
4919 \endpgfscope
4920
4921 }
4922
4923 %% Empty tunnel diode
4924
4925 \pgfcircdeclarebipole
4926 {}
4927 {\ctikzvalof{bipoles/diode/height}}
4928 {emptytdiode}
4929 {\ctikzvalof{bipoles/diode/height}}
4930 {\ctikzvalof{bipoles/diode/width}}
4931 {
4932
4933 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4934 \pgfscope
4935 \pgf@circ@basicdiodeshape
4936 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
4937 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4938 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4939 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4940 \pgfusepath{draw}
4941 \endpgfscope
4942 }
4943
4944 %% Empty light emitting diode
4945
4946 \pgfcircdeclarebipole
4947 {}
4948 {\ctikzvalof{bipoles/diode/height}}
4949 {emptylediode}
4950 {\ctikzvalof{bipoles/diode/height}}
4951 {\ctikzvalof{bipoles/diode/width}}
4952 {
4953
4954 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4955 \pgfscope
4956 \pgf@circ@basicdiodeshape
4957 \endpgfscope
4958 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4959 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4960 \pgfusepath{draw}
4961
4962 \pgfsetlinewidth{\pgfstartlinewidth}
4963 \pgfsetarrowsend{latexslim}
4964 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4965 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
4966 \pgfusepath{draw}
4967 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
4968 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
4969 \pgfusepath{draw}
4970 }
4971
4972 %% Empty photodiode
4973
4974 \pgfcircdeclarebipole
4975 {}
4976 {\ctikzvalof{bipoles/diode/height}}
4977 {emptypdiode}
4978 {\ctikzvalof{bipoles/diode/height}}
4979 {\ctikzvalof{bipoles/diode/width}}
4980 {
4981
4982 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4983 \pgfscope
4984 \pgf@circ@basicdiodeshape
4985 \endpgfscope
4986 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4987 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4988 \pgfusepath{draw}
4989
4990 \pgfsetlinewidth{\pgfstartlinewidth}
4991 \pgfsetarrowsstart{latexslim}
4992 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4993 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
4994 \pgfusepath{draw}
4995 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
4996 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
4997 \pgfusepath{draw}
4998 }
4999
5000 %% Empty varcap
5001
5002 \pgfcircdeclarebipole
5003 {}
5004 {\ctikzvalof{bipoles/varcap/height}}
5005 {emptyvarcap}
5006 {\ctikzvalof{bipoles/varcap/height}}
5007 {\ctikzvalof{bipoles/varcap/width}}
5008 {
5009 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
5010 \pgfsetlinewidth{\pgf@circ@res@temp}
5011 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5012 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5013 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5014 % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5015 \pgfpathclose
5016 \pgf@circ@draworfill
5017 \pgfscope
5018 % to allow filling, we need to draw explicitily the stroke here.
5019 \pgfsetlinewidth{\pgfstartlinewidth}
5020 \ifpgf@circuit@bipole@strokedsymbol
5021 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5022 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5023 \pgfusepath{draw}
5024 \fi
5025 \endpgfscope
5026 %
5027 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
5028 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
5029 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5030 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5031 \pgfusepath{draw}
5032 }
5033
5034 %% Empty bidirectionaldiode
5035
5036 \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{emptybidirectionaldiode}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{\ctikzvalof{bipoles/bidirectionaldiode/width}}
5037 {
5038
5039 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5040
5041 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
5042 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
5043
5044 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5045 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5046 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5047 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5048
5049 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5050 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5051 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5052 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5053
5054 \pgf@circ@draworfill
5055 % \pgfusepath{draw}
5056
5057 \pgfsetlinewidth{\pgfstartlinewidth}
5058
5059 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5060 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5061
5062 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5063 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5064
5065 \pgfusepath{draw}
5066
5067 }
5068
5069
5070 %% Full bidirectionaldiode
5071
5072 \pgfcircdeclarebipole
5073 {}
5074 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
5075 {fullbidirectionaldiode}
5076 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
5077 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
5078 {
5079
5080 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5081
5082 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
5083 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
5084
5085 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5086 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5087 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5088 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5089
5090 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5091 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5092 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5093 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5094
5095 \pgfusepath{draw, fill}
5096
5097 \pgfsetlinewidth{\pgfstartlinewidth}
5098
5099 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5100 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5101
5102 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5103 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5104
5105 \pgfusepath{draw}
5106
5107 }
5108
5109 %% (Closing) SPST
5110 \pgfcircdeclarebipole
5111 {}
5112 {\ctikzvalof{bipoles/spst/depth}}
5113 {cspst}
5114 {\ctikzvalof{bipoles/spst/height}}
5115 {\ctikzvalof{bipoles/spst/width}}
5116 {
5117 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5118 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5119 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
5120 \pgfusepath{draw}
5121
5122 \pgfscope
5123 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5124 \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
5125 \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
5126 \pgfsetarrowsend{latexslim}
5127 \pgfsetbeveljoin
5128 \pgfusepath{draw}
5129 \endpgfscope
5130 }
5131
5132 %% Opening SPST
5133 \pgfcircdeclarebipole
5134 {}
5135 {\ctikzvalof{bipoles/spst/depth}}
5136 {ospst}
5137 {\ctikzvalof{bipoles/spst/height}}
5138 {\ctikzvalof{bipoles/spst/width}}
5139 {
5140
5141 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5142 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5143 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
5144 \pgfusepath{draw}
5145
5146 \pgfscope
5147 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5148 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
5149 \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
5150 \pgfsetarrowsend{latexslim}
5151 \pgfsetbeveljoin
5152 \pgfusepath{draw}
5153 \endpgfscope
5154 }
5155
5156 %% Normal open Switch
5157 \pgfcircdeclarebipole
5158 {}
5159 {\ctikzvalof{bipoles/nos/depth}}
5160 {nos}
5161 {\ctikzvalof{bipoles/nos/height}}
5162 {\ctikzvalof{bipoles/nos/width}}
5163 {
5164
5165 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5166 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5167 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
5168 \pgfsetbuttcap
5169 \pgfusepath{draw}
5170 }
5171
5172 %% Normal closed Switch
5173 \pgfcircdeclarebipole
5174 {}
5175 {\ctikzvalof{bipoles/ncs/depth}}
5176 {ncs}
5177 {\ctikzvalof{bipoles/ncs/height}}
5178 {\ctikzvalof{bipoles/ncs/width}}
5179 {
5180 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5181 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5182 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
5183 \pgfusepath{draw}
5184 \pgfsetlinewidth{\pgfstartlinewidth}
5185 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5186 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
5187 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
5188 \pgfusepath{draw}
5189 }
5190
5191 %% Push Button
5192 \pgfcircdeclarebipole
5193 {}
5194 {\ctikzvalof{bipoles/pushbutton/height 2}}
5195 {pushbutton}
5196 {\ctikzvalof{bipoles/pushbutton/height}}
5197 {\ctikzvalof{bipoles/pushbutton/width}}
5198 {
5199 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5200 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5201 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5202 \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
5203 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
5204 \pgfusepath{draw}
5205
5206 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5207 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5208 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5209 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5210 }
5211
5212 %% Normally closed Push Button
5213 \pgfcircdeclarebipole
5214 {}
5215 {\ctikzvalof{bipoles/pushbutton/height 2}}
5216 {ncpushbutton}
5217 {\ctikzvalof{bipoles/pushbutton/height}}
5218 {\ctikzvalof{bipoles/pushbutton/width}}
5219 {
5220 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5221 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5222 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5223 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
5224 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
5225 \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
5226 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
5227 \pgfusepath{draw}
5228 %
5229 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5230 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5231 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5232 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5233 }
5234 % cute switch "to" shapes help function
5235 % #1 -> name
5236 % #2 -> barposition
5237 % #3 -> arrowcode
5238 \long\def\pgfcircdeclarecutesw#1#2#3{
5239 \pgfcircdeclarebipole
5240 {
5241 \savedanchor\midlever{
5242 % these values are calculated when we create the definition of the shape.
5243 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
5244 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5245 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
5246 \pgf@circ@res@down = -.5\pgf@y
5247 \pgf@circ@res@up = .5\pgf@y
5248 \pgfextracty{\pgf@circ@res@other}{#2}
5249 \pgf@x=0pt
5250 \pgf@y=.5\pgf@circ@res@other
5251 }
5252 % radius of the connector
5253 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5254 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
5255 % shapename
5256 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
5257 % shape type
5258 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
5259 % mid of the lever, to stack switches
5260 \anchor{mid}{\midlever}
5261 \anchor{cout}{\northeast \pgf@y=0cm}
5262 \anchor{cin}{\southwest\pgf@y=0cm}
5263 \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
5264 \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
5265 }
5266 {\ctikzvalof{bipoles/cuteswitch/height 2}}
5267 {#1}
5268 {\ctikzvalof{bipoles/cuteswitch/height}}
5269 {\ctikzvalof{bipoles/cuteswitch/width}}{
5270 \pgfscope
5271 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5272 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5273 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
5274 \pgfsetlinewidth{2\pgf@circ@res@temp}
5275 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5276 \pgfpathlineto{#2}
5277 \pgfsetroundcap\pgfusepath{draw}
5278 \endpgfscope
5279 \pgfscope % arrow
5280 #3
5281 \endpgfscope
5282 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5283 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
5284 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5285 \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
5286 }
5287 }
5288
5289 %% closed cute switch
5290 \pgfcircdeclarecutesw{cuteclosedswitch}
5291 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
5292 {}
5293
5294 %% open cute switch
5295 \pgfcircdeclarecutesw{cuteopenswitch}
5296 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5297 {}
5298
5299 %% closing cute switch
5300 \pgfcircdeclarecutesw{cuteclosingswitch}
5301 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5302 {
5303 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5304 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
5305 \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
5306 \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
5307 \pgfsetarrowsend{latexslim}
5308 \pgfusepath{draw}
5309 }
5310
5311 %% opening cute switch
5312 \pgfcircdeclarecutesw{cuteopeningswitch}
5313 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
5314 {
5315 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5316 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
5317 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
5318 \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
5319 \pgfsetarrowsend{latexslim}
5320 \pgfusepath{draw}
5321 }
5322
5323
5324 % % METERINGSHAPE
5325 \long\def\drawmeteringcircle{
5326 \def\pgf@circ@temp{right}
5327 \ifx\tikz@res@label@pos\pgf@circ@temp
5328 \pgf@circ@res@step=-1.2\pgf@circ@res@up
5329 \else
5330 \def\pgf@circ@temp{below}
5331 \ifx\tikz@res@label@pos\pgf@circ@temp
5332 \pgf@circ@res@step=-1.2\pgf@circ@res@up
5333 \else
5334 \pgf@circ@res@step=1.2\pgf@circ@res@up
5335 \fi
5336 \fi
5337 %draw connections to circle
5338 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5339 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
5340 \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
5341 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5342 \pgfusepath{draw}
5343 %draw circle
5344 \pgfscope
5345 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5346 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
5347 \pgf@circ@draworfill
5348 \endpgfscope
5349 %draw arrow
5350 \pgfscope
5351 \pgfsetarrowsend{latex}
5352 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5353 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
5354 \pgfusepath{draw}
5355 \endpgfscope
5356 }
5357 %AMPEREMETER
5358 \pgfcircdeclarebipole
5359 {}
5360 {\ctikzvalof{bipoles/ammeter/height}}
5361 {ammeter}
5362 {\ctikzvalof{bipoles/ammeter/height}}
5363 {\ctikzvalof{bipoles/ammeter/width}}
5364 {
5365 \drawmeteringcircle
5366 \pgfnode{circle}{center}{\textbf{A}}{}{}
5367 }
5368 %OHMMETER
5369 \pgfcircdeclarebipole
5370 {}
5371 {\ctikzvalof{bipoles/ohmmeter/height}}
5372 {ohmmeter}
5373 {\ctikzvalof{bipoles/ohmmeter/height}}
5374 {\ctikzvalof{bipoles/ohmmeter/width}}
5375 {
5376 \drawmeteringcircle
5377 \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
5378 }
5379 %VOLTMETER
5380 \pgfcircdeclarebipole
5381 {}
5382 {\ctikzvalof{bipoles/voltmeter/height}}
5383 {voltmeter}
5384 {\ctikzvalof{bipoles/voltmeter/height}}
5385 {\ctikzvalof{bipoles/voltmeter/width}}
5386 {
5387 \drawmeteringcircle
5388 \pgfnode{circle}{center}{\textbf{V}}{}{}
5389
5390 }
5391
5392 % oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
5393 \pgfcircdeclarebipole
5394 {
5395 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
5396 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
5397 % put the node text above and centered
5398 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
5399 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
5400 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
5401 }
5402 }
5403 }
5404 {\ctikzvalof{bipoles/oscope/height}}
5405 {oscope}
5406 {\ctikzvalof{bipoles/oscope/height}}
5407 {\ctikzvalof{bipoles/oscope/width}}
5408 {
5409 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5410 \pgfextracty{\pgf@circ@res@up}{\northeast}
5411 \pgfextractx{\pgf@circ@res@right}{\northeast}
5412 \pgfextractx{\pgf@circ@res@left}{\southwest}
5413 \pgfextracty{\pgf@circ@res@down}{\southwest}
5414 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
5415 \pgfscope
5416 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
5417 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5418 % this would create a round (analog?) scope...
5419 % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5420 \pgf@circ@draworfill
5421 \endpgfscope
5422 % get the rotation
5423 \pgfgettransformentries\a\b\temp\temp\temp\temp
5424 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
5425 % and unrotate the scope
5426 \pgfscope
5427 \pgftransformrotate{\rot}
5428 % grid
5429 \pgfscope
5430 \pgfsetlinewidth{0.5\pgfstartlinewidth}
5431 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5432 \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
5433 {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
5434 {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
5435 \pgfsetstrokeopacity{0.5}
5436 \pgfusepath{draw}
5437 \endpgfscope
5438 % function displayed, thanks to
5439 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5440 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5441 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
5442 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5443 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
5444 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
5445 \pgfusepath{draw}
5446 \endpgfscope
5447 }
5448 %% Short circuit
5449
5450 %%% NOTICE that the short is really NOT drawn; we trust the fact that its
5451 %%% natural length is zero.
5452 \pgfcircdeclarebipole
5453 {}
5454 {0}
5455 {short}
5456 {0}
5457 {0}
5458 { }
5459
5460 %% Open circuit
5461
5462 \pgfcircdeclarebipole
5463 {}
5464 {\ctikzvalof{bipoles/open/height}}
5465 {open}
5466 {\ctikzvalof{bipoles/open/height}}
5467 {\ctikzvalof{bipoles/open/width}}
5468 { }
5469
5470 %% Generic bipole - used as resistor by some (bleah)
5471
5472 \pgfcircdeclarebipole
5473 {}
5474 {\ctikzvalof{bipoles/generic/height}}
5475 {generic}
5476 {\ctikzvalof{bipoles/generic/height}}
5477 {\ctikzvalof{bipoles/generic/width}}
5478 {
5479 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5480 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5481 \pgf@circ@draworfill
5482 }
5483
5484
5485 %% fuse
5486
5487 \pgfcircdeclarebipole
5488 {}
5489 {\ctikzvalof{bipoles/fuse/height}}
5490 {fuse}
5491 {\ctikzvalof{bipoles/fuse/height}}
5492 {\ctikzvalof{bipoles/fuse/width}}
5493 {
5494
5495 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
5496 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5497 \pgfusepath{draw}
5498
5499 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5500 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5501
5502 \pgf@circ@draworfill
5503 }
5504
5505
5506
5507 %% Generic bipole, filled - used as inductor by some
5508
5509 \pgfcircdeclarebipole
5510 {}
5511 {\ctikzvalof{bipoles/fullgeneric/height}}
5512 {fullgeneric}
5513 {\ctikzvalof{bipoles/fullgeneric/height}}
5514 {\ctikzvalof{bipoles/fullgeneric/width}}
5515 {
5516 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5517 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5518
5519 \pgfusepath{draw,fill}
5520 }
5521
5522 %% Generic sensor, filled - used as inductive sensor by some
5523
5524 \pgfcircdeclarebipole
5525 {{% anchor for labelling the type of dependency
5526 \anchor{label}{%
5527 \southwest
5528 \pgf@x=0.4\pgf@x
5529 \pgf@y=2\pgf@y
5530 }%
5531 }}
5532 {\ctikzvalof{bipoles/fullgeneric/height}}
5533 {sfullgeneric}
5534 {\ctikzvalof{bipoles/fullgeneric/height}}
5535 {\ctikzvalof{bipoles/fullgeneric/width}}
5536 {
5537
5538 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5539 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5540 \pgfusepath{draw,fill}
5541 %\pgfscope
5542 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
5543 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
5544 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
5545 \pgfusepath{draw}
5546 %\endpgfscope
5547 }
5548
5549
5550 %% Generic asymmetric bipole
5551
5552 \pgfcircdeclarebipole
5553 {}
5554 {\ctikzvalof{bipoles/ageneric/height}}
5555 {ageneric}
5556 {\ctikzvalof{bipoles/ageneric/height}}
5557 {\ctikzvalof{bipoles/ageneric/width}}
5558 {
5559 \pgfscope
5560 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5561 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5562 \pgf@circ@draworfill
5563 \endpgfscope
5564
5565 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5566 \pgfusepath{stroke,fill}
5567 }
5568
5569
5570 %% asymmetric fuse
5571
5572 \pgfcircdeclarebipole
5573 {}
5574 {\ctikzvalof{bipoles/afuse/height}}
5575 {afuse}
5576 {\ctikzvalof{bipoles/afuse/height}}
5577 {\ctikzvalof{bipoles/afuse/width}}
5578 {
5579 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
5580 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5581 \pgfusepath{draw}
5582
5583 \pgfscope
5584 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5585 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5586 \pgf@circ@draworfill
5587 \endpgfscope
5588
5589 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5590 \pgfusepath{stroke,fill}
5591 }
5592
5593
5594
5595
5596 %% Memristor
5597
5598 \pgfcircdeclarebipole
5599 {}
5600 {\ctikzvalof{bipoles/memristor/height}}
5601 {memristor}
5602 {\ctikzvalof{bipoles/memristor/height}}
5603 {\ctikzvalof{bipoles/memristor/width}}
5604 {
5605 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
5606 \divide \pgf@circ@res@step by 14
5607
5608 \pgfscope
5609 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5610 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5611 \pgf@circ@draworfill
5612 \endpgfscope
5613 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5614 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
5615 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5616 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5617 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5618 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5619 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5620 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5621 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
5622 \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
5623
5624 \pgfusepath{draw}
5625
5626 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5627 \pgfusepath{stroke,fill}
5628 }
5629
5630
5631
5632
5633 %% Generic empty tunable
5634
5635 \pgfcircdeclarebipole
5636 {}
5637 {\ctikzvalof{bipoles/tgeneric/height}}
5638 {tgeneric}
5639 {\ctikzvalof{bipoles/tgeneric/height}}
5640 {\ctikzvalof{bipoles/tgeneric/width}}
5641 {
5642 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
5643 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5644 \pgf@circ@draworfill
5645 \pgfscope
5646 \pgfsetarrowsend{latexslim}
5647 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
5648 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
5649 \pgfusepath{draw}
5650 \endpgfscope
5651 }
5652
5653 %% Photoresistor
5654
5655 \pgfcircdeclarebipole
5656 {}
5657 {\ctikzvalof{bipoles/photoresistor/height 2}}
5658 {photoresistor}
5659 {\ctikzvalof{bipoles/photoresistor/height}}
5660 {\ctikzvalof{bipoles/photoresistor/width}}
5661 {
5662 \pgfscope
5663 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
5664 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5665 \pgf@circ@draworfill
5666 \endpgfscope
5667
5668 \pgfscope
5669 \pgfsetarrowsend{latexslim}
5670 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
5671 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
5672 \pgfusepath{draw}
5673 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
5674 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
5675 \pgfusepath{draw}
5676 \endpgfscope
5677 }
5678
5679
5680
5681
5682 %% Thermistor
5683 \pgfcircdeclarebipole
5684 {{% anchor for labelling the type of dependency
5685 \anchor{label}{%
5686 \southwest
5687 \pgf@x=0.4\pgf@x
5688 \pgf@y=1.2\pgf@y
5689 }%
5690 }}
5691 {\ctikzvalof{bipoles/thermistor/height}}
5692 {thermistor}
5693 {\ctikzvalof{bipoles/thermistor/height}}
5694 {\ctikzvalof{bipoles/thermistor/width}}
5695 {
5696 \pgfscope
5697 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}
5698 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5699 \pgf@circ@draworfill
5700 \endpgfscope
5701
5702 %\pgfscope
5703 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
5704 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
5705 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
5706 \pgfusepath{draw}
5707 %\endpgfscope
5708 }
5709
5710
5711 %% Thermistor PTC
5712 \pgfcircdeclarebipole
5713 {}
5714 {\ctikzvalof{bipoles/thermistorptc/height 2}}
5715 {thermistorptc}
5716 {\ctikzvalof{bipoles/thermistorptc/height}}
5717 {\ctikzvalof{bipoles/thermistorptc/width}}
5718 {
5719 \pgfscope
5720 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}
5721 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5722 \pgf@circ@draworfill
5723 \endpgfscope
5724 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
5725 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
5726 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
5727 \pgfusepath{draw}
5728
5729 \pgfsetlinewidth{\pgfstartlinewidth}
5730 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
5731 \pgfsetarrowsend{latexslim}
5732 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
5733 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
5734 \pgfusepath{draw}
5735 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
5736 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
5737 \pgfusepath{draw}
5738 }
5739
5740 %% Thermistor NTC
5741 \pgfcircdeclarebipole
5742 {}
5743 {\ctikzvalof{bipoles/thermistorntc/height 2}}
5744 {thermistorntc}
5745 {\ctikzvalof{bipoles/thermistorntc/height}}
5746 {\ctikzvalof{bipoles/thermistorntc/width}}
5747 {
5748 \pgfscope
5749 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}
5750 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5751 \pgf@circ@draworfill
5752 \endpgfscope
5753
5754 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
5755 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
5756 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
5757 \pgfusepath{draw}
5758
5759 \pgfsetlinewidth{\pgfstartlinewidth}
5760 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
5761 \pgfsetarrowsend{latexslim}
5762 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
5763 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
5764 \pgfusepath{draw}
5765 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
5766 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
5767 \pgfusepath{draw}
5768 }
5769
5770 %% thermocouple
5771 \pgfcircdeclarebipole
5772 {}
5773 {\ctikzvalof{bipoles/thermocouple/height 2}}
5774 {thermocouple}
5775 {\ctikzvalof{bipoles/thermocouple/height}}
5776 {\ctikzvalof{bipoles/thermocouple/width}}
5777 {
5778
5779 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
5780 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5781 \pgfusepath{draw}
5782 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5783 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5784 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
5785 \pgfusepath{draw}
5786 \pgfsetlinewidth{\pgfstartlinewidth}
5787 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
5788 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5789 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5790 \pgfusepath{draw}
5791 }
5792
5793 %% Varistor
5794 \pgfcircdeclarebipole
5795 {}
5796 {\ctikzvalof{bipoles/varistor/height}}
5797 {varistor}
5798 {\ctikzvalof{bipoles/varistor/height}}
5799 {\ctikzvalof{bipoles/varistor/width}}
5800 {
5801 \pgfscope
5802 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}
5803 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5804 \pgf@circ@draworfill
5805 \endpgfscope
5806
5807 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
5808 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
5809 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5810 \pgfusepath{draw}
5811
5812 \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
5813 }
5814
5815
5816
5817 %% Generic full tunable
5818
5819 \pgfcircdeclarebipole
5820 {}
5821 {\ctikzvalof{bipoles/tfullgeneric/height}}
5822 {tfullgeneric}
5823 {\ctikzvalof{bipoles/tfullgeneric/height}}
5824 {\ctikzvalof{bipoles/tfullgeneric/width}}
5825 {
5826 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
5827 \divide \pgf@circ@res@step by 14
5828
5829 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
5830 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5831 \pgfusepath{draw,fill}
5832
5833 \pgfscope
5834 \pgfsetarrowsend{latexslim}
5835 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
5836 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
5837 \pgfusepath{draw}
5838 \endpgfscope
5839 }
5840
5841
5842
5843
5844
5845
5846
5847 %% Variable Capacitor
5848
5849 \pgfcircdeclarebipole
5850 {}
5851 {\ctikzvalof{bipoles/vcapacitor/height}}
5852 {vcapacitor}
5853 {\ctikzvalof{bipoles/vcapacitor/height}}
5854 {\ctikzvalof{bipoles/vcapacitor/width}}
5855 {
5856 %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
5857 \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
5858
5859 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5860 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
5861 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
5862
5863 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5864 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5865 \pgfusepath{draw}
5866
5867 \pgfscope
5868 \pgfsetarrowsend{latexslim}
5869 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5870 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5871 \pgfusepath{draw}
5872 \endpgfscope
5873
5874 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5875 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
5876 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5877 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5878 \pgfsetlinewidth{\pgfstartlinewidth}
5879 \pgfusepath{draw}
5880 }
5881
5882
5883 %% Piezoelectric Element
5884
5885 \pgfcircdeclarebipole
5886 {}
5887 {\ctikzvalof{bipoles/piezoelectric/height}}
5888 {piezoelectric}
5889 {\ctikzvalof{bipoles/piezoelectric/height}}
5890 {\ctikzvalof{bipoles/piezoelectric/width}}
5891 {
5892 \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
5893 \divide \pgf@circ@res@step by 5
5894
5895 %% Outer markings
5896 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5897 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5898 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5899
5900 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5901 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5902 \pgfusepath{draw}
5903
5904 %% Inner Box
5905 \pgfscope
5906 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5907 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}}
5908 \pgf@circ@draworfill
5909 \endpgfscope
5910 }
5911
5912
5913
5914
5915
5916
5917 %% Lamp
5918
5919 \pgfcircdeclarebipole
5920 {}
5921 {\ctikzvalof{bipoles/lamp/height}}
5922 {lamp}
5923 {\ctikzvalof{bipoles/lamp/height}}
5924 {\ctikzvalof{bipoles/lamp/width}}
5925 {
5926
5927 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5928
5929 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5930 \pgf@circ@draworfill
5931 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
5932 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
5933 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
5934 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
5935 \pgfusepath{draw}
5936 }
5937
5938 %% bulb
5939 \pgfcircdeclarebipole
5940 {}
5941 {\ctikzvalof{bipoles/bulb/height}}
5942 {bulb}
5943 {\ctikzvalof{bipoles/bulb/height}}
5944 {\ctikzvalof{bipoles/bulb/width}}
5945 {%
5946 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5947 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
5948 \pgf@circ@draworfill
5949 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5950 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
5951 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
5952 \pgfsetbeveljoin
5953 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5954 \pgfusepath{draw}
5955 }
5956
5957
5958 % transmission line
5959
5960 \pgfcircdeclarebipole
5961 {}
5962 {\ctikzvalof{bipoles/tline/height}}
5963 {tline}
5964 {\ctikzvalof{bipoles/tline/height}}
5965 {\ctikzvalof{bipoles/tline/width}}
5966 {
5967 \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
5968 \begin{pgftransparencygroup}
5969 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5970 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
5971 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
5972 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
5973 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
5974 \pgf@circ@draworfill
5975 \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
5976 {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
5977 \pgf@circ@draworfill
5978 \end{pgftransparencygroup}
5979 \pgfsetlinewidth{\pgfstartlinewidth}
5980 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
5981 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5982 \pgfusepath{stroke}
5983 }
5984
5985 % microstrip transmission line
5986
5987 \pgfcircdeclarebipole
5988 {}
5989 {\ctikzvalof{bipoles/mstline/height}}
5990 {mstline}
5991 {\ctikzvalof{bipoles/mstline/height}}
5992 {\ctikzvalof{bipoles/mstline/width}}
5993 {
5994 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5995 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
5996 \pgf@circ@draworfill
5997 }
5998 %% SQUID added by Cor Molenaar 5 March 2010
5999
6000 \pgfcircdeclarebipole
6001 {}
6002 {\ctikzvalof{bipoles/squid/height}}
6003 {squid}
6004 {\ctikzvalof{bipoles/squid/height}}
6005 {\ctikzvalof{bipoles/squid/width}}
6006 {
6007
6008 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6009
6010 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6011 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
6012 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
6013 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
6014 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
6015 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
6016 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
6017 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
6018 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
6019
6020 \pgfusepath{draw}
6021 }
6022
6023
6024
6025 % Generic barrier added by Cor Molenaar 5 March 2010
6026
6027 \pgfcircdeclarebipole
6028 {}
6029 {\ctikzvalof{bipoles/barrier/height}}
6030 {barrier}
6031 {\ctikzvalof{bipoles/barrier/height}}
6032 {\ctikzvalof{bipoles/barrier/width}}
6033 {
6034
6035 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6036
6037 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
6038 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
6039 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
6040 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
6041 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
6042 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
6043
6044 \pgfusepath{draw}
6045 }
6046
6047
6048 % Contributed by Danilo Piazzalunga
6049
6050 \pgfdeclareshape{buffer}
6051 {
6052 \anchor{center}{\pgfpointorigin}
6053 \savedanchor\northwest{%
6054 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@circ@Rlen
6055 \pgf@y=.5\pgf@y
6056 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@circ@Rlen
6057 \pgf@x=.5\pgf@x
6058 }
6059 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
6060 \anchor{west}{ \northwest \pgf@y=0pt }
6061 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
6062 \anchor{north}{ \northwest \pgf@x=0pt }
6063 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
6064 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
6065 \anchor{north west}{ \northwest }
6066 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
6067 \savedanchor\left{%
6068 \pgf@y=0pt
6069 }
6070 \anchor{in}{
6071 \northwest
6072 \pgf@y=0pt
6073 }
6074 \anchor{out}{
6075 \northwest
6076 \pgf@y=0pt
6077 \pgf@x=-\pgf@x
6078 }
6079
6080 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
6081
6082 \backgroundpath{
6083 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
6084
6085
6086 \northwest
6087 \pgf@circ@res@up = \pgf@y
6088 \pgf@circ@res@down = -\pgf@y
6089 \pgf@circ@res@right = -\pgf@x
6090 \pgf@circ@res@left = \pgf@x
6091 \pgfscope
6092 \pgfsetlinewidth{2\pgflinewidth}
6093 \pgftransformxshift{.7\pgf@circ@res@left}
6094 \pgf@circ@res@step=\pgf@circ@res@right
6095 \advance\pgf@circ@res@step by -\pgf@circ@res@left
6096 \pgf@circ@res@step=.7\pgf@circ@res@step
6097
6098 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6099 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6100 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6101 \pgfpathclose
6102 \pgf@circ@draworfill
6103 \endpgfscope
6104
6105
6106 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6107 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
6108
6109 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6110 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6111
6112 \pgfusepath{draw}
6113
6114 }
6115 }
6116
6117
6118
6119
6120
6121 \pgfdeclareshape{plain amp}
6122 {
6123 \anchor{center}{\pgfpointorigin}
6124 \savedanchor\northwest{%
6125 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6126 \pgf@y=.5\pgf@y
6127 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6128 \pgf@x=.5\pgf@x
6129 }
6130 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
6131 \anchor{west}{ \northwest \pgf@y=0pt }
6132 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
6133 \anchor{north}{ \northwest \pgf@x=0pt }
6134 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
6135 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
6136 \anchor{north west}{ \northwest }
6137 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
6138 \savedanchor\left{%
6139 \pgf@y=0pt
6140 }
6141 \savedanchor\inOne{%
6142 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6143 \pgf@y=.5\pgf@y
6144 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
6145 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6146 \pgf@x=.5\pgf@x
6147 }
6148 \anchor{-}{
6149 \inOne
6150 }
6151 \anchor{+}{
6152 \inOne
6153 \pgf@y=-\pgf@y
6154 }
6155 \savedanchor\up{%
6156 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6157 \pgf@y=.5\pgf@y
6158 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6159 \pgf@x=.5\pgf@x
6160 \pgf@circ@res@up = \pgf@y
6161 \pgf@circ@res@right = -\pgf@x
6162 \pgf@circ@res@left = \pgf@x
6163 \pgfpointlineattime{
6164 \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
6165 \pgfpoint{
6166 \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6167 {\pgf@circ@res@up}}
6168 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6169 }
6170 \anchor{up}{
6171 \up
6172 }
6173 \anchor{down}{
6174 \up
6175 \pgf@y=-\pgf@y
6176 }
6177 \anchor{out}{
6178 \northwest
6179 \pgf@y=0pt
6180 \pgf@x=-\pgf@x
6181 }
6182
6183 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
6184
6185 \backgroundpath{
6186 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
6187
6188 \northwest
6189 \pgf@circ@res@up = \pgf@y
6190 \pgf@circ@res@down = -\pgf@y
6191 \pgf@circ@res@right = -\pgf@x
6192 \pgf@circ@res@left = \pgf@x
6193
6194 \pgfscope
6195 \pgfsetlinewidth{2\pgflinewidth}
6196 \pgftransformxshift{.7\pgf@circ@res@left}
6197 \pgf@circ@res@step=\pgf@circ@res@right
6198 \advance\pgf@circ@res@step by -\pgf@circ@res@left
6199 \pgf@circ@res@step=.7\pgf@circ@res@step
6200
6201 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6202 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6203 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6204 \pgfpathclose
6205 \pgf@circ@draworfill
6206 \endpgfscope
6207 \pgfpathmoveto{\pgfpoint
6208 {\pgf@circ@res@left}
6209 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
6210 \pgfpathlineto{\pgfpoint
6211 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6212 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
6213
6214
6215 \pgfpathmoveto{\pgfpoint
6216 {\pgf@circ@res@left}
6217 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
6218 \pgfpathlineto{\pgfpoint
6219 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6220 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
6221
6222 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6223 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6224
6225 \pgfusepath{draw}
6226
6227
6228
6229
6230
6231 }
6232 }
6233
6234
6235 %% Draw the two-port fillable box
6236 \def\pgf@circ@twoportbox{
6237 \pgfscope
6238 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6239 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6240 \pgf@circ@draworfill
6241 \endpgfscope
6242 }
6243
6244 %% Generic two port box
6245 \pgfcircdeclarebipole
6246 {}
6247 {\ctikzvalof{bipoles/twoport/height}}
6248 {twoport}
6249 {\ctikzvalof{bipoles/twoport/height}}
6250 {\ctikzvalof{bipoles/twoport/width}}
6251 {
6252 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
6253 \divide \pgf@circ@res@step by 2
6254
6255 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6256 \pgf@circ@res@other = \pgf@circ@res@left
6257 \advance\pgf@circ@res@other by \pgf@circ@res@step
6258 \ifpgf@circuit@dashed
6259 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6260 \fi
6261 % draw outer box
6262 \pgf@circ@twoportbox
6263 \ifpgf@circuit@inputarrow
6264 {
6265 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6266 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6267 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6268 }
6269 \fi
6270
6271 % rotate inner symbol
6272 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6273 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6274 \pgftransformrotate{270}
6275 \fi\fi
6276 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
6277 \pgftransformrotate{180}
6278 \fi\fi
6279 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6280 \pgftransformrotate{90}
6281 \fi\fi
6282
6283 % draw inner symbol
6284 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
6285
6286 }
6287
6288 %% voltage controled oscillator
6289 \pgfcircdeclarebipole
6290 {}
6291 {\ctikzvalof{bipoles/vco/width}}
6292 {vco}
6293 {\ctikzvalof{bipoles/twoport/width}}
6294 {\ctikzvalof{bipoles/vco/width}}
6295 {
6296 \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
6297 \divide \pgf@circ@res@step by 2
6298
6299 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6300 \pgf@circ@res@other = \pgf@circ@res@left
6301 \advance\pgf@circ@res@other by \pgf@circ@res@step
6302
6303 \ifpgf@circuit@dashed
6304 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6305 \fi
6306 % draw circle
6307 \pgfscope
6308 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6309 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
6310 \pgf@circ@draworfill
6311 \endpgfscope
6312 \ifpgf@circuit@inputarrow
6313 {
6314 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6315 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6316 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6317 }
6318 \fi
6319
6320 % rotate inner symbol
6321 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6322 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6323 \pgftransformrotate{270}
6324 \fi\fi
6325 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6326 \pgftransformrotate{180}
6327 \fi\fi
6328 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6329 \pgftransformrotate{90}
6330 \fi\fi
6331
6332 % draw inner sine waves
6333 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6334 \pgfsetlinewidth{\pgfstartlinewidth}
6335 \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
6336 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6337 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6338 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6339 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6340 \pgfusepath{draw}
6341
6342 }
6343
6344 %% bandpass filter
6345 \pgfcircdeclarebipole
6346 {}
6347 {\ctikzvalof{bipoles/bandpass/width}}
6348 {bandpass}
6349 {\ctikzvalof{bipoles/bandpass/width}}
6350 {\ctikzvalof{bipoles/bandpass/width}}
6351 {
6352
6353 \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
6354 \divide \pgf@circ@res@step by 2
6355
6356 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6357 \pgf@circ@res@other = \pgf@circ@res@left
6358 \advance\pgf@circ@res@other by \pgf@circ@res@step
6359
6360 \ifpgf@circuit@dashed
6361 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6362 \fi
6363
6364 % draw outer box
6365 \pgf@circ@twoportbox
6366
6367 \ifpgf@circuit@inputarrow
6368 {
6369 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6370 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6371 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6372 }
6373 \fi
6374
6375 % rotate inner symbol
6376 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6377 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6378 \pgftransformrotate{270}
6379 \fi\fi
6380 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6381 \pgftransformrotate{180}
6382 \fi\fi
6383 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6384 \pgftransformrotate{90}
6385 \fi\fi
6386
6387 % draw inner symbol
6388 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6389 \pgfsetarrows{-} %never draw arrows
6390 \pgfsetlinewidth{\pgfstartlinewidth}
6391 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6392 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6393 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6394 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6395 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6396 \pgfusepath{draw}
6397 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
6398 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
6399 \pgfusepath{draw}
6400
6401 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6402 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6403 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6404 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6405 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6406 \pgfusepath{draw}
6407
6408 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6409 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6410 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6411 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6412 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6413 \pgfusepath{draw}
6414 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
6415 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
6416 \pgfusepath{draw}
6417 }
6418
6419 %% bandstop filter
6420 \pgfcircdeclarebipole
6421 {}
6422 {\ctikzvalof{bipoles/bandstop/width}}
6423 {bandstop}
6424 {\ctikzvalof{bipoles/bandstop/width}}
6425 {\ctikzvalof{bipoles/bandstop/width}}
6426 {
6427 \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@Rlen
6428 \divide \pgf@circ@res@step by 2
6429
6430 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6431 \pgf@circ@res@other = \pgf@circ@res@left
6432 \advance\pgf@circ@res@other by \pgf@circ@res@step
6433
6434 \ifpgf@circuit@dashed
6435 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6436 \fi
6437
6438 % draw outer box
6439 \pgf@circ@twoportbox
6440
6441 \ifpgf@circuit@inputarrow
6442 {
6443 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6444 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6445 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6446 }
6447 \fi
6448
6449 % rotate inner symbol
6450 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6451 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6452 \pgftransformrotate{270}
6453 \fi\fi
6454 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
6455 \pgftransformrotate{180}
6456 \fi\fi
6457 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6458 \pgftransformrotate{90}
6459 \fi\fi
6460
6461 % draw inner symbol
6462 \pgfsetdash{}{0pt}% always draw solid line for inner symbol
6463 \pgfsetarrows{-}%never draw arrows
6464 \pgfsetlinewidth{\pgfstartlinewidth}
6465 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6466 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6467 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6468 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6469 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6470 \pgfusepath{draw}
6471
6472 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6473 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6474 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6475 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6476 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6477 \pgfusepath{draw}
6478 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6479 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6480 \pgfusepath{draw}
6481
6482 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6483 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6484 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6485 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6486 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6487 \pgfusepath{draw}
6488 }
6489
6490 %% highpass filter
6491 \pgfcircdeclarebipole
6492 {}
6493 {\ctikzvalof{bipoles/highpass/width}}
6494 {highpass}
6495 {\ctikzvalof{bipoles/highpass/width}}
6496 {\ctikzvalof{bipoles/highpass/width}}
6497 {
6498 \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
6499 \divide \pgf@circ@res@step by 2
6500
6501 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6502 \pgf@circ@res@other = \pgf@circ@res@left
6503 \advance\pgf@circ@res@other by \pgf@circ@res@step
6504
6505 \ifpgf@circuit@dashed
6506 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6507 \fi
6508
6509 % draw outer box
6510 \pgf@circ@twoportbox
6511
6512 \ifpgf@circuit@inputarrow
6513 {
6514 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6515 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6516 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6517 }
6518 \fi
6519
6520 % rotate inner symbol
6521 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6522 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6523 \pgftransformrotate{270}
6524 \fi\fi
6525 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6526 \pgftransformrotate{180}
6527 \fi\fi
6528 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6529 \pgftransformrotate{90}
6530 \fi\fi
6531
6532 % draw inner symbol
6533 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6534 \pgfsetarrows{-} %never draw arrows
6535 \pgfsetlinewidth{\pgfstartlinewidth}
6536 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6537 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6538 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6539 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6540 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6541 \pgfusepath{draw}
6542
6543 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6544 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6545 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6546 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6547 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6548 \pgfusepath{draw}
6549 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6550 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6551 \pgfusepath{draw}
6552
6553 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6554 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6555 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6556 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6557 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6558 \pgfusepath{draw}
6559 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
6560 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
6561 \pgfusepath{draw}
6562 }
6563
6564 %% lowpass filter
6565 \pgfcircdeclarebipole
6566 {}
6567 {\ctikzvalof{bipoles/lowpass/width}}
6568 {lowpass}
6569 {\ctikzvalof{bipoles/lowpass/width}}
6570 {\ctikzvalof{bipoles/lowpass/width}}
6571 {
6572 \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
6573 \divide \pgf@circ@res@step by 2
6574
6575 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6576 \pgf@circ@res@other = \pgf@circ@res@left
6577 \advance\pgf@circ@res@other by \pgf@circ@res@step
6578
6579 \ifpgf@circuit@dashed
6580 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6581 \fi
6582
6583 % draw outer box
6584 \pgf@circ@twoportbox
6585
6586 \ifpgf@circuit@inputarrow
6587 {
6588 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6589 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6590 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6591 }
6592 \fi
6593
6594 % rotate inner symbol
6595 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6596 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6597 \pgftransformrotate{270}
6598 \fi\fi
6599 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6600 \pgftransformrotate{180}
6601 \fi\fi
6602 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6603 \pgftransformrotate{90}
6604 \fi\fi
6605
6606 % draw inner symbol
6607 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6608 \pgfsetarrows{-} %never draw arrows
6609 \pgfsetlinewidth{\pgfstartlinewidth}
6610 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6611 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6612 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6613 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6614 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6615 \pgfusepath{draw}
6616 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
6617 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
6618 \pgfusepath{draw}
6619
6620 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6621 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6622 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6623 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6624 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6625 \pgfusepath{draw}
6626 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6627 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6628 \pgfusepath{draw}
6629
6630 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6631 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6632 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6633 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6634 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6635 \pgfusepath{draw}
6636 }
6637
6638 %% ADC
6639 \pgfcircdeclarebipole
6640 {}
6641 {\ctikzvalof{bipoles/adc/width}}
6642 {adc}
6643 {\ctikzvalof{bipoles/adc/width}}
6644 {\ctikzvalof{bipoles/adc/width}}
6645 {
6646 \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
6647 \divide \pgf@circ@res@step by 2
6648
6649 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6650 \pgf@circ@res@other = \pgf@circ@res@left
6651 \advance\pgf@circ@res@other by \pgf@circ@res@step
6652
6653 \ifpgf@circuit@dashed
6654 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6655 \fi
6656
6657 % draw outer box
6658 \pgf@circ@twoportbox
6659
6660 \ifpgf@circuit@inputarrow
6661 {
6662 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6663 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6664 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6665 }
6666 \fi
6667
6668 % rotate inner symbol
6669 \def\texti{A}
6670 \def\textii{D}
6671 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6672 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6673 \def\texti{D}
6674 \def\textii{A}
6675 \pgftransformrotate{270}
6676 \fi\fi
6677 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6678 \def\texti{D}
6679 \def\textii{A}
6680 \pgftransformrotate{180}
6681 \fi\fi
6682 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6683 \pgftransformrotate{90}
6684 \def\texti{A}
6685 \def\textii{D}
6686 \fi\fi
6687
6688 % draw inner symbol
6689 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6690 \pgfsetarrows{-} %never draw arrows
6691 \pgfsetlinewidth{\pgfstartlinewidth}
6692 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6693 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6694 \pgfusepath{draw}
6695
6696 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
6697 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
6698 }
6699
6700 %% DAC
6701 \pgfcircdeclarebipole
6702 {}
6703 {\ctikzvalof{bipoles/dac/width}}
6704 {dac}
6705 {\ctikzvalof{bipoles/dac/width}}
6706 {\ctikzvalof{bipoles/dac/width}}
6707 {
6708 \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
6709 \divide \pgf@circ@res@step by 2
6710
6711 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6712 \pgf@circ@res@other = \pgf@circ@res@left
6713 \advance\pgf@circ@res@other by \pgf@circ@res@step
6714
6715 \ifpgf@circuit@dashed
6716 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6717 \fi
6718
6719 % draw outer box
6720 \pgf@circ@twoportbox
6721
6722 \ifpgf@circuit@inputarrow
6723 {
6724 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6725 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6726 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6727 }
6728 \fi
6729
6730 % rotate inner symbol
6731 \def\texti{D}
6732 \def\textii{A}
6733 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6734 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6735 \def\texti{A}
6736 \def\textii{D}
6737 \pgftransformrotate{270}
6738 \fi\fi
6739 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6740 \def\texti{A}
6741 \def\textii{D}
6742 \pgftransformrotate{180}
6743 \fi\fi
6744 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6745 \pgftransformrotate{90}
6746 \def\texti{D}
6747 \def\textii{A}
6748 \fi\fi
6749
6750 % draw inner symbol
6751 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6752 \pgfsetarrows{-} %never draw arrows
6753 \pgfsetlinewidth{\pgfstartlinewidth}
6754 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6755 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6756 \pgfusepath{draw}
6757
6758 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
6759 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
6760 }
6761
6762 %% DSP
6763 \pgfcircdeclarebipole
6764 {}
6765 {\ctikzvalof{bipoles/dsp/width}}
6766 {dsp}
6767 {\ctikzvalof{bipoles/dsp/width}}
6768 {\ctikzvalof{bipoles/dsp/width}}
6769 {
6770 \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
6771 \divide \pgf@circ@res@step by 2
6772
6773 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6774 \pgf@circ@res@other = \pgf@circ@res@left
6775 \advance\pgf@circ@res@other by \pgf@circ@res@step
6776
6777 \ifpgf@circuit@dashed
6778 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6779 \fi
6780
6781 % draw outer box
6782 \pgf@circ@twoportbox
6783
6784 \ifpgf@circuit@inputarrow
6785 {
6786 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6787 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6788 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6789 }
6790 \fi
6791
6792 % rotate inner symbol
6793 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6794 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6795 \pgftransformrotate{270}
6796 \fi\fi
6797 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
6798 \pgftransformrotate{180}
6799 \fi\fi
6800 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6801 \pgftransformrotate{90}
6802 \fi\fi
6803
6804 % draw inner symbol
6805 \pgftext[center,x=0,y=0]{\textsf{DSP}}
6806 }
6807
6808 %% FFT
6809 \pgfcircdeclarebipole
6810 {}
6811 {\ctikzvalof{bipoles/fft/width}}
6812 {fft}
6813 {\ctikzvalof{bipoles/fft/width}}
6814 {\ctikzvalof{bipoles/fft/width}}
6815 {
6816 \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
6817 \divide \pgf@circ@res@step by 2
6818
6819 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6820 \pgf@circ@res@other = \pgf@circ@res@left
6821 \advance\pgf@circ@res@other by \pgf@circ@res@step
6822
6823 \ifpgf@circuit@dashed
6824 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6825 \fi
6826
6827 % draw outer box
6828 \pgf@circ@twoportbox
6829
6830 \ifpgf@circuit@inputarrow
6831 {
6832 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6833 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6834 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6835 }
6836 \fi
6837
6838 % rotate inner symbol
6839 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6840 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6841 \pgftransformrotate{270}
6842 \fi\fi
6843 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
6844 \pgftransformrotate{180}
6845 \fi\fi
6846 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6847 \pgftransformrotate{90}
6848 \fi\fi
6849
6850 % draw inner symbol
6851 \pgftext[center,x=0,y=0]{\textsf{FFT}}
6852 }
6853
6854 %% Amplifier
6855 \pgfcircdeclarebipole
6856 {}
6857 {
6858 \ifpgf@circuit@boxed
6859 \ctikzvalof{bipoles/twoport/width}
6860 \else
6861 \ctikzvalof{bipoles/amp/width}
6862 \fi
6863 }
6864 {amp}
6865 {
6866 \ifpgf@circuit@boxed
6867 \ctikzvalof{bipoles/twoport/width}
6868 \else
6869 \ctikzvalof{bipoles/amp/width}
6870 \fi
6871 }
6872 {
6873 \ifpgf@circuit@boxed
6874 \ctikzvalof{bipoles/twoport/width}
6875 \else
6876 \ctikzvalof{bipoles/amp/width}
6877 \fi
6878 }
6879 {
6880 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen
6881
6882 \ifpgf@circuit@dashed
6883 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6884 \fi
6885
6886 % draw outer box
6887 \ifpgf@circuit@boxed
6888 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6889 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
6890 \pgf@circ@draworfill
6891 \fi
6892
6893 % draw input arrow
6894 \ifpgf@circuit@inputarrow
6895 {
6896 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6897 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6898 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6899 }
6900 \fi
6901
6902 \ifpgf@circuit@boxed
6903 \pgfsetlinewidth{\pgfstartlinewidth}
6904 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
6905 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
6906 \else
6907 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6908 \fi
6909
6910 \pgfsetarrows{-} %never draw arrows
6911 \pgfsetlinewidth{\pgfstartlinewidth}
6912
6913 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
6914 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
6915 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
6916
6917 \pgfpathclose
6918 \pgf@circ@draworfill
6919
6920 % draw inner text
6921 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
6922 }
6923
6924
6925 %% variable amplifier
6926 \pgfcircdeclarebipole
6927 {}
6928 {
6929 \ifpgf@circuit@boxed
6930 \ctikzvalof{bipoles/twoport/width}
6931 \else
6932 \ctikzvalof{bipoles/amp/width}
6933 \fi
6934 }
6935 {vamp}
6936 {
6937 \ifpgf@circuit@boxed
6938 \ctikzvalof{bipoles/twoport/width}
6939 \else
6940 \ctikzvalof{bipoles/amp/width}
6941 \fi
6942 }
6943 {
6944 \ifpgf@circuit@boxed
6945 \ctikzvalof{bipoles/twoport/width}
6946 \else
6947 \ctikzvalof{bipoles/amp/width}
6948 \fi
6949 }
6950 {
6951 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen
6952
6953 \ifpgf@circuit@dashed
6954 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6955 \fi
6956
6957 % draw outer box
6958 \ifpgf@circuit@boxed
6959 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
6960 \fi
6961
6962 % draw input arrow
6963 \ifpgf@circuit@inputarrow
6964 {
6965 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6966 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6967 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6968 }
6969 \fi
6970
6971 \ifpgf@circuit@boxed
6972 \pgfsetlinewidth{\pgfstartlinewidth}
6973 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
6974 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
6975 \else
6976 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6977 \fi
6978
6979
6980 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6981 \pgfsetarrows{-} %never draw arrows
6982 \pgfsetlinewidth{\pgfstartlinewidth}
6983
6984 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
6985 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
6986 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
6987
6988 \pgfpathclose
6989 \pgf@circ@draworfill
6990
6991 % draw inner text
6992 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
6993
6994 % draw arrow
6995 \pgfsetlinewidth{\pgfstartlinewidth}
6996 \pgfsetarrowsend{latex}
6997 \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6998 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
6999 \pgfusepath{draw}
7000 }
7001
7002 %% pi attenuator
7003 \pgfcircdeclarebipole
7004 {}
7005 {\ctikzvalof{bipoles/piattenuator/width}}
7006 {piattenuator}
7007 {\ctikzvalof{bipoles/piattenuator/width}}
7008 {\ctikzvalof{bipoles/piattenuator/width}}
7009 {
7010 \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
7011 \divide \pgf@circ@res@step by 2
7012
7013 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7014 \pgf@circ@res@other = \pgf@circ@res@left
7015 \advance\pgf@circ@res@other by \pgf@circ@res@step
7016
7017 \ifpgf@circuit@dashed
7018 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7019 \fi
7020
7021 % draw outer box
7022 \pgf@circ@twoportbox
7023
7024 \ifpgf@circuit@inputarrow
7025 {
7026 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7027 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7028 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7029 }
7030 \fi
7031
7032 % rotate inner symbol
7033 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7034 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7035 \pgftransformrotate{270}
7036 \fi\fi
7037 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7038 \pgftransformrotate{90}
7039 \fi\fi
7040
7041 % draw inner symbol
7042 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7043 \pgfsetarrows{-} %never draw arrows
7044 \pgfsetlinewidth{\pgfstartlinewidth}
7045 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
7046 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7047 \pgfusepath{draw}
7048 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
7049 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7050 \pgfusepath{draw}
7051 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7052 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7053 \pgfusepath{draw}
7054 }
7055
7056 %% variable pi attenuator
7057 \pgfcircdeclarebipole
7058 {}
7059 {\ctikzvalof{bipoles/vpiattenuator/width}}
7060 {vpiattenuator}
7061 {\ctikzvalof{bipoles/vpiattenuator/width}}
7062 {\ctikzvalof{bipoles/vpiattenuator/width}}
7063 {
7064 \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
7065 \divide \pgf@circ@res@step by 2
7066
7067 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7068 \pgf@circ@res@other = \pgf@circ@res@left
7069 \advance\pgf@circ@res@other by \pgf@circ@res@step
7070
7071 \ifpgf@circuit@dashed
7072 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7073 \fi
7074
7075 % draw outer box
7076 \pgf@circ@twoportbox
7077
7078 \ifpgf@circuit@inputarrow
7079 {
7080 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7081 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7082 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7083 }
7084 \fi
7085
7086 % rotate inner symbol
7087 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7088 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7089 \pgftransformrotate{270}
7090 \fi\fi
7091 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7092 \pgftransformrotate{90}
7093 \fi\fi
7094
7095 % draw inner symbol
7096 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7097 \pgfsetarrows{-} %never draw arrows
7098 \pgfsetlinewidth{\pgfstartlinewidth}
7099 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
7100 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7101 \pgfusepath{draw}
7102 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
7103 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7104 \pgfusepath{draw}
7105 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7106 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7107 \pgfusepath{draw}
7108
7109 \pgfsetarrowsend{latex}
7110 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7111 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
7112 \pgfusepath{draw}
7113 }
7114
7115 %% T attenuator
7116 \pgfcircdeclarebipole
7117 {}
7118 {\ctikzvalof{bipoles/tattenuator/width}}
7119 {tattenuator}
7120 {\ctikzvalof{bipoles/tattenuator/width}}
7121 {\ctikzvalof{bipoles/tattenuator/width}}
7122 {
7123 \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
7124 \divide \pgf@circ@res@step by 2
7125
7126 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7127 \pgf@circ@res@other = \pgf@circ@res@left
7128 \advance\pgf@circ@res@other by \pgf@circ@res@step
7129
7130 \ifpgf@circuit@dashed
7131 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7132 \fi
7133
7134 % draw outer box
7135 \pgf@circ@twoportbox
7136
7137 \ifpgf@circuit@inputarrow
7138 {
7139 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7140 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7141 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7142 }
7143 \fi
7144
7145 % rotate inner symbol
7146 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7147 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7148 \pgftransformrotate{270}
7149 \fi\fi
7150 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7151 \pgftransformrotate{90}
7152 \fi\fi
7153
7154 % draw inner symbol
7155 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7156 \pgfsetarrows{-} %never draw arrows
7157 \pgfsetlinewidth{\pgfstartlinewidth}
7158 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
7159 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
7160 \pgfusepath{draw}
7161 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7162 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7163 \pgfusepath{draw}
7164 }
7165
7166 %% variable T attenuator
7167 \pgfcircdeclarebipole
7168 {}
7169 {\ctikzvalof{bipoles/vtattenuator/width}}
7170 {vtattenuator}
7171 {\ctikzvalof{bipoles/vtattenuator/width}}
7172 {\ctikzvalof{bipoles/vtattenuator/width}}
7173 {
7174 \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
7175 \divide \pgf@circ@res@step by 2
7176
7177 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7178 \pgf@circ@res@other = \pgf@circ@res@left
7179 \advance\pgf@circ@res@other by \pgf@circ@res@step
7180
7181 \ifpgf@circuit@dashed
7182 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7183 \fi
7184
7185 % draw outer box
7186 \pgf@circ@twoportbox
7187
7188 \ifpgf@circuit@inputarrow
7189 {
7190 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7191 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7192 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7193 }
7194 \fi
7195
7196 % rotate inner symbol
7197 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7198 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7199 \pgftransformrotate{270}
7200 \fi\fi
7201 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7202 \pgftransformrotate{90}
7203 \fi\fi
7204
7205 % draw inner symbol
7206 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7207 \pgfsetarrows{-} %never draw arrows
7208 \pgfsetlinewidth{\pgfstartlinewidth}
7209 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
7210 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
7211 \pgfusepath{draw}
7212 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7213 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7214 \pgfusepath{draw}
7215
7216 \pgfsetarrowsend{latex}
7217 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7218 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
7219 \pgfusepath{draw}
7220 }
7221
7222 %% phase shifter
7223 \pgfcircdeclarebipole
7224 {}
7225 {\ctikzvalof{bipoles/phaseshifter/width}}
7226 {phaseshifter}
7227 {\ctikzvalof{bipoles/phaseshifter/width}}
7228 {\ctikzvalof{bipoles/phaseshifter/width}}
7229 {
7230 \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
7231 \divide \pgf@circ@res@step by 2
7232
7233 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7234 \pgf@circ@res@other = \pgf@circ@res@left
7235 \advance\pgf@circ@res@other by \pgf@circ@res@step
7236
7237 \ifpgf@circuit@dashed
7238 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7239 \fi
7240
7241 % draw outer box
7242 \pgf@circ@twoportbox
7243
7244 \ifpgf@circuit@inputarrow
7245 {
7246 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7247 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7248 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7249 }
7250 \fi
7251
7252 % rotate inner symbol
7253 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7254 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7255 \pgftransformrotate{270}
7256 \fi\fi
7257 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7258 \pgftransformrotate{180}
7259 \fi\fi
7260 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7261 \pgftransformrotate{90}
7262 \fi\fi
7263
7264 % inner symbol
7265 \pgftext[center,x=0,y=0]{\Large$\varphi$}
7266 }
7267
7268 %% variable phase shifter
7269 \pgfcircdeclarebipole
7270 {}
7271 {\ctikzvalof{bipoles/phaseshifter/width}}
7272 {vphaseshifter}
7273 {\ctikzvalof{bipoles/vphaseshifter/width}}
7274 {\ctikzvalof{bipoles/vphaseshifter/width}}
7275 {
7276 \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
7277 \divide \pgf@circ@res@step by 2
7278
7279 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7280 \pgf@circ@res@other = \pgf@circ@res@left
7281 \advance\pgf@circ@res@other by \pgf@circ@res@step
7282
7283 \ifpgf@circuit@dashed
7284 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7285 \fi
7286
7287 % draw outer box
7288 \pgf@circ@twoportbox
7289
7290 \ifpgf@circuit@inputarrow
7291 {
7292 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7293 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7294 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7295 }
7296 \fi
7297
7298 % rotate inner symbol
7299 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7300 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7301 \pgftransformrotate{270}
7302 \fi\fi
7303 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7304 \pgftransformrotate{180}
7305 \fi\fi
7306 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7307 \pgftransformrotate{90}
7308 \fi\fi
7309
7310 % inner symbol
7311 \pgftext[center,x=0,y=0]{\Large$\varphi$}
7312
7313 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7314 \pgfsetlinewidth{\pgfstartlinewidth}
7315 \pgfsetarrowsend{latex}
7316 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
7317 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
7318 \pgfusepath{draw}
7319 }
7320
7321 %% detector
7322 \pgfcircdeclarebipole
7323 {}
7324 {\ctikzvalof{bipoles/detector/width}}
7325 {detector}
7326 {\ctikzvalof{bipoles/detector/width}}
7327 {\ctikzvalof{bipoles/detector/width}}
7328 {
7329 \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
7330 \divide \pgf@circ@res@step by 2
7331
7332 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7333 \pgf@circ@res@other = \pgf@circ@res@left
7334 \advance\pgf@circ@res@other by \pgf@circ@res@step
7335
7336 \ifpgf@circuit@dashed
7337 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7338 \fi
7339
7340 % draw outer box
7341 \pgf@circ@twoportbox
7342
7343 \ifpgf@circuit@inputarrow
7344 {
7345 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7346 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7347 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7348 }
7349 \fi
7350
7351 % draw inner stuff
7352 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7353 \pgfsetarrows{-} %never draw arrows
7354 \pgfsetlinewidth{0.8\pgfstartlinewidth}
7355 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
7356 \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
7357 \pgfusepath{draw}
7358
7359 \ifpgf@circuit@fulldiode
7360 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width}}
7361 \pgftransformscale{\pgfmathresult}
7362 \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
7363 \else
7364 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
7365 \pgftransformscale{\pgfmathresult}
7366 \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
7367 \fi
7368
7369 }
7370
7371
7372
7373
7374 %% european gas filled surge arrester
7375
7376 \pgfcircdeclarebipole
7377 {}
7378 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
7379 {european gas filled surge arrester}
7380 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
7381 {\ctikzvalof{bipoles/european gas filled surge arrester/width}}
7382 {
7383
7384 %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
7385 %\divide \pgf@circ@res@step by 14
7386
7387 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7388 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7389
7390 \pgf@circ@draworfill
7391
7392 \pgfscope
7393 \pgfsetarrowsend{latexslim}
7394 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7395 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
7396 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7397 \pgfusepath{draw}
7398
7399 \endpgfscope
7400 }
7401
7402
7403
7404
7405 %% american gas filled surge arrester
7406
7407 \pgfcircdeclarebipole
7408 {}
7409 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
7410 {american gas filled surge arrester}
7411 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
7412 {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
7413
7414 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7415 \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
7416 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7417 \pgfusepath{draw}
7418
7419 \pgfscope
7420 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7421 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
7422 \pgf@circ@draworfill
7423 \endpgfscope
7424
7425 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
7426 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7427 \pgfusepath{draw}
7428
7429 \pgfscope
7430 \pgfsetarrowsend{latex}
7431
7432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7433 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
7434 \pgfusepath{draw}
7435
7436 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7437 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
7438 \pgfusepath{draw}
7439 \endpgfscope{}
7440
7441 \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
7442 \pgfusepath{fill}
7443 }
7444
7445 % % MECHANICAL SYMBOLS
7446
7447 %% mechanical capacitance - stiffness/spring
7448
7449 \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spring/height}}{spring}{\ctikzvalof{bipoles/spring/height}}{\ctikzvalof{bipoles/spring/width}}{
7450 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7451 \pgftransformationadjustments
7452
7453 \pgfmathsetlength{\pgf@circ@res@step}
7454 {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
7455
7456 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
7457 \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
7458 \pgf@circ@res@other = \pgf@circ@res@left
7459 \advance\pgf@circ@res@other by \pgf@circ@res@step
7460 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7461 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7462 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7463 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7464 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7465 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7466 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7467 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7468 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7469 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7470 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7471 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7472 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7473 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7474 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7475 \advance\pgf@circ@res@other by \pgf@circ@res@step
7476 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7477 \pgfsetbuttcap
7478 \pgfsetbeveljoin
7479 \pgfusepath{stroke}
7480 }
7481
7482 %% mechanical inductance - mass
7483 \pgfcircdeclarebipole
7484 {}
7485 {\ctikzvalof{bipoles/mass/box height}}
7486 {mass}
7487 {\ctikzvalof{bipoles/mass/height}}
7488 {\ctikzvalof{bipoles/mass/width}}
7489 {
7490 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7491 \pgftransformationadjustments
7492 \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7493 {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
7494 \pgf@circ@draworfill
7495
7496 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7497 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7498 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7499 \pgfsetrectcap
7500 \pgfsetmiterjoin
7501 \pgfusepath{stroke}
7502 }
7503
7504 %% mechanical resistor - damper
7505 \pgfcircdeclarebipole
7506 {}
7507 {\ctikzvalof{bipoles/damper/height}}
7508 {damper}
7509 {\ctikzvalof{bipoles/damper/height}}
7510 {\ctikzvalof{bipoles/damper/width}}
7511 {
7512 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7513 \pgf@circ@maybefill
7514
7515 % line into the damper
7516 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7517 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7518 {\pgf@circ@res@zero}}
7519 \pgfusepath{stroke}
7520
7521 % damper box
7522 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7523 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7524 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7525 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7526 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7527
7528 \pgfsetrectcap
7529 \pgfsetmiterjoin
7530 \pgfusepath{stroke}
7531
7532 % damper vertical element
7533 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7534 {.8\pgf@circ@res@down}}
7535 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7536 {.8\pgf@circ@res@up}}
7537 \pgfsetbuttcap
7538 \pgfusepath{stroke}
7539
7540 }
7541 %% mechanical viscoelastic element, suggested by @alex
7542 %% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
7543 \pgfcircdeclarebipole
7544 {} % extra anchors
7545 {\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
7546 {viscoe} % name
7547 {\ctikzvalof{bipoles/damper/height}} % height (above the path line)
7548 {\ctikzvalof{bipoles/damper/width}} % width
7549 { % draw the bipole
7550 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7551 \pgf@circ@maybefill
7552
7553 % spring into the damper
7554 \pgfscope
7555 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7556 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7557 \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
7558 \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
7559 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
7560 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
7561 \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
7562 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
7563 \pgfusepath{stroke}
7564 \endpgfscope
7565 % damper box
7566 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7567 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7568 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7569 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7570 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7571
7572 \pgfsetrectcap
7573 \pgfsetmiterjoin
7574 \pgfusepath{stroke}
7575
7576 % damper vertical element
7577 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7578 {.8\pgf@circ@res@down}}
7579 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7580 {.8\pgf@circ@res@up}}
7581 \pgfsetbuttcap
7582 \pgfusepath{stroke}
7583
7584 }
7585
7586
7587 \pgfcircdeclarebipole
7588 {% anchor for labelling the type of dependency
7589 \anchor{label}{%
7590 \southwest
7591 \pgf@x=0.4\pgf@x
7592 }%
7593 }
7594 {\ctikzvalof{bipoles/resistivesens/height}}
7595 {resistivesens}
7596 {\ctikzvalof{bipoles/resistivesens/height}}
7597 {\ctikzvalof{bipoles/resistivesens/width}}
7598 {%
7599 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7600 \pgftransformationadjustments
7601 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
7602 \divide \pgf@circ@res@step by 12
7603
7604 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
7605
7606 \pgf@circ@res@other = \pgf@circ@res@left
7607 \advance\pgf@circ@res@other by \pgf@circ@res@step
7608 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7609 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7610 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7611 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7612 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7613 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7614 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7615 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7616 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7617 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7618 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7619 \advance\pgf@circ@res@other by \pgf@circ@res@step
7620 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7621 \pgfsetbeveljoin
7622 \pgfusepath{draw}
7623
7624 \pgfscope
7625 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
7626 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
7627 \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
7628 \pgfusepath{draw}
7629 \endpgfscope
7630 }
7631
7632 %% crossing bipole (but see also nodes)
7633 \pgfcircdeclarebipole
7634 {}
7635 {\ctikzvalof{bipoles/crossing/size}}
7636 {crossing}
7637 {\ctikzvalof{bipoles/crossing/size}}
7638 {\ctikzvalof{bipoles/crossing/size}}{
7639 \pgfscope
7640 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7641 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
7642 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
7643 \pgfsetbeveljoin
7644 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7645 \pgfusepath{draw}
7646 \endpgfscope
7647 }
7648
7649 %% loudspeaker and microphone
7650
7651 \pgfcircdeclarebipole
7652 {}
7653 {\ctikzvalof{bipoles/loudspeaker/depth}}
7654 {loudspeaker}
7655 {\ctikzvalof{bipoles/loudspeaker/height}}
7656 {\ctikzvalof{bipoles/loudspeaker/width}}{
7657
7658 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
7659 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7660 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
7661 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
7662 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
7663 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
7664 \pgfpathclose
7665 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
7666 \pgf@circ@draworfill
7667 }
7668
7669 \pgfcircdeclarebipole
7670 {}
7671 {\ctikzvalof{bipoles/mic/depth}}
7672 {mic}
7673 {\ctikzvalof{bipoles/mic/height}}
7674 {\ctikzvalof{bipoles/mic/width}}{
7675
7676 \pgfscope
7677 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
7678 \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
7679 \pgf@circ@draworfill
7680 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
7681 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
7682 \pgfusepath{draw}
7683 \endpgfscope
7684 \pgfscope
7685 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7686 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
7687 % 0.25358 is 0.6-0.4*cos(30)
7688 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
7689 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
7690 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
7691 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7692 \pgfusepath{draw}
7693
7694 \pgfusepath{draw}
7695 \endpgfscope
7696 }
7697
7698 % generic round meter with always horizontal text, no arrow
7699 \pgfcircdeclarebipole
7700 {}
7701 {\ctikzvalof{bipoles/esource/height}}
7702 {rmeter}
7703 {\ctikzvalof{bipoles/esource/height}}
7704 {\ctikzvalof{bipoles/esource/width}}
7705 {
7706 \pgfpointorigin
7707 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7708 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7709 \pgf@circ@draworfill
7710 % draw the text label
7711 % get the rotation
7712 \pgfgettransformentries\a\b\temp\temp\temp\temp
7713 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7714 % and unrotate the scope
7715 \pgfscope
7716 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
7717 \pgftransformrotate{\rot}
7718 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7719 \endpgfscope
7720 }
7721
7722 % generic round meter with always horizontal text, with arrow
7723 \pgfcircdeclarebipole
7724 {}
7725 {\ctikzvalof{bipoles/esource/height}}
7726 {rmeterwa}
7727 {\ctikzvalof{bipoles/esource/height}}
7728 {\ctikzvalof{bipoles/esource/width}}
7729 {
7730 \pgfpointorigin
7731 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7732 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7733 \pgf@circ@draworfill
7734 % draw the text label
7735 % get the rotation
7736 \pgfgettransformentries\a\b\temp\temp\temp\temp
7737 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7738 % and unrotate the scope
7739 \pgfscope
7740 \pgftransformrotate{\rot}
7741 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
7742 \pgfsetlinewidth{\pgfstartlinewidth}
7743 % arrow: create a center hole to have better visual
7744 \pgfscope
7745 % clipping path: first a rectangle bigger then the shape
7746 % to avoid problems with the line thickness
7747 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7748 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7749 % next open a circle into it
7750 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
7751 % do the difference and clip before drawing
7752 \pgfseteorule
7753 \pgfusepath{clip}
7754 \pgfsetarrowsend{latexslim}
7755 % the arrow is better if it has a bit of breath and it's not 45º
7756 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
7757 \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
7758 \pgfusepath{draw}
7759 \endpgfscope
7760 \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
7761 \endpgfscope
7762 }
7763
7764 % generic square meter with always horizontal text
7765 \pgfcircdeclarebipole
7766 {
7767 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
7768 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
7769 % put the node text above and centered
7770 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7771 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7772 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7773 }
7774 }
7775 }
7776 {\ctikzvalof{bipoles/smeter/height}}
7777 {smeter}
7778 {\ctikzvalof{bipoles/smeter/height}}
7779 {\ctikzvalof{bipoles/smeter/width}}
7780 {
7781 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7782 \pgfextracty{\pgf@circ@res@up}{\northeast}
7783 \pgfextractx{\pgf@circ@res@right}{\northeast}
7784 \pgfextractx{\pgf@circ@res@left}{\southwest}
7785 \pgfextracty{\pgf@circ@res@down}{\southwest}
7786 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7787 \pgfscope
7788 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7789 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7790 \pgf@circ@draworfill
7791 \endpgfscope
7792 % get the rotation
7793 \pgfgettransformentries\a\b\temp\temp\temp\temp
7794 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7795 % and unrotate the scope
7796 \pgfscope
7797 \pgftransformrotate{\rot}
7798 % the metering window
7799 \pgfscope
7800 \def\@starta{105}\def\@stopa{75}
7801 \pgfsetlinewidth{\pgfstartlinewidth}
7802 \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
7803 \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
7804 \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
7805 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7806 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7807 \pgfclosepath
7808 \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
7809 \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
7810 \pgfusepath{draw}
7811 \endpgfscope
7812 \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
7813 \endpgfscope
7814 }
7815
7816 % probles qucs style:
7817 % #1 : name
7818 % #2 : extra code
7819 \long\def\pgfcirc@qucsprobe#1#2{
7820 \pgfcircdeclarebipole
7821 {
7822 \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
7823 \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
7824 % put the node text above and centered
7825 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7826 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7827 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7828 }
7829 }
7830 }
7831 {\ctikzvalof{bipoles/qmeter/depth}}
7832 {#1}
7833 {\ctikzvalof{bipoles/qmeter/height}}
7834 {\ctikzvalof{bipoles/qmeter/width}}
7835 {
7836 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7837 \pgfextracty{\pgf@circ@res@up}{\northeast}
7838 \pgfextractx{\pgf@circ@res@right}{\northeast}
7839 \pgfextractx{\pgf@circ@res@left}{\southwest}
7840 \pgfextracty{\pgf@circ@res@down}{\southwest}
7841 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7842 \pgfscope
7843 \pgfscope
7844 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7845 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7846 \pgf@circ@draworfill
7847 \endpgfscope
7848 \def\@starta{103}\def\@stopa{77}
7849 \pgfsetlinewidth{\pgfstartlinewidth}
7850 \pgfscope
7851 \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
7852 \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
7853 \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
7854 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7855 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7856 \pgfclosepath
7857 \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
7858 \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
7859 \pgfusepath{draw}
7860 \pgf@circ@draworfill
7861 \endpgfscope
7862 #2
7863 \endpgfscope
7864 }
7865 }
7866
7867 \pgfcirc@qucsprobe{qiprobe}{
7868 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7869 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7870 \pgfusepath{draw}
7871 \pgfnode{currarrow}{center}{}{}{}
7872 }
7873
7874 \pgfcirc@qucsprobe{qvprobe}{
7875 \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
7876 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7877 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
7878 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7879 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
7880 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7881 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7882 \pgfusepath{draw}
7883 \pgfscope
7884 % "+" and "-", drawn so that they scale correctly
7885 \pgfsetlinewidth{2\pgfstartlinewidth}
7886 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
7887 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
7888 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7889 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7890 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7891 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7892 \pgfusepath{draw}
7893 \endpgfscope
7894 }
7895
7896 \pgfcirc@qucsprobe{qpprobe}{
7897 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7898 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7899 \pgfusepath{draw}
7900 \pgfnode{currarrow}{center}{}{}{}
7901 \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
7902 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7903 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
7904 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
7905 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7906 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
7907 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
7908 \pgfusepath{draw}
7909 \pgfscope
7910 % "+" and "-", drawn so that they scale correctly
7911 \pgfsetlinewidth{2\pgfstartlinewidth}
7912 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
7913 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
7914 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7915 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7916 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7917 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7918 \pgfusepath{draw}
7919 \endpgfscope
7920 }
7921
7922
7923 % current loop for oscope and similar: stylized
7924
7925 \pgfcircdeclarebipole
7926 {
7927 \anchor{i}{\northeast\pgf@x=0pt\relax}
7928 \anchor{text}{
7929 \pgfextracty{\pgf@circ@res@up}{\northeast}
7930 \pgfextractx{\pgf@circ@res@left}{\northeast}
7931 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7932 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7933 }
7934 }
7935 }
7936 {\ctikzvalof{bipoles/iloop/height}}
7937 {iloop}
7938 {\ctikzvalof{bipoles/iloop/height}}
7939 {\ctikzvalof{bipoles/iloop/width}}
7940 {
7941 \pgfextracty{\pgf@circ@res@up}{\northeast}
7942 \pgfextractx{\pgf@circ@res@right}{\northeast}
7943 \pgf@circ@res@down=-\pgf@circ@res@up
7944 \pgf@circ@res@left=-\pgf@circ@res@right
7945 \pgfscope
7946 \pgfstartlinewidth=\pgflinewidth
7947 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
7948 % external ellipse
7949 \pgfscope
7950 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
7951 % clipping path: first a rectangle bigger then the shape
7952 % to avoid problems with the line thickness
7953 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7954 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7955 % next the opening to the left
7956 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7957 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7958 % do the difference and clip before drawing
7959 \pgfseteorule
7960 \pgfusepath{clip}
7961 \pgfpathellipse{\pgfpointorigin}{
7962 \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
7963 \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
7964 \pgfusepath{draw}
7965 \endpgfscope
7966 % internal wire
7967 \pgfsetlinewidth{\pgfstartlinewidth}
7968 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7969 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7970 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7971 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7972 % and the contact line up
7973 \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
7974 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
7975 \pgfusepath{draw}
7976 \endpgfscope
7977 }
7978
7979
7980 % current loop for oscope and similar: real (double connection)
7981
7982 \pgfcircdeclarebipole
7983 {
7984 \anchor{i+}{
7985 \pgfextracty{\pgf@circ@res@up}{\northeast}
7986 \pgfextractx{\pgf@circ@res@right}{\northeast}
7987 \pgf@circ@res@step=0.4\pgf@circ@res@right
7988 \pgf@circ@res@other=0.8\pgf@circ@res@up
7989 \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
7990 \pgf@y=\pgf@circ@res@up
7991 }
7992 \anchor{i-}{
7993 \pgfextracty{\pgf@circ@res@up}{\northeast}
7994 \pgfextractx{\pgf@circ@res@right}{\northeast}
7995 \pgf@circ@res@step=0.4\pgf@circ@res@right
7996 \pgf@circ@res@other=0.8\pgf@circ@res@up
7997 \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
7998 \pgf@y=\pgf@circ@res@up
7999 }
8000 \anchor{text}{
8001 \pgfextracty{\pgf@circ@res@up}{\northeast}
8002 \pgfextractx{\pgf@circ@res@left}{\northeast}
8003 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
8004 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
8005 }
8006 }
8007 }
8008 {\ctikzvalof{bipoles/iloop/height}}
8009 {iloop2}
8010 {\ctikzvalof{bipoles/iloop/height}}
8011 {\ctikzvalof{bipoles/iloop/width}}
8012 {
8013 \pgfextracty{\pgf@circ@res@up}{\northeast}
8014 \pgfextractx{\pgf@circ@res@right}{\northeast}
8015 \pgf@circ@res@down=-\pgf@circ@res@up
8016 \pgf@circ@res@left=-\pgf@circ@res@right
8017 % must be the same than internal i+ and i- anchors definition
8018 \pgf@circ@res@step=0.4\pgf@circ@res@right
8019 \pgf@circ@res@other=0.8\pgf@circ@res@up
8020 \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
8021 \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
8022 \pgfscope
8023 \pgfstartlinewidth=\pgflinewidth
8024 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8025 % external ellipse
8026 \pgfscope
8027 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
8028 % clipping path: first a rectangle bigger then the shape
8029 % to avoid problems with the line thickness
8030 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
8031 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
8032 % next the opening to the left
8033 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
8034 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
8035 % do the difference and clip before drawing
8036 \pgfseteorule
8037 \pgfusepath{clip}
8038 \pgfpathmoveto{\@plus}
8039 \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
8040 \pgfusepath{draw}
8041 \endpgfscope
8042 % internal wire
8043 \pgfsetlinewidth{\pgfstartlinewidth}
8044 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8045 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
8046 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
8047 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8048 % and the contact line up
8049 % I use ...left and ---right as temporal lengths here to avoid defining more
8050 \pgfextractx{\pgf@circ@res@left}{\@plus}
8051 \pgfextractx{\pgf@circ@res@right}{\@minus}
8052 \pgfpathmoveto{\@plus}
8053 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8054 \pgfpathmoveto{\@minus}
8055 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8056 \pgfusepath{draw}
8057 \endpgfscope
8058 }
8059
8060
8061 % end of pgfcircbipoles.tex
8062 %%%---------- close: tex/pgfcircbipoles
8063 %%%%%%%%%%% Springe nach tex/pgfcirctripoles
8064 %%%---------- open: tex/pgfcirctripoles.tex
8065 % Copyright 2007-2009 by Massimo Redaelli
8066 %
8067 % This file may be distributed and/or modified
8068 %
8069 % 1. under the LaTeX Project Public License and/or
8070 % 2. under the GNU Public License.
8071 %
8072 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
8073
8074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8075 %% Tripoles
8076
8077 \pgfdeclareshape{spdt}{
8078 \savedanchor\northwest{%
8079 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@circ@Rlen
8080 \pgf@y=.5\pgf@y
8081 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
8082 \pgf@x=.5\pgf@x
8083 }
8084 \anchor{left}{%
8085 \northwest
8086 \pgf@y=0pt
8087 }
8088 \anchor{in}{
8089 \northwest
8090 \pgf@y=0pt
8091 }
8092 \anchor{out 1}{
8093 \northwest
8094 \pgf@x=-\pgf@x
8095 }
8096 \anchor{out 2}{
8097 \northwest
8098 \pgf@x=-\pgf@x
8099 \pgf@y=-\pgf@y
8100 }
8101 \anchor{center}{
8102 \pgf@y=0pt
8103 \pgf@x=0pt
8104 }
8105 \anchor{east}{
8106 \northwest
8107 \pgf@y=0pt
8108 \pgf@x=-\pgf@x
8109 }
8110 \anchor{west}{
8111 \northwest
8112 \pgf@y=0pt
8113 }
8114 \anchor{south}{
8115 \northwest
8116 \pgf@x=0pt
8117 \pgf@y=-\pgf@y
8118 }
8119 \anchor{north}{
8120 \northwest
8121 \pgf@x=0pt
8122 }
8123 \anchor{south west}{
8124 \northwest
8125 \pgf@y=-\pgf@y
8126 }
8127 \anchor{north east}{
8128 \northwest
8129 \pgf@x=-\pgf@x
8130 }
8131 \anchor{north west}{
8132 \northwest
8133 }
8134 \anchor{south east}{
8135 \northwest
8136 \pgf@x=-\pgf@x
8137 \pgf@y=-\pgf@y
8138 }
8139 \backgroundpath{
8140 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8141
8142
8143 \northwest
8144 \pgf@circ@res@up = \pgf@y
8145 \pgf@circ@res@down = -\pgf@y
8146 \pgf@circ@res@right = -\pgf@x
8147 \pgf@circ@res@left = \pgf@x
8148 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
8149
8150
8151 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8152 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8153 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8154 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8155
8156 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8157 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8158
8159 \pgfusepath{draw}
8160
8161 \pgfscope
8162 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8163 \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
8164 \endpgfscope
8165 \pgfscope
8166 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8167 \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
8168 \endpgfscope
8169 \pgfscope
8170 \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
8171 \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
8172 \endpgfscope
8173
8174
8175 \pgfscope
8176 \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
8177 \pgfpathlineto{
8178 \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
8179 {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
8180 }
8181 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8182 \pgfusepath{draw}
8183 \endpgfscope
8184 }
8185 }
8186
8187
8188 % cute switch "node" shapes, matching with cute "to" shapes
8189 % #1 -> name
8190 % #2 -> barposition
8191 % #3 -> arrowcode
8192 \long\def\pgfcircdeclarecutespdt#1#2#3{
8193 \pgfdeclareshape{#1}
8194 {
8195 \savedanchor\northwest{%
8196 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
8197 \pgf@y=.5\pgf@y
8198 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
8199 \pgf@x=.25\pgf@x
8200 }
8201 \savedanchor\midlever{
8202 % these values are calculated when we create the definition of the shape.
8203 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
8204 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
8205 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8206 \pgf@circ@res@down = -.5\pgf@y
8207 \pgf@circ@res@up = .5\pgf@y
8208 \pgfextracty{\pgf@circ@res@other}{#2}
8209 \pgf@x=0pt
8210 \pgf@y=.5\pgf@circ@res@other
8211 }
8212 % radius of the connector
8213 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8214 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
8215 % shapename
8216 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
8217 % shape type
8218 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
8219 % mid of the lever, to stack switches
8220 \anchor{mid}{\midlever}
8221 % center anchors
8222 \anchor{cin}{ \northwest \pgf@y=0pt}
8223 \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
8224 \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8225 % horizontal angles
8226 \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
8227 \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
8228 \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
8229
8230 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
8231 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
8232 \anchor{west}{ \northwest \pgf@y=0pt }
8233 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
8234 \anchor{north}{ \northwest \pgf@x=0pt }
8235 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
8236 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
8237 \anchor{north west}{ \northwest }
8238 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8239
8240 \backgroundpath{
8241 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8242 \northwest
8243 \pgf@circ@res@up = \pgf@y
8244 \pgf@circ@res@down = -\pgf@y
8245 \pgf@circ@res@right = -\pgf@x
8246 \pgf@circ@res@left = \pgf@x
8247
8248 \pgfscope
8249 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8250 \pgf@circ@res@temp=\radius\relax
8251 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8252 \pgfsetlinewidth{2\pgf@circ@res@temp}
8253 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8254 \pgfpathlineto{#2}
8255 \pgfsetroundcap\pgfusepath{draw}
8256 \endpgfscope
8257 \pgfscope % arrow
8258 #3
8259 \endpgfscope
8260 % terminals
8261 \pgfscope
8262 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8263 \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
8264 \endpgfscope
8265 \pgfscope
8266 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8267 \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
8268 \endpgfscope
8269 \pgfscope
8270 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8271 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
8272 \endpgfscope
8273
8274 }
8275 }
8276 }
8277
8278 \pgfcircdeclarecutespdt{cute spdt up}
8279 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8280 {}
8281
8282 \pgfcircdeclarecutespdt{cute spdt mid}
8283 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8284 {}
8285
8286 \pgfcircdeclarecutespdt{cute spdt down}
8287 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
8288 {}
8289
8290 \pgfcircdeclarecutespdt{cute spdt up arrow}
8291 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8292 {
8293 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8294 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8295 \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
8296 \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
8297 \pgfsetarrowsend{latexslim}
8298 \pgfusepath{draw}
8299 }
8300
8301 \pgfcircdeclarecutespdt{cute spdt mid arrow}
8302 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8303 {
8304 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8305 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8306 \pgfsetarrowsstart{latexslim}
8307 \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
8308 \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
8309 \pgfsetarrowsend{latexslim}
8310 \pgfusepath{draw}
8311 }
8312
8313 \pgfcircdeclarecutespdt{cute spdt down arrow}
8314 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
8315 {
8316 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8317 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8318 \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
8319 \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
8320 \pgfsetarrowsend{latexslim}
8321 \pgfusepath{draw}
8322 }
8323
8324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8325 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8326 %%
8327 %% Logic ports
8328 %%
8329 %% Code from John Kormylo at tex.stackexchange.com
8330 %% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
8331 %% Integration and fixes from Romano Giannetti and TheTeXnician <[email protected]>
8332 %%
8333
8334 \newcount\pgf@circ@res@count% reserve global register
8335
8336 \def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
8337 {%
8338 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8339 \step
8340 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8341 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8342 }%
8343
8344 % #1 = \pgfmathcounter #2=type #3 specificic port
8345 % type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
8346 \def\pgf@circ@logicport@baseinput#1#2#3%
8347 {%
8348 % and and nand
8349 \ifnum #2=1\relax
8350 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8351 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8352 \step
8353 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8354 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8355 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@left
8356 \fi
8357 % or and nor
8358 \ifnum #2=2\relax
8359 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8360 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8361 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8362 \step
8363 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8364 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8365 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/angle}}%
8366 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
8367 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8368 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8369 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
8370 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8371 \pgf@circ@res@temp=\pgf@y
8372 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8373 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8374 \pgf@x=\pgf@circ@res@other
8375 \fi
8376 % xor and xnor
8377 \ifnum #2=3\relax
8378 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8379 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8380 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8381 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
8382 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
8383 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8384 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
8385 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
8386 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8387 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/distance}\pgf@circ@res@right
8388 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
8389 % this compensates for the effect of the line width on the gap between the arcs
8390 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
8391 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
8392
8393 \step
8394 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8395 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8396 \pgf@circ@res@temp=\pgf@y
8397 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
8398 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8399 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
8400 \pgf@x=\pgf@circ@res@other
8401 \fi
8402 % european
8403 \ifnum #2=4\relax
8404 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8405 \pgfextractx{\pgf@circ@res@other}{\left}%
8406 \step
8407 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8408 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8409 \pgf@x=\pgf@circ@res@other
8410 \fi
8411 }%
8412
8413 %%% american
8414 \long\def\pgfcircdeclarelogicport#1#2#3{%
8415 \pgfdeclareshape{american #1 port}%
8416 {%
8417 \savedmacro\resize{% automatic
8418 \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
8419 \pgf@circ@res@up = .5\pgf@circ@res@up
8420 \pgf@circ@res@down = -\pgf@circ@res@up
8421 \pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@circ@Rlen
8422 \pgf@circ@res@right = .5\pgf@circ@res@right
8423 \pgf@circ@res@left = -\pgf@circ@res@right
8424 }%
8425 \savedmacro\inputs{% get number of inputs
8426 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
8427 \ifnum\pgf@circ@res@count=0
8428 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/inputs}\relax%
8429 \fi
8430 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
8431 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
8432 \def\inputs{\the\pgf@circ@res@count}%
8433 }%
8434 \savedanchor\step{% 1/2 gap at edges
8435 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
8436 \divide\pgf@circ@res@step by \pgf@circ@res@count
8437 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
8438 }%
8439 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8440 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8441 \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
8442 \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
8443 \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
8444
8445 \anchor{center}{\origin}% for backwards compatibility
8446 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
8447
8448 % create input anchors
8449 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
8450 \pgfmathloop%
8451 \ifnum\pgfmathcounter>\pgf@circ@res@count%
8452 \else%
8453 %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
8454 \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
8455 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
8456 }%
8457 \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
8458 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
8459 }%
8460 %}{}%
8461 \repeatpgfmathloop%
8462 }
8463
8464 \anchor{out}{\northeast\pgf@y=0pt}
8465 \anchor{bout}{\right\pgf@y=0pt}
8466
8467
8468 \anchor{left}{\left}% edges of component mius leads
8469 \anchor{right}{\right}
8470
8471 \anchor{north east}{\northeast}% see \Compass macro
8472 \anchor{south west}{\southwest}
8473 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
8474 \pgfpoint{0cm}{\pgf@circ@res@up}}
8475 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
8476 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8477 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8478 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
8479 \pgfpoint{\pgf@circ@res@left}{0cm}}
8480 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
8481 \pgfpoint{0cm}{\pgf@circ@res@down}}
8482 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
8483 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8484 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8485 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
8486 \pgfpoint{\pgf@circ@res@right}{0cm}}
8487
8488 \backgroundpath{
8489 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8490 #3
8491 }
8492 }
8493 }
8494 %%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8495 \pgfcircdeclarelogicport{and}{1}{
8496 \pgfextracty{\pgf@circ@res@temp}{\step}%
8497 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8498 \pgf@circ@res@count = \inputs\relax
8499 \loop\ifnum\pgf@circ@res@count>0
8500 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8501 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8502 \pgfpathlineto{\pgfpoint
8503 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
8504 {\pgf@circ@res@temp}}
8505 \advance\pgf@circ@res@count by -1
8506 \repeat
8507
8508 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8509 \pgfpathlineto{\pgfpoint
8510 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
8511 {0pt}}
8512
8513 \pgfusepath{draw}
8514
8515 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8516 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left
8517
8518 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8519 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8520 \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
8521 \pgfpathclose
8522 \pgf@circ@draworfill
8523 }
8524 %%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8525 \pgfcircdeclarelogicport{nand}{1}{
8526 \pgfextracty{\pgf@circ@res@temp}{\step}%
8527 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8528 \pgf@circ@res@count = \inputs\relax
8529 \loop\ifnum\pgf@circ@res@count>0
8530 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8531 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8532 \pgfpathlineto{\pgfpoint
8533 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
8534 {\pgf@circ@res@temp}}
8535 \advance\pgf@circ@res@count by -1
8536 \repeat
8537
8538 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8539 \pgfpathlineto{\pgfpoint
8540 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
8541
8542 \pgfusepath{draw}
8543
8544 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8545 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
8546 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
8547 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
8548
8549 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8550 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8551 \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
8552 \pgfpathclose
8553
8554 \pgfpathellipse
8555 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@step}{0pt}}
8556 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
8557 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
8558
8559 \pgf@circ@draworfill
8560 }
8561 %%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8562 \pgfcircdeclarelogicport{nor}{2}{
8563 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
8564 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/inner}\pgf@circ@res@right
8565 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8566 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8567 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
8568 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8569
8570 \pgfextracty{\pgf@circ@res@temp}{\step}%
8571 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8572 \pgf@circ@res@count = \inputs\relax
8573 \loop\ifnum\pgf@circ@res@count>0
8574 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8575 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8576 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8577 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8578 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8579 \advance\pgf@circ@res@count by -1
8580 \repeat
8581
8582 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
8583 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8584 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8585
8586 \pgfusepath{draw}
8587
8588 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8589
8590 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
8591 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/circle width}\pgf@circ@res@right
8592 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
8593 \advance\pgf@circ@res@other by -\pgf@circ@res@step
8594
8595 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8596 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8597 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8598 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8599 \pgfpathclose
8600
8601 \pgfpathellipse
8602 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
8603 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
8604 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
8605
8606 \pgf@circ@draworfill
8607 }
8608 %%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8609 \pgfcircdeclarelogicport{or}{2}{
8610 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
8611 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/inner}\pgf@circ@res@right
8612 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8613 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8614 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
8615 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8616
8617 \pgfextracty{\pgf@circ@res@temp}{\step}%
8618 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8619 \pgf@circ@res@count = \inputs\relax
8620 \loop\ifnum\pgf@circ@res@count>0
8621 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8622 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8623 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8624 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8625 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8626 \advance\pgf@circ@res@count by -1
8627 \repeat
8628
8629 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
8630 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8631 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8632
8633 \pgfusepath{draw}
8634
8635 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8636
8637 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
8638
8639 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8640 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8641 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8642 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8643 \pgfpathclose
8644
8645 \pgf@circ@draworfill
8646 }
8647 %%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8648 \pgfcircdeclarelogicport{xor}{3}{
8649 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
8650 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/inner}\pgf@circ@res@right
8651 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8652 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
8653 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
8654 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8655 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
8656 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
8657 % this compensates for the effect of the line width on the gap between the arcs
8658 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
8659 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
8660
8661 \pgfextracty{\pgf@circ@res@temp}{\step}%
8662 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8663 \pgf@circ@res@count = \inputs\relax
8664 \loop\ifnum\pgf@circ@res@count>0
8665 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8666 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8667 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
8668 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8669 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
8670 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8671 \advance\pgf@circ@res@count by -1
8672 \repeat
8673
8674 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
8675 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8676 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8677
8678 \pgfusepath{draw}
8679
8680 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8681
8682 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/angle}}%
8683
8684 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8685 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8686 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8687 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8688 \pgfpathclose
8689 \pgf@circ@draworfill
8690
8691 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
8692
8693 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
8694 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
8695
8696 \pgfusepath{draw}
8697 }
8698 %%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8699 \pgfcircdeclarelogicport{xnor}{3}{
8700 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
8701 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/inner}\pgf@circ@res@right
8702 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8703 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
8704 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
8705 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8706 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
8707 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
8708 % this compensates for the effect of the line width on the gap between the arcs
8709 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
8710 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
8711
8712 \pgfextracty{\pgf@circ@res@temp}{\step}%
8713 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8714 \pgf@circ@res@count = \inputs\relax
8715 \loop\ifnum\pgf@circ@res@count>0
8716 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8717 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8718 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
8719 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8720 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
8721 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8722 \advance\pgf@circ@res@count by -1
8723 \repeat
8724
8725 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
8726 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8727 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8728
8729 \pgfusepath{draw}
8730
8731 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8732
8733 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/angle}}%
8734 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
8735 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
8736 \advance\pgf@circ@res@other by -\pgf@circ@res@step
8737
8738 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8739 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8740 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8741 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8742 \pgfpathclose
8743
8744 \pgfpathellipse
8745 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
8746 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
8747 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
8748 \pgf@circ@draworfill
8749
8750 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@left
8751 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
8752
8753 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
8754 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
8755
8756 \pgfusepath{draw}
8757 }
8758
8759 %%% Original one-input ports
8760
8761 \pgfdeclareshape{american not port}{
8762 \anchor{center}{\pgfpointorigin}
8763 \savedanchor\northwest{%
8764 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
8765 \pgf@y=.5\pgf@y
8766 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
8767 \pgf@x=.5\pgf@x
8768 }
8769 \savedanchor\left{%
8770 \pgf@y=0pt
8771 }
8772 \anchor{in}{
8773 \northwest
8774 \pgf@y=0pt
8775 }
8776 \anchor{out}{
8777 \northwest
8778 \pgf@y=0pt
8779 \pgf@x=-\pgf@x
8780 }
8781 \anchor{center}{
8782 \pgfpointorigin
8783 }
8784 \anchor{east}{
8785 \left
8786 \pgf@x=-.8\pgf@x
8787 }
8788 \anchor{west}{
8789 \left
8790 }
8791 \anchor{south}{
8792 \northwest
8793 \pgf@x=0pt
8794 \pgf@y=-\pgf@y
8795 }
8796 \anchor{north}{
8797 \northwest
8798 \pgf@x=0pt
8799 }
8800 \anchor{south west}{
8801 \northwest
8802 \pgf@y=-\pgf@y
8803 }
8804 \anchor{north east}{
8805 \northwest
8806 \pgf@x=-\pgf@x
8807 }
8808 \anchor{north west}{
8809 \northwest
8810 }
8811 \anchor{south east}{
8812 \northwest
8813 \pgf@x=-\pgf@x
8814 \pgf@y=-\pgf@y
8815 }
8816 \backgroundpath{
8817 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8818
8819
8820 \northwest
8821 \pgf@circ@res@up = \pgf@y
8822 \pgf@circ@res@down = -\pgf@y
8823 \pgf@circ@res@right = -\pgf@x
8824 \pgf@circ@res@left = \pgf@x
8825
8826 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
8827
8828 \pgfscope
8829 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8830 \pgftransformxshift{.7\pgf@circ@res@left}
8831 \pgf@circ@res@step=\pgf@circ@res@right
8832 \advance\pgf@circ@res@step by -\pgf@circ@res@left
8833 \pgf@circ@res@step=.7\pgf@circ@res@step
8834
8835 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
8836 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
8837 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
8838 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
8839 \pgf@circ@draworfill
8840 \pgfpathellipse
8841 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
8842 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
8843 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
8844 \pgf@circ@draworfill
8845 \endpgfscope
8846
8847 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8848 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
8849
8850 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8851 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
8852
8853 \pgfusepath{draw}
8854
8855 }
8856 }
8857
8858 \pgfdeclareshape{invschmitt}{
8859 \anchor{center}{\pgfpointorigin}
8860 \savedanchor\northwest{%
8861 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
8862 \pgf@y=.5\pgf@y
8863 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
8864 \pgf@x=.5\pgf@x
8865 }
8866 \savedanchor\left{%
8867 \pgf@y=0pt
8868 }
8869 \anchor{in}{
8870 \northwest
8871 \pgf@y=0pt
8872 }
8873 \anchor{out}{
8874 \northwest
8875 \pgf@y=0pt
8876 \pgf@x=-\pgf@x
8877 }
8878 \anchor{center}{
8879 \pgfpointorigin
8880 }
8881 \anchor{east}{
8882 \left
8883 \pgf@x=-.8\pgf@x
8884 }
8885 \anchor{west}{
8886 \left
8887 }
8888 \anchor{south}{
8889 \northwest
8890 \pgf@x=0pt
8891 \pgf@y=-\pgf@y
8892 }
8893 \anchor{north}{
8894 \northwest
8895 \pgf@x=0pt
8896 }
8897 \anchor{south west}{
8898 \northwest
8899 \pgf@y=-\pgf@y
8900 }
8901 \anchor{north east}{
8902 \northwest
8903 \pgf@x=-\pgf@x
8904 }
8905 \anchor{north west}{
8906 \northwest
8907 }
8908 \anchor{south east}{
8909 \northwest
8910 \pgf@x=-\pgf@x
8911 \pgf@y=-\pgf@y
8912 }
8913 \backgroundpath{
8914 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8915
8916 \northwest
8917 \pgf@circ@res@up = \pgf@y
8918 \pgf@circ@res@down = -\pgf@y
8919 \pgf@circ@res@right = -\pgf@x
8920 \pgf@circ@res@left = \pgf@x
8921
8922 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
8923
8924 \pgfscope
8925 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8926 \pgftransformxshift{.7\pgf@circ@res@left}
8927 \pgf@circ@res@step=\pgf@circ@res@right
8928 \advance\pgf@circ@res@step by -\pgf@circ@res@left
8929 \pgf@circ@res@step=.7\pgf@circ@res@step
8930
8931 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
8932 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
8933 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
8934 \pgfpathclose
8935 \pgf@circ@draworfill
8936 \pgfpathellipse
8937 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
8938 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
8939 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
8940 \pgf@circ@draworfill
8941 \endpgfscope
8942
8943 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8944 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
8945
8946 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8947 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
8948 \pgfusepath{draw}
8949 %draw inner shape
8950
8951 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8952
8953 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
8954 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
8955 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
8956 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
8957 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
8958 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
8959 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
8960 \pgfusepath{draw}
8961
8962 }
8963 }
8964
8965 \pgfdeclareshape{schmitt}{
8966 \anchor{center}{\pgfpointorigin}
8967 \savedanchor\northwest{%
8968 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
8969 \pgf@y=.5\pgf@y
8970 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
8971 \pgf@x=.5\pgf@x
8972 }
8973 \savedanchor\left{%
8974 \pgf@y=0pt
8975 }
8976 \anchor{in}{
8977 \northwest
8978 \pgf@y=0pt
8979 }
8980 \anchor{out}{
8981 \northwest
8982 \pgf@y=0pt
8983 \pgf@x=-\pgf@x
8984 }
8985 \anchor{center}{
8986 \pgfpointorigin
8987 }
8988 \anchor{east}{
8989 \left
8990 \pgf@x=-.8\pgf@x
8991 }
8992 \anchor{west}{
8993 \left
8994 }
8995 \anchor{south}{
8996 \northwest
8997 \pgf@x=0pt
8998 \pgf@y=-\pgf@y
8999 }
9000 \anchor{north}{
9001 \northwest
9002 \pgf@x=0pt
9003 }
9004 \anchor{south west}{
9005 \northwest
9006 \pgf@y=-\pgf@y
9007 }
9008 \anchor{north east}{
9009 \northwest
9010 \pgf@x=-\pgf@x
9011 }
9012 \anchor{north west}{
9013 \northwest
9014 }
9015 \anchor{south east}{
9016 \northwest
9017 \pgf@x=-\pgf@x
9018 \pgf@y=-\pgf@y
9019 }
9020 \backgroundpath{
9021 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9022
9023
9024 \northwest
9025 \pgf@circ@res@up = \pgf@y
9026 \pgf@circ@res@down = -\pgf@y
9027 \pgf@circ@res@right = -\pgf@x
9028 \pgf@circ@res@left = \pgf@x
9029
9030 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
9031
9032 \pgfscope
9033 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9034 \pgftransformxshift{.7\pgf@circ@res@left}
9035 \pgf@circ@res@step=\pgf@circ@res@right
9036 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9037 \pgf@circ@res@step=.7\pgf@circ@res@step
9038
9039 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9040 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9041 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9042 \pgfpathclose
9043 \pgf@circ@draworfill
9044 \endpgfscope
9045
9046 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9047 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9048
9049 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9050 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
9051 \pgfusepath{draw}
9052 %draw inner shape
9053
9054 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9055
9056 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9057 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9058 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9059 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9060 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9061 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9062 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9063 \pgfusepath{draw}
9064
9065 }
9066 }
9067
9068
9069 %%% start european logic ports, from John Kormylo
9070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9071 %%
9072
9073 % #1 - name
9074 % #2 - text inside
9075 % #3 - number of inputs
9076 % #4 = is it a not?
9077
9078 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
9079 \pgfdeclareshape{european #1 port}
9080 {
9081 \savedmacro\resize{% automatic
9082 \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
9083 \pgf@circ@res@up = .5\pgf@circ@res@up
9084 \pgf@circ@res@down = -\pgf@circ@res@up
9085 \pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@circ@Rlen
9086 \pgf@circ@res@right = .5\pgf@circ@res@right
9087 \pgf@circ@res@left = -\pgf@circ@res@right
9088 }%
9089 \savedmacro\inputs{% get number of inputs
9090 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9091 \ifnum\pgf@circ@res@count=0
9092 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/inputs}\relax%
9093 \fi
9094 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9095 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9096 \def\inputs{\the\pgf@circ@res@count}%
9097 }%
9098 \savedanchor\step{% 1/2 gap at edges
9099 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
9100 \divide\pgf@circ@res@step by #3
9101 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9102 }%
9103 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
9104 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
9105 \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
9106 \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
9107 \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
9108
9109 \anchor{center}{\origin}% for backwards compatibility
9110 % the text anchor overlaps the logic symbol
9111 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
9112 % create input anchors
9113 \ifnum#3=1\relax
9114 \anchor{in}{\pgfpoint{\pgf@circ@res@left}{0pt}}% or \step
9115 \else
9116 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
9117 \pgfmathloop%
9118 \ifnum\pgfmathcounter>#3%
9119 \else%
9120 %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
9121 \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
9122 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9123 }%
9124 \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
9125 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
9126 }%
9127 %}{}%
9128 \repeatpgfmathloop%
9129 }
9130 \fi
9131 \anchor{out}{\northeast\pgf@y=0pt}
9132 \anchor{bout}{\right\pgf@y=0pt}
9133
9134 \anchor{left}{\left}% edges of component minus leads
9135 \anchor{right}{\right}
9136
9137 \anchor{north east}{\northeast}% see \Compass macro
9138 \anchor{south west}{\southwest}
9139 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9140 \pgfpoint{0cm}{\pgf@circ@res@up}}
9141 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9142 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9143 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9144 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9145 \pgfpoint{\pgf@circ@res@left}{0cm}}
9146 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9147 \pgfpoint{0cm}{\pgf@circ@res@down}}
9148 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9149 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9150 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9151 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
9152 \pgfpoint{\pgf@circ@res@right}{0cm}}
9153
9154 \backgroundpath{
9155 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9156 \pgfscope
9157 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9158 \pgfpathrectanglecorners
9159 {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
9160 {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
9161 \pgf@circ@draworfill
9162 \endpgfscope
9163 \ifnum#3=1\relax
9164 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
9165 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
9166 \else
9167 \pgfextracty{\pgf@circ@res@temp}{\step}%
9168 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9169 %\pgf@circ@res@count = #3\relax% redundant
9170 \loop\ifnum\pgf@circ@res@count>0
9171 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9172 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9173 \pgfpathlineto{\pgfpoint
9174 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
9175 {\pgf@circ@res@temp}}
9176 \advance\pgf@circ@res@count by -1
9177 \repeat
9178 \fi
9179 %
9180 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9181 \pgfpathlineto{%
9182 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
9183 %
9184 \edef\pgf@temp{not}
9185 \edef\pgf@circ@temp{#4}
9186 \ifx\pgf@temp\pgf@circ@temp % is a not
9187 \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
9188 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}%
9189 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
9190 \fi
9191 %
9192 \pgfusepath{draw}
9193 %
9194 \pgfpathmoveto{\pgfpointorigin}
9195 \pgftext{#2}
9196 %
9197 %
9198 %
9199 }
9200 }
9201 }
9202 \pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
9203 \pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
9204 \pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
9205 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
9206 \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
9207 \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
9208 \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
9209
9210 %% end european logic ports
9211
9212 \long\def\pgfcircdeclaretransistor#1#2#3{
9213 \pgfdeclareshape{#1}
9214 {
9215 \anchor{center}{
9216 \pgfpointorigin
9217 }
9218 \savedanchor\northeast{% upper right
9219 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@circ@Rlen
9220 \pgf@y=.5\pgf@y
9221 \pgf@x=0pt
9222 }
9223 \savedanchor\left{%center left
9224 \pgf@y=0pt
9225 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@circ@Rlen
9226 }
9227 \anchor{text}{
9228 \northeast
9229 \pgf@y=.7\pgf@y
9230 \pgf@x= \pgf@circ@Rlen
9231 \pgf@x=0.1\pgf@x
9232 }
9233 \anchor{pathstart}{ % south
9234 \northeast
9235 \pgf@y=-\pgf@y
9236 }
9237 \anchor{pathend}{
9238 \northeast
9239 }
9240 \anchor{north}{
9241 \northeast
9242 \pgf@circ@res@step=\pgf@y
9243 \left
9244 \pgf@y=\pgf@circ@res@step
9245 \pgf@x=.5\pgf@x
9246 }
9247 \anchor{west}{
9248 \left
9249 }
9250 \anchor{east}{
9251 \northeast
9252 \pgf@y=0pt
9253 }
9254 \anchor{south}{
9255 \northeast
9256 \pgf@circ@res@step=\pgf@y
9257 \left
9258 \pgf@y=-\pgf@circ@res@step
9259 \pgf@x=.5\pgf@x
9260 }
9261 \anchor{south west}{
9262 \northeast
9263 \pgf@circ@res@step=\pgf@y
9264 \left
9265 \pgf@y=-\pgf@circ@res@step
9266 }
9267 \anchor{north east}{
9268 \northeast
9269 }
9270 \anchor{north west}{
9271 \northeast
9272 \pgf@circ@res@step=\pgf@y
9273 \left
9274 \pgf@y=\pgf@circ@res@step
9275 }
9276 \anchor{south east}{
9277 \northeast
9278 \pgf@y=-\pgf@y
9279 }
9280 \anchor{B}{
9281 \northeast
9282 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9283 \left
9284 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9285 }
9286 \anchor{base}{
9287 \northeast
9288 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9289 \left
9290 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9291 }
9292 \anchor{G}{
9293 \northeast
9294 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9295 \left
9296 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9297 }
9298 \anchor{gate}{
9299 \northeast
9300 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9301 \left
9302 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9303 }
9304 \anchor{nobase}{
9305 \left
9306 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
9307 }
9308 \anchor{nogate}{
9309 \left
9310 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x
9311 }
9312 \anchor{E}{
9313 \northeast
9314 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9315 }
9316 \anchor{emitter}{
9317 \northeast
9318 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9319 }
9320 \anchor{C}{
9321 \northeast
9322 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9323 }
9324 \anchor{collector}{
9325 \northeast
9326 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9327 }
9328 \anchor{S}{
9329 \northeast
9330 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9331 }
9332 \anchor{source}{
9333 \northeast
9334 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9335 }
9336 \anchor{D}{
9337 \northeast
9338 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9339 }
9340 \anchor{drain}{
9341 \northeast
9342 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9343 }
9344 #2
9345 \backgroundpath{
9346 \pgftransformationadjustments
9347 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9348 %
9349 \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
9350 \pgf@circuit@trans@ntypetrue
9351 \else
9352 \pgf@circuit@trans@ntypefalse
9353 \fi
9354 \northeast
9355 \pgf@circ@res@up = \pgf@y
9356 \pgf@circ@res@down = -\pgf@y
9357 \pgf@circ@res@right = \pgf@x
9358 \left
9359 \pgf@circ@res@left = \pgf@x
9360 %
9361 #3
9362 % BODY DIODE
9363 \ifpgf@circuit@fet@bodydiode
9364 \drawbodydiode{#1}
9365 \fi
9366 %
9367 }
9368 }
9369 }
9370
9371 \long\def\drawbodydiode#1{
9372 \pgfscope
9373 \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
9374 \pgftransformrotate{90}
9375 \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
9376 \ifpgf@circuit@fulldiode
9377 \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
9378 \else
9379 \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
9380 \fi
9381 \endpgfscope
9382 % Draw stroke line
9383 \ifpgf@circuit@strokediode
9384 \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
9385 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
9386 \pgfusepath{stroke}
9387 \fi
9388 %Draw upper connection to body diode
9389 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
9390 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9391 \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}
9392 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9393 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
9394 \pgfusepath{draw}
9395 \pgfscope
9396 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
9397 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9398 \pgftransformscale{0.5}
9399 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
9400 \endpgfscope{}
9401 %Draw lower connection to body diode
9402 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
9403 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9404 \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9405 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
9406 \pgfusepath{draw}
9407 \pgfscope
9408 \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9409 \pgftransformscale{0.5}
9410 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
9411 \endpgfscope
9412 }
9413
9414 \long\def\declarebpt#1{
9415 \pgfcircdeclaretransistor{#1}{}{
9416 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9417 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9418 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
9419 \pgfpathlineto{\pgfpoint
9420 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9421 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}}
9422 \pgfusepath{draw}
9423
9424 \pgfscope
9425 \pgfpathmoveto{\pgfpoint
9426 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9427 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
9428 \pgfpathlineto{\pgfpoint
9429 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9430 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9431 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9432 \pgfusepath{draw}
9433 \endpgfscope
9434
9435 \pgfpathmoveto{\pgfpoint
9436 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9437 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}}
9438 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9439 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9440 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9441 \pgfusepath{draw}
9442 %draw arrow depending on type of transistor
9443 \pgfscope
9444 \pgfslopedattimetrue
9445 \pgfallowupsidedownattimetrue
9446 \pgfresetnontranslationattimefalse
9447 \ifpgf@circuit@trans@ntype
9448 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
9449 \pgfpoint%
9450 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9451 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}%
9452 }{%
9453 \pgfpoint{\pgf@circ@res@right}%
9454 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}%
9455 }
9456 \else
9457 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
9458 \pgfpoint{\pgf@circ@res@right}%
9459 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}%
9460 }{%
9461 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9462 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}%
9463 }
9464 \fi
9465 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9466 \endpgfscope
9467
9468 \ifpgf@circuit@bpt@drawphoto
9469 \pgfscope
9470 \pgfsetarrowsstart{latexslim}
9471 \pgfpathmoveto{\pgfpointadd{\pgfpoint
9472 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9473 {\pgf@circ@res@up+\pgf@circ@res@down}}
9474 {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
9475 \pgfpathlineto{\pgfpointadd{\pgfpoint
9476 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9477 {\pgf@circ@res@up+\pgf@circ@res@down}}
9478 {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
9479 \pgfusepath{draw}
9480 \pgfpathmoveto{\pgfpointadd{\pgfpoint
9481 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9482 {\pgf@circ@res@up+\pgf@circ@res@down}}
9483 {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
9484 \pgfpathlineto{\pgfpointadd{\pgfpoint
9485 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9486 {\pgf@circ@res@up+\pgf@circ@res@down}}
9487 {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
9488 \pgfusepath{draw}
9489 \endpgfscope
9490 \else
9491 \ifpgf@circuit@bpt@drawbase
9492 \pgfpathmoveto{\pgfpoint
9493 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9494 {\pgf@circ@res@up+\pgf@circ@res@down}}
9495 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9496 \pgfusepath{draw}
9497 \fi
9498 \fi
9499 }
9500 }
9501
9502 \declarebpt{npn}
9503 \declarebpt{pnp}
9504
9505 \long\def\declareigbt#1{
9506 \pgfcircdeclaretransistor{#1}{}
9507 {
9508 %draw upper connection
9509 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9510 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9511 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
9512 \pgfpathlineto{\pgfpoint
9513 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9514 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}}
9515 \pgfusepath{draw}
9516
9517 %draw thicker gate lines
9518 \pgfscope
9519 \pgfpathmoveto{\pgfpoint
9520 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9521 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9522 \pgfpathlineto{\pgfpoint
9523 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9524 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9525 \pgfpathmoveto{\pgfpoint
9526 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9527 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9528 \pgfpathlineto{\pgfpoint
9529 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9530 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9531 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9532 \pgfusepath{draw}
9533 \endpgfscope
9534 %draw lower connection
9535 \pgfpathmoveto{\pgfpoint
9536 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9537 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}}
9538 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9539 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
9540 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9541 \pgfusepath{draw}
9542 %draw arrow depending on type of transiytor
9543 \pgfscope
9544 \pgfslopedattimetrue
9545 \pgfallowupsidedownattimetrue
9546 \pgfresetnontranslationattimefalse
9547 \ifpgf@circuit@trans@ntype
9548 \pgftransformlineattime{.5}{%
9549 \pgfpoint%
9550 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9551 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}%
9552 }{%
9553 \pgfpoint{\pgf@circ@res@right}%
9554 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}%
9555 }
9556 \else
9557 \pgftransformlineattime{.5}{%
9558 \pgfpoint{\pgf@circ@res@right}%
9559 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}%
9560 }{%
9561 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9562 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}%
9563 }
9564 \fi
9565 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9566 \endpgfscope
9567 %draw gate
9568 \ifpgf@circuit@trans@ntype
9569 \pgfpathmoveto{\pgfpoint
9570 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9571 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9572 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
9573 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9574 \else
9575 \pgfpathmoveto{\pgfpoint
9576 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9577 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
9578 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
9579 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
9580 \fi
9581 \pgfusepath{draw}
9582 }
9583 }
9584
9585 \declareigbt{pigbt}
9586 \declareigbt{nigbt}
9587 \declareigbt{Lnigbt}
9588 \declareigbt{Lpigbt}
9589
9590
9591 \pgfcircdeclaretransistor{nmos}{}{%
9592 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9593 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9594 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9595 \pgfpathlineto{\pgfpoint
9596 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9597 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9598
9599 \pgfpathmoveto{\pgfpoint
9600 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9601 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9602 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9603 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9604 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9605 \pgfusepath{draw}
9606
9607 \pgfscope
9608 \pgfpathmoveto{\pgfpoint
9609 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9610 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
9611 \pgfpathlineto{\pgfpoint
9612 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9613 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
9614 \pgfpathmoveto{\pgfpoint
9615 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9616 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9617 \pgfpathlineto{\pgfpoint
9618 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9619 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9620 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9621 \pgfusepath{draw}
9622 \endpgfscope
9623 \ifpgf@circuit@mos@arrows
9624 \pgfscope
9625 \pgfslopedattimetrue
9626 \pgfallowupsidedownattimetrue
9627 \pgfresetnontranslationattimefalse
9628 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/arrow pos}}{%
9629 \pgfpoint%
9630 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
9631 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
9632 }{%
9633 \pgfpoint
9634 {\pgf@circ@res@right}%
9635 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
9636 }
9637 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9638 \endpgfscope
9639 \fi
9640
9641 \ifpgf@circuit@bpt@drawgate
9642 \pgfpathmoveto{\pgfpoint
9643 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9644 {\pgf@circ@res@up+\pgf@circ@res@down}}
9645 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9646 \pgfusepath{draw}
9647 \fi
9648 }
9649
9650
9651 \pgfcircdeclaretransistor{pmos}{}{%
9652 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9653 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9654 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9655 \pgfpathlineto{\pgfpoint
9656 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9657 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9658 \pgfusepath{draw}
9659
9660 \ifpgf@circuit@mos@arrows
9661 \pgfscope
9662 \pgfslopedattimetrue
9663 \pgfallowupsidedownattimetrue
9664 \pgfresetnontranslationattimefalse
9665 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/arrow pos}}{%
9666 \pgfpoint%
9667 {\pgf@circ@res@right}%
9668 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
9669 }{%
9670 \pgfpoint
9671 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
9672 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
9673 }
9674 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9675 \endpgfscope
9676 \fi
9677
9678 \pgfscope
9679 \pgfpathmoveto{\pgfpoint
9680 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9681 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
9682 \pgfpathlineto{\pgfpoint
9683 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9684 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
9685 \pgfpathmoveto{\pgfpoint
9686 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
9687 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9688 \pgfpathlineto{\pgfpoint
9689 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
9690 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
9691 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9692 \pgfusepath{draw}
9693 \endpgfscope
9694
9695 \pgfpathmoveto{\pgfpoint
9696 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9697 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
9698 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9699 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
9700 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9701
9702
9703 \pgfusepath{draw}
9704 \ifpgf@circuit@bpt@drawgate
9705 \pgfpathmoveto{\pgfpoint
9706 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
9707 {\pgf@circ@res@up+\pgf@circ@res@down}}
9708 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9709 \pgfusepath{draw}
9710 \fi
9711 \ifpgf@circuit@pmos@nocircle\else
9712 \pgfpathcircle{\pgfpoint
9713 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
9714 {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
9715 \ifpgf@circuit@pmos@emptycircle
9716 \pgfsetfillcolor{white}
9717 \fi
9718 \pgfusepath{draw,fill}
9719 \fi
9720 }
9721
9722 %% HEMT FET Transistor
9723 \pgfcircdeclaretransistor{hemt}{}{%
9724 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9725 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9726 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
9727 \pgfpathlineto{\pgfpoint
9728 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
9729 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
9730
9731 \pgfpathmoveto{\pgfpoint
9732 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
9733 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@down}}
9734 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9735 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@down}}
9736 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9737 \pgfusepath{draw}
9738
9739 \pgfscope
9740 \pgfpathmoveto{\pgfpoint
9741 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
9742 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@up}}
9743 \pgfpathlineto{\pgfpoint
9744 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
9745 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@down}}
9746 \pgfsetlinewidth{2\pgflinewidth}
9747 \pgfusepath{draw}
9748 \endpgfscope
9749
9750 \pgfpathmoveto{\pgfpoint
9751 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
9752 {\pgf@circ@res@up+\pgf@circ@res@down}}
9753 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9754 \pgfusepath{draw}
9755 }
9756
9757 \long\def\drawfetcore#1{
9758 \pgftransformationadjustments
9759 %top connection
9760 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9761 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9762 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
9763 \pgfpathlineto{\pgfpoint
9764 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9765 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
9766 \pgfusepath{draw}
9767 \pgfscope
9768 \pgfpathmoveto{\pgfpoint
9769 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9770 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
9771 \ifpgf@circuit@trans@depletiontype
9772 \pgfpathlineto{\pgfpoint
9773 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9774 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9775 \else
9776
9777 \pgfpathlineto{\pgfpoint
9778 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9779 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.45}}
9780 \pgfpathmoveto{\pgfpoint
9781 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9782 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.25}}
9783 \pgfpathlineto{\pgfpoint
9784 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9785 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down*0.25}}
9786 \pgfpathmoveto{\pgfpoint
9787 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9788 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
9789 \pgfpathlineto{\pgfpoint
9790 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9791 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9792 \fi
9793 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9794 \pgfusepath{draw}
9795 \endpgfscope
9796 %Bulk connection line
9797 \pgfpathmoveto{\pgfpoint
9798 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9799 {\pgf@circ@res@up+\pgf@circ@res@down}}
9800 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
9801 {\pgf@circ@res@up+\pgf@circ@res@down}}
9802
9803 %bottom connection
9804 \pgfpathmoveto{\pgfpoint
9805 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9806 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
9807 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9808 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
9809 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9810 \pgfusepath{draw}
9811
9812 %draw thick gate line
9813 \pgfscope
9814 \pgfpathmoveto{\pgfpoint
9815 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9816 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9817 \pgfpathlineto{\pgfpoint
9818 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9819 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9820 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9821 \pgfusepath{draw}
9822 \endpgfscope
9823
9824 \pgfscope
9825 \pgfslopedattimetrue
9826 \pgfallowupsidedownattimetrue
9827 \pgfresetnontranslationattimefalse
9828
9829 \pgftransformlineattime{.6}{%
9830 \pgfpoint
9831 {\pgf@circ@res@right}%
9832 {\pgf@circ@res@up+\pgf@circ@res@down}%
9833 }{%
9834 \pgfpoint%
9835 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9836 {\pgf@circ@res@up+\pgf@circ@res@down}%
9837 }
9838 \ifpgf@circuit@trans@ntype
9839 \else
9840 \pgftransformrotate{180}
9841 \fi
9842 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9843 \endpgfscope
9844
9845 % GATE CONNECTION
9846 \ifpgf@circuit@bpt@drawgate
9847 \ifpgf@circuit@trans@ntype
9848 \pgfpathmoveto{\pgfpoint
9849 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9850 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9851 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9852 \else
9853 \pgfpathmoveto{\pgfpoint
9854 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9855 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9856 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9857 \fi
9858 \pgfusepath{draw}
9859 \fi
9860
9861 }
9862
9863 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
9864 {\pgfcircdeclaretransistor{#1}{
9865 \anchor{bulk}{\left\pgf@x=0pt}
9866 \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
9867 #2
9868 }
9869 {#3}
9870 }
9871
9872
9873 \pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
9874 \pgf@circuit@trans@depletiontypefalse
9875 \drawfetcore{nfet}
9876 }
9877
9878
9879 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
9880 \pgf@circuit@trans@depletiontypefalse
9881 \drawfetcore{pfet}
9882 }
9883
9884 % N-CHANNEL IGFET ENHANCEMENT TYPE
9885 \pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
9886 \pgf@circuit@trans@depletiontypefalse
9887 \drawfetcore{nigfete}
9888
9889 % SOURCE CONNECTION
9890 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9891 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9892 \pgfusepath{draw}
9893
9894 % SOLDER DOT at source-bulk connection
9895 \ifpgf@circuit@fet@solderdot
9896 \pgfscope
9897 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
9898 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
9899 \pgfnode{circ}{center}{}{}{}
9900 \endpgfscope{}
9901 \fi
9902 }
9903
9904
9905
9906
9907 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
9908 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
9909 \pgf@circuit@trans@depletiontypefalse
9910 \drawfetcore{nigfetebulk}
9911 % SOLDER DOT at source-bulk connection
9912 \ifpgf@circuit@fet@solderdot
9913 \pgfscope
9914 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
9915 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
9916 \pgfnode{circ}{center}{}{}{}
9917 \endpgfscope{}
9918 \fi
9919 }
9920
9921
9922
9923 % N-CHANNEL IGFET DEPLETION TYPE
9924 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
9925 \pgf@circuit@trans@depletiontypetrue
9926 \drawfetcore{nigfetd}
9927
9928 % SOURCE CONNECTION
9929 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9930 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9931 \pgfusepath{draw}
9932
9933 % SOLDER DOT at source-bulk connection
9934 \ifpgf@circuit@fet@solderdot
9935 \pgfscope
9936 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
9937 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
9938 \pgfnode{circ}{center}{}{}{}
9939 \endpgfscope{}
9940 \fi
9941 }
9942
9943 % P-CHANNEL IGFET ENHANCEMENT TYPE
9944 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
9945 \pgf@circuit@trans@depletiontypefalse
9946 \drawfetcore{pigfete}
9947 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9948
9949 % SOURCE CONNECTION
9950 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9951 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9952 \pgfusepath{draw}
9953
9954
9955 % SOLDER DOT at source-bulk connection
9956 \ifpgf@circuit@fet@solderdot
9957 \pgfscope
9958 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
9959 \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
9960 \pgfnode{circ}{center}{}{}{}
9961 \endpgfscope
9962 \fi
9963 }
9964
9965 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
9966 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
9967 \pgf@circuit@trans@depletiontypefalse
9968 \drawfetcore{pigfetebulk}
9969 }
9970
9971
9972 % P-CHANNEL IGFET DEPLETION TYPE
9973 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
9974 \pgf@circuit@trans@depletiontypetrue
9975 \drawfetcore{pigfetd}
9976
9977 % SOURCE CONNECTION
9978 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9979 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9980 \pgfusepath{draw}
9981
9982
9983 % SOLDER DOT at source-bulk connection
9984 \ifpgf@circuit@fet@solderdot
9985 \pgfscope
9986 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
9987 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
9988 \pgfnode{circ}{center}{}{}{}
9989 \endpgfscope{}
9990 \fi
9991 }
9992
9993 \pgfcircdeclaretransistor{njfet}{}{%
9994 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9995 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9996 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
9997 \pgfpathlineto{\pgfpoint
9998 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
9999 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
10000
10001 \pgfpathmoveto{\pgfpoint
10002 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10003 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10004 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10005 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10006 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10007 \pgfusepath{draw}
10008
10009 \pgfscope
10010 \pgfpathmoveto{\pgfpoint
10011 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10012 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
10013 \pgfpathlineto{\pgfpoint
10014 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10015 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
10016 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10017 \pgfusepath{draw}
10018 \endpgfscope
10019
10020 \pgfscope
10021 \pgfslopedattimetrue
10022 \pgfallowupsidedownattimetrue
10023 \pgfresetnontranslationattimefalse
10024 \pgftransformlineattime{.6}{%
10025 \pgfpoint{\pgf@circ@res@left}%
10026 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
10027 }{%
10028 \pgfpoint
10029 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
10030 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
10031 }
10032 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10033 \endpgfscope
10034
10035 \pgfpathmoveto{\pgfpoint
10036 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10037 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10038 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10039 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10040 \pgfusepath{draw}
10041 }
10042
10043
10044 \pgfcircdeclaretransistor{pjfet}{}{%
10045 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10046 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10047 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10048 \pgfpathlineto{\pgfpoint
10049 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10050 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10051
10052 \pgfpathmoveto{\pgfpoint
10053 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10054 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
10055 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10056 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
10057 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10058 \pgfusepath{draw}
10059
10060 \pgfscope
10061 \pgfpathmoveto{\pgfpoint
10062 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10063 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
10064 \pgfpathlineto{\pgfpoint
10065 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10066 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
10067 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10068 \pgfusepath{draw}
10069 \endpgfscope
10070
10071 \pgfscope
10072 \pgfslopedattimetrue
10073 \pgfallowupsidedownattimetrue
10074 \pgfresetnontranslationattimefalse
10075 \pgftransformlineattime{.4}{%
10076 \pgfpoint%
10077 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
10078 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
10079 }{%
10080 \pgfpoint{\pgf@circ@res@left}%
10081 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
10082 }
10083 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10084 \endpgfscope
10085
10086
10087 \pgfpathmoveto{\pgfpoint
10088 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10089 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10090 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10091 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10092 \pgfusepath{draw}
10093 }
10094
10095
10096 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
10097 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10098 % DRAIN CONNECTION
10099 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10100 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
10101 % DRAIN
10102 \pgfpathlineto{\pgfpoint
10103 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10104 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
10105 \pgfusepath{draw}
10106
10107 % GATE, DEPLETION TYPE
10108 \pgfscope %% added
10109 \pgfpathmoveto{\pgfpoint
10110 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10111 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
10112 \pgfpathlineto{\pgfpoint
10113 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10114 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
10115 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth} %% added
10116 \pgfusepath{draw} %% added
10117 \endpgfscope %% added
10118
10119 % BULK
10120 \pgfpathmoveto{\pgfpoint
10121 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10122 {\pgf@circ@res@up+\pgf@circ@res@down}}
10123 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
10124 {\pgf@circ@res@up+\pgf@circ@res@down}}
10125
10126 % SOURCE
10127 \pgfpathmoveto{\pgfpoint
10128 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10129 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
10130 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10131 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
10132 % SOURCE CONNECTION
10133 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10134 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10135 \pgfusepath{draw}
10136
10137
10138 % SOLDER DOT at source-bulk connection
10139 \ifpgf@circuit@fet@solderdot
10140 \pgfscope
10141 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10142 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
10143 \pgfnode{circ}{center}{}{}{}
10144 \endpgfscope{}
10145 \fi
10146 % ARROW
10147 \pgfscope
10148 \pgfslopedattimetrue
10149 \pgfallowupsidedownattimetrue
10150 \pgfresetnontranslationattimefalse
10151 \pgftransformlineattime{.6}{%
10152 \pgfpoint
10153 {\pgf@circ@res@right}%
10154 {\pgf@circ@res@up+\pgf@circ@res@down}%
10155 }{%
10156 \pgfpoint%
10157 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
10158 {\pgf@circ@res@up+\pgf@circ@res@down}%
10159 }
10160 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10161 \endpgfscope
10162 \pgfusepath{draw}
10163
10164 % Wavy lines
10165 \pgfscope
10166 \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
10167 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10168 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10169 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10170 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10171 \pgfusepath{draw}
10172
10173 \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
10174 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10175 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10176 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10177 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10178 \pgfusepath{draw}
10179
10180 \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
10181 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10182 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10183 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10184 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10185 \pgfusepath{draw}
10186 \endpgfscope
10187
10188 }
10189
10190
10191 %% Black thyristor
10192
10193 \pgfcircdeclarebipole{
10194 \anchor{gate}{
10195 \northeast
10196 }
10197 \anchor{anode}{
10198 \southwest
10199 \pgf@y=0cm
10200 }
10201 \anchor{G}{
10202 \northeast
10203 }
10204 \anchor{cathode}{
10205 \northeast
10206 \pgf@y=0cm
10207 }
10208 }
10209 {\ctikzvalof{tripoles/thyristor/height 2}}
10210 {fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}
10211 {\ctikzvalof{tripoles/thyristor/width}}
10212 {
10213
10214 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10215
10216 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
10217 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
10218
10219 \pgfscope
10220 \pgftransformxshift{\pgf@circ@res@other}
10221 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10222
10223 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
10224 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10225 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10226 \pgfusepath{draw,fill}
10227
10228 \pgfsetlinewidth{\pgfstartlinewidth}
10229
10230 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10231 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
10232 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
10233 \pgfusepath{draw}
10234 \endpgfscope
10235
10236 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
10237 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
10238
10239 \pgfusepath{draw}
10240
10241 \pgfsetlinewidth{\pgfstartlinewidth}
10242
10243 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10244 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10245
10246 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10247 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10248
10249 \pgfusepath{draw}
10250
10251 }
10252
10253 %% Empty thyristor
10254
10255 \pgfcircdeclarebipole{
10256 \anchor{gate}{
10257 \northeast
10258 }
10259 \anchor{anode}{
10260 \southwest
10261 \pgf@y=0cm
10262 }
10263 \anchor{G}{
10264 \northeast
10265 }
10266 \anchor{cathode}{
10267 \northeast
10268 \pgf@y=0cm
10269 }
10270 }
10271 {\ctikzvalof{tripoles/thyristor/height 2}}
10272 {emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}
10273 {\ctikzvalof{tripoles/thyristor/width}}
10274 {
10275
10276 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10277
10278 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
10279 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
10280
10281 \pgfscope
10282 \pgftransformxshift{\pgf@circ@res@other}
10283 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10284
10285 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
10286 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10287 \pgfpathclose
10288 \pgf@circ@draworfill
10289 \pgfscope
10290 % to allow filling, we need to draw explicitily the stroke here.
10291 \pgfsetlinewidth{\pgfstartlinewidth}
10292 \ifpgf@circuit@bipole@strokedsymbol
10293 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10294 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
10295 \pgfusepath{draw}
10296 \fi
10297 \endpgfscope
10298
10299 \pgfsetlinewidth{\pgfstartlinewidth}
10300
10301 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10302 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
10303 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
10304 \pgfusepath{draw}
10305 \endpgfscope
10306
10307 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
10308 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
10309
10310 \pgfusepath{draw}
10311
10312 \pgfsetlinewidth{\pgfstartlinewidth}
10313
10314 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10315 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10316
10317 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10318 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10319
10320 \pgfusepath{draw}
10321
10322 }
10323
10324 %% Empty triac
10325
10326 \pgfcircdeclarebipole{
10327 \anchor{gate}{
10328 \northeast
10329 }
10330 \anchor{G}{
10331 \northeast
10332 }
10333 \anchor{anode}{
10334 \southwest
10335 \pgf@y=0cm
10336 }
10337 \anchor{cathode}{
10338 \northeast
10339 \pgf@y=0cm
10340 }
10341 }
10342 {\ctikzvalof{tripoles/triac/height}}
10343 {emptytriac}
10344 {\ctikzvalof{tripoles/triac/height}}
10345 {\ctikzvalof{tripoles/triac/width}}
10346 {
10347
10348 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10349
10350 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
10351 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
10352
10353 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10354 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10355 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10356 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10357
10358 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10359 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10360 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10361 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10362
10363 \pgf@circ@draworfill
10364
10365 \pgfsetlinewidth{\pgfstartlinewidth}
10366
10367 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10368 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10369 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
10370
10371 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10372 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10373
10374 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10375 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10376
10377 \pgfusepath{draw}
10378
10379 }
10380
10381 %% Full triac
10382
10383 \pgfcircdeclarebipole{
10384 \anchor{gate}{
10385 \northeast
10386 }
10387 \anchor{G}{
10388 \northeast
10389 }
10390 \anchor{anode}{
10391 \southwest
10392 \pgf@y=0cm
10393 }
10394 \anchor{cathode}{
10395 \northeast
10396 \pgf@y=0cm
10397 }
10398 }
10399 {\ctikzvalof{tripoles/triac/height}}
10400 {fulltriac}
10401 {\ctikzvalof{tripoles/triac/height}}
10402 {\ctikzvalof{tripoles/triac/width}}
10403 {
10404 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10405
10406 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
10407 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
10408
10409 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10410 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10411 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10412 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10413
10414 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10415 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10416 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10417 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10418
10419 \pgfusepath{draw,fill}
10420
10421 \pgfsetlinewidth{\pgfstartlinewidth}
10422
10423 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10424 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10425 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
10426
10427 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10428 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10429
10430 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10431 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10432
10433 \pgfusepath{draw}
10434
10435 }
10436
10437 \pgfcircdeclarebipole{
10438 \anchor{out 1}{
10439 \northeast
10440 \pgf@y=0cm
10441 }
10442 \anchor{out 2}{
10443 \northeast
10444 \pgf@y=.8\pgf@y
10445 }
10446 }
10447 {\ctikzvalof{tripoles/toggleswitch/height 2}}
10448 {toggleswitch}
10449 {\ctikzvalof{tripoles/toggleswitch/height}}
10450 {\ctikzvalof{tripoles/toggleswitch/width}}
10451 {
10452
10453 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10454 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
10455 \pgfusepath{draw}
10456 \pgfscope
10457 \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
10458 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10459 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
10460 \pgfusepath{draw}
10461 \endpgfscope
10462
10463 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10464 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
10465
10466 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
10467 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
10468 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
10469 \pgfusepath{draw}
10470
10471
10472 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
10473 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
10474 \pgfusepath{draw}
10475
10476 \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
10477 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
10478 \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
10479 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
10480 \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
10481 \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
10482 \pgfusepath{draw}
10483 \pgfsetdash{}{0cm}
10484 }
10485
10486 %% operational and instrumentation amplifiers
10487
10488 \pgfdeclareshape{op amp}
10489 {
10490 \anchor{center}{\pgfpointorigin}
10491 \savedanchor\northwest{%
10492 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10493 \pgf@y=.5\pgf@y
10494 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10495 \pgf@x=.5\pgf@x
10496 }
10497 \anchor{south}{
10498 \northwest
10499 \pgf@y=-\pgf@y
10500 \pgf@x=0pt
10501 }
10502 \anchor{north}{
10503 \northwest
10504 \pgf@x=0pt
10505 }
10506 \savedanchor\left{%
10507 \pgf@y=0pt
10508 }
10509 \anchor{leftedge}
10510 {\left
10511 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
10512 }
10513 \savedanchor\inOneFixed{%
10514 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10515 \pgf@y=.5\pgf@y
10516 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10517 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10518 \pgf@x=.5\pgf@x
10519 }
10520 \anchor{in up}{
10521 \inOneFixed
10522 }
10523 \anchor{in down}{
10524 \inOneFixed
10525 \pgf@y=-\pgf@y
10526 }
10527
10528 \savedanchor\inOne{%
10529 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10530 \pgf@y=.5\pgf@y
10531 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10532 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10533 \pgf@x=.5\pgf@x
10534 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10535 }
10536 \anchor{-}{
10537 \inOne
10538 }
10539 \anchor{+}{
10540 \inOne
10541 \pgf@y=-\pgf@y
10542 }
10543 \savedanchor\up{%
10544 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10545 \pgf@y=.5\pgf@y
10546 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10547 \pgf@x=.5\pgf@x
10548 \pgf@circ@res@up = \pgf@y
10549 \pgf@circ@res@right = -\pgf@x
10550 \pgf@circ@res@left = \pgf@x
10551 \pgfpointlineattime{
10552 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
10553 \pgfpoint{
10554 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10555 {\pgf@circ@res@up}}
10556 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10557 }
10558 \anchor{up}{
10559 \up
10560 }
10561 \anchor{down}{
10562 \up
10563 \pgf@y=-\pgf@y
10564 }
10565 \anchor{out}{
10566 \northwest
10567 \pgf@y=0pt
10568 \pgf@x=-\pgf@x
10569 }
10570 \anchor{west}{
10571 \left
10572 }
10573 \anchor{east}{
10574 \left
10575 \pgf@x=-\pgf@x
10576 }
10577
10578 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
10579 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
10580 \anchor{north west}{ \northwest }
10581 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
10582
10583 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
10584
10585 \backgroundpath{
10586 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
10587
10588
10589 \northwest
10590 \pgf@circ@res@up = \pgf@y
10591 \pgf@circ@res@down = -\pgf@y
10592 \pgf@circ@res@right = -\pgf@x
10593 \pgf@circ@res@left = \pgf@x
10594
10595 \pgfscope
10596 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10597 \pgftransformxshift{.7\pgf@circ@res@left}
10598 \pgf@circ@res@step=\pgf@circ@res@right
10599 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10600 \pgf@circ@res@step=.7\pgf@circ@res@step
10601
10602 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10603 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10604 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10605 \pgfpathclose
10606 \pgf@circ@draworfill
10607 \endpgfscope
10608
10609 \pgfpathmoveto{\pgfpoint
10610 {\pgf@circ@res@left}
10611 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
10612 \pgfpathlineto{\pgfpoint
10613 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10614 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
10615 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
10616
10617
10618 \pgfpathmoveto{\pgfpoint
10619 {\pgf@circ@res@left}
10620 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
10621 \pgfpathlineto{\pgfpoint
10622 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10623 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
10624 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
10625
10626 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10627 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10628 \pgfsetrectcap
10629 \pgfusepath{draw}
10630
10631
10632 }
10633 }
10634
10635 %op amp shape as in european standard en 60617
10636 \pgfdeclareshape{en amp}
10637 {
10638 \anchor{center}{\pgfpointorigin}
10639 \savedanchor\northwest{%
10640 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
10641 \pgf@y=.5\pgf@y
10642 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@Rlen
10643 \pgf@x=.5\pgf@x
10644 }
10645 \anchor{south}{
10646 \northwest
10647 \pgf@y=-\pgf@y
10648 \pgf@x=0pt
10649 }
10650 \anchor{north}{
10651 \northwest
10652 \pgf@x=0pt
10653 }
10654 \savedanchor\left{%
10655 \pgf@y=0pt
10656 }
10657 \anchor{leftedge}
10658 {
10659 \left
10660 \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
10661 }
10662 \savedanchor\inOneFixed{%
10663 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@Rlen
10664 \pgf@y=.5\pgf@y
10665 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
10666 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@Rlen
10667 \pgf@x=.5\pgf@x
10668 }
10669 \anchor{in up}{
10670 \inOneFixed
10671 }
10672 \anchor{in down}{
10673 \inOneFixed
10674 \pgf@y=-\pgf@y
10675 }
10676 \savedanchor\inOne{%
10677 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
10678 \pgf@y=.5\pgf@y
10679 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
10680 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@Rlen
10681 \pgf@x=.5\pgf@x
10682 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10683 }
10684 \anchor{-}{
10685 \inOne
10686 }
10687 \anchor{+}{
10688 \inOne
10689 \pgf@y=-\pgf@y
10690 }
10691 \anchor{up}{
10692 \northwest
10693 \pgf@x=0pt
10694 }
10695 \anchor{down}{
10696 \northwest
10697 \pgf@x=0pt
10698 \pgf@y=-\pgf@y
10699 }
10700 \anchor{out}{
10701 \northwest
10702 \pgf@y=0pt
10703 \pgf@x=-\pgf@x
10704 }
10705 \anchor{west}{
10706 \left
10707 }
10708 \anchor{east}{
10709 \left
10710 \pgf@x=-\pgf@x
10711 }
10712 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
10713 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
10714 \anchor{north west}{ \northwest }
10715 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
10716 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
10717
10718 \backgroundpath{
10719 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
10720 \northwest
10721 \pgf@circ@res@up = \pgf@y
10722 \pgf@circ@res@down = -\pgf@y
10723 \pgf@circ@res@right = -\pgf@x
10724 \pgf@circ@res@left = \pgf@x
10725
10726 \pgfscope
10727 \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
10728 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
10729 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
10730 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
10731 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
10732 \pgfpathclose
10733 \pgf@circ@draworfill
10734 \endpgfscope
10735
10736 \pgfpathmoveto{\pgfpoint
10737 {\pgf@circ@res@left}
10738 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
10739 \pgfpathlineto{\pgfpoint
10740 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
10741 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
10742 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
10743
10744 \pgfpathmoveto{\pgfpoint
10745 {\pgf@circ@res@left}
10746 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
10747 \pgfpathlineto{\pgfpoint
10748 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
10749 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
10750 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
10751
10752 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10753 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10754 \pgfsetrectcap
10755 \pgfusepath{draw}
10756
10757
10758 \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
10759 % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
10760 }
10761 }
10762
10763 %%Transkonduktanzverstärker
10764 \pgfdeclareshape{gm amp}
10765 {
10766 \anchor{center}{\pgfpointorigin}
10767 \savedanchor\northwest{%
10768 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
10769 \pgf@y=.5\pgf@y
10770 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
10771 \pgf@x=.5\pgf@x
10772 }
10773 \anchor{south}{
10774 \northwest
10775 \pgf@y=-\pgf@y
10776 }
10777 \anchor{north}{
10778 \northwest
10779 }
10780 \savedanchor\left{%
10781 \pgf@y=0pt
10782 }
10783 \anchor{leftedge}
10784 {\left
10785 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
10786 }
10787 \savedanchor\inOneFixed{%
10788 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10789 \pgf@y=.5\pgf@y
10790 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10791 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10792 \pgf@x=.5\pgf@x
10793 }
10794 \anchor{in up}{
10795 \inOneFixed
10796 }
10797 \anchor{in down}{
10798 \inOneFixed
10799 \pgf@y=-\pgf@y
10800 }
10801 \savedanchor\inOne{%
10802 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
10803 \pgf@y=.5\pgf@y
10804 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y
10805 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
10806 \pgf@x=.5\pgf@x
10807 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10808 }
10809 \anchor{-}{
10810 \inOne
10811 }
10812 \anchor{+}{
10813 \inOne
10814 \pgf@y=-\pgf@y
10815 }
10816 \savedanchor\up{%
10817 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
10818 \pgf@y=.5\pgf@y
10819 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
10820 \pgf@x=.5\pgf@x
10821 \pgf@circ@res@up = \pgf@y
10822 \pgf@circ@res@right = -\pgf@x
10823 \pgf@circ@res@left = \pgf@x
10824 \pgfpointlineattime{
10825 \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
10826 \pgfpoint{
10827 \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
10828 {\pgf@circ@res@up}}
10829 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10830 }
10831 \anchor{up}{
10832 \up
10833 }
10834 \anchor{down}{
10835 \up
10836 \pgf@y=-\pgf@y
10837 }
10838 \anchor{out}{
10839 \northwest
10840 \pgf@y=0pt
10841 \pgf@x=-\pgf@x
10842 }
10843 \anchor{west}{
10844 \left
10845 }
10846 \anchor{east}{
10847 \left
10848 \pgf@x=-\pgf@x
10849 }
10850 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
10851 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
10852 \anchor{north west}{ \northwest }
10853 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
10854
10855 \anchor{text}{\northwest
10856 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
10857 \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf@x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
10858
10859 \backgroundpath{
10860 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
10861
10862 \northwest
10863 \pgf@circ@res@up = \pgf@y
10864 \pgf@circ@res@down = -\pgf@y
10865 \pgf@circ@res@right = -\pgf@x
10866 \pgf@circ@res@left = \pgf@x
10867
10868 \pgfscope
10869 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10870 \pgftransformxshift{.7\pgf@circ@res@left}
10871 \pgf@circ@res@step=\pgf@circ@res@right
10872 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10873 \pgf@circ@res@step=.7\pgf@circ@res@step
10874 %Umrandung:
10875 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich
10876 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}%vom Ausgang nach oben
10877 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
10878 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
10879 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}%ecke links unten nach rechts unten
10880 \pgfpathclose
10881 \pgf@circ@draworfill
10882 \endpgfscope
10883
10884 \pgfpathmoveto{\pgfpoint
10885 {\pgf@circ@res@left}
10886 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
10887 \pgfpathlineto{\pgfpoint
10888 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
10889 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
10890 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
10891
10892
10893 \pgfpathmoveto{\pgfpoint
10894 {\pgf@circ@res@left}
10895 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
10896 \pgfpathlineto{\pgfpoint
10897 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
10898 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
10899 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
10900
10901 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10902 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
10903 \pgfsetrectcap
10904 \pgfusepath{draw}
10905
10906 }
10907 }
10908
10909 %% instrumentation amplifier
10910
10911 \pgfdeclareshape{inst amp}
10912 {
10913 % when tikz calls the anchor it wants the relative position in the lengths
10914 % \pgf@x \pgf@y
10915 % \pgfpoint* functions set that variables
10916 % anchors are visible outside and run on use
10917 \anchor{center}{\pgfpointorigin}
10918 % savedanchors are internals and run on node creation (not use)
10919 % bounding-box top left
10920 \savedanchor\northwest{%
10921 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
10922 \pgf@y=.5\pgf@y
10923 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
10924 \pgf@x=.5\pgf@x
10925 }
10926 \anchor{nw}{
10927 \northwest
10928 }
10929 \anchor{south}{
10930 \northwest
10931 \pgf@y=-\pgf@y
10932 }
10933 \anchor{north}{
10934 \northwest
10935 }
10936 \savedanchor\left{%
10937 \pgf@y=0pt
10938 }
10939 \anchor{leftedge}
10940 {\left
10941 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
10942 }
10943 \savedanchor\inOneFixed{%
10944 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10945 \pgf@y=.5\pgf@y
10946 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10947 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10948 \pgf@x=.5\pgf@x
10949 }
10950 \anchor{in up}{
10951 \inOneFixed
10952 }
10953 \anchor{in down}{
10954 \inOneFixed
10955 \pgf@y=-\pgf@y
10956 }
10957 \savedanchor\inOne{%
10958 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
10959 \pgf@y=.5\pgf@y
10960 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@y
10961 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
10962 \pgf@x=.5\pgf@x
10963 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10964 }
10965 \anchor{-}{
10966 \inOne
10967 }
10968 \anchor{+}{
10969 \inOne
10970 \pgf@y=-\pgf@y
10971 }
10972 \savedanchor\up{%
10973 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
10974 \pgf@y=.5\pgf@y
10975 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
10976 \pgf@x=.5\pgf@x
10977 \pgf@circ@res@up = \pgf@y
10978 \pgf@circ@res@right = -\pgf@x
10979 \pgf@circ@res@left = \pgf@x
10980 \pgfpointlineattime{
10981 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/up pos}}{
10982 \pgfpoint{
10983 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
10984 {\pgf@circ@res@up}}
10985 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
10986 }
10987 \anchor{up}{
10988 \up
10989 }
10990 \anchor{down}{
10991 \up
10992 \pgf@y=-\pgf@y
10993 }
10994 % reference voltage input anchors.
10995 \savedanchor\refv{%
10996 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
10997 \pgf@y=.5\pgf@y
10998 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
10999 \pgf@x=.5\pgf@x
11000 \pgf@circ@res@up = \pgf@y
11001 \pgf@circ@res@right = -\pgf@x
11002 \pgf@circ@res@left = \pgf@x
11003 \pgfpointlineattime{
11004 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/refv pos}}{
11005 \pgfpoint{
11006 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11007 {\pgf@circ@res@up}}
11008 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
11009 }
11010 % we need both because they are normally drawn under the amp, and if you
11011 % mirror it vertically you need them
11012 \anchor{refv up}{
11013 \refv
11014 }
11015 \anchor{refv down}{
11016 \refv
11017 \pgf@y=-\pgf@y
11018 }
11019 \anchor{out}{
11020 \northwest
11021 \pgf@y=0pt
11022 \pgf@x=-\pgf@x
11023 }
11024 \anchor{west}{
11025 \left
11026 }
11027 \anchor{east}{
11028 \left
11029 \pgf@x=-\pgf@x
11030 }
11031 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11032 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11033 \anchor{north west}{ \northwest }
11034 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11035
11036 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11037
11038 % let's start drawing the component
11039 \backgroundpath{
11040 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11041 %
11042 \northwest
11043 \pgf@circ@res@up = \pgf@y
11044 \pgf@circ@res@down = -\pgf@y
11045 \pgf@circ@res@right = -\pgf@x
11046 \pgf@circ@res@left = \pgf@x
11047 % main component, normally in thicker lines
11048 \pgfscope
11049 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11050 \pgftransformxshift{.7\pgf@circ@res@left}
11051 \pgf@circ@res@step=\pgf@circ@res@right
11052 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11053 \pgf@circ@res@step=.7\pgf@circ@res@step
11054 %first point (near output)
11055 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
11056 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
11057 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
11058 % and then to the input "front up", "down", to the output short side "down"
11059 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11060 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
11061 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
11062 % ...and close
11063 \pgfpathclose
11064 \pgf@circ@draworfill
11065 \endpgfscope
11066 % input terminal -
11067 \pgfpathmoveto{\pgfpoint
11068 {\pgf@circ@res@left}
11069 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
11070 %
11071 \pgfpathlineto{\pgfpoint
11072 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11073 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
11074 %
11075 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
11076
11077 % input terminal +
11078 \pgfpathmoveto{\pgfpoint
11079 {\pgf@circ@res@left}
11080 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
11081 %
11082 \pgfpathlineto{\pgfpoint
11083 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11084 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
11085 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
11086 % output lead
11087 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11088 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
11089 %
11090 \pgfsetrectcap
11091 \pgfusepath{draw}
11092 }
11093 }
11094
11095 % instrumentation amplifier, with terminals for gain resistance between inputs
11096 \pgfdeclareshape{inst amp ra}
11097 {
11098 \anchor{center}{\pgfpointorigin}
11099 % bounding-box top left
11100 \savedanchor\northwest{%
11101 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11102 \pgf@y=.5\pgf@y
11103 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11104 \pgf@x=.5\pgf@x
11105 }
11106 \anchor{nw}{
11107 \northwest
11108 }
11109 \anchor{south}{
11110 \northwest
11111 \pgf@y=-\pgf@y\pgf@x=0pt\relax
11112 }
11113 \anchor{north}{
11114 \northwest\pgf@x=0pt\relax
11115 }
11116 \savedanchor\left{%
11117 \pgf@y=0pt
11118 }
11119 \anchor{leftedge}
11120 {\left
11121 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
11122 }
11123 % inputs (+-)
11124 \savedanchor\inOneFixed{%
11125 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11126 \pgf@y=.5\pgf@y
11127 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11128 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11129 \pgf@x=.5\pgf@x
11130 }
11131 \anchor{in up}{
11132 \inOneFixed
11133 }
11134 \anchor{in down}{
11135 \inOneFixed
11136 \pgf@y=-\pgf@y
11137 }
11138 \savedanchor\inOne{%
11139 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11140 \pgf@y=.5\pgf@y
11141 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@y
11142 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11143 \pgf@x=.5\pgf@x
11144 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11145 }
11146 \anchor{-}{
11147 \inOne
11148 }
11149 \anchor{+}{
11150 \inOne
11151 \pgf@y=-\pgf@y
11152 }
11153 % R ampli anchors. They are by default at 20% more than R-length distance
11154 % you can change that with the `ra pos` key (use 0.5 for one-R).
11155 \savedanchor\raOneFixed{%
11156 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11157 \pgf@y=.5\pgf@y
11158 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11159 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11160 \pgf@x=.5\pgf@x
11161 }
11162 \anchor{ra up}{
11163 \inOneFixed
11164 }
11165 \anchor{ra down}{
11166 \inOneFixed
11167 \pgf@y=-\pgf@y
11168 }
11169 \savedanchor\raOne{%
11170 \pgf@y=\pgf@circ@Rlen
11171 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@y
11172 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11173 \pgf@x=.5\pgf@x
11174 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11175 }
11176 \anchor{ra-}{
11177 \raOne
11178 }
11179 \anchor{ra+}{
11180 \raOne
11181 \pgf@y=-\pgf@y
11182 }
11183 % power supplies
11184 \savedanchor\up{%
11185 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11186 \pgf@y=.5\pgf@y
11187 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11188 \pgf@x=.5\pgf@x
11189 \pgf@circ@res@up = \pgf@y
11190 \pgf@circ@res@right = -\pgf@x
11191 \pgf@circ@res@left = \pgf@x
11192 \pgfpointlineattime{
11193 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/up pos}}{
11194 \pgfpoint{
11195 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11196 {\pgf@circ@res@up}}
11197 {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11198 }
11199 \anchor{up}{
11200 \up
11201 }
11202 \anchor{down}{
11203 \up
11204 \pgf@y=-\pgf@y
11205 }
11206 % reference voltage input anchors.
11207 \savedanchor\refv{%
11208 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11209 \pgf@y=0.5\pgf@y
11210 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11211 \pgf@x=0.5\pgf@x
11212 \pgf@circ@res@up = \pgf@y
11213 \pgf@circ@res@right = -\pgf@x
11214 \pgf@circ@res@left = \pgf@x
11215 \pgfpointlineattime{
11216 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/refv pos}}{
11217 \pgfpoint{
11218 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11219 {\pgf@circ@res@up}}
11220 {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11221 }
11222 % we need both because they are normally drawn under the amp, and if you
11223 % mirror it vertically you need them
11224 \anchor{refv up}{
11225 \refv
11226 }
11227 \anchor{refv down}{
11228 \refv
11229 \pgf@y=-\pgf@y
11230 }
11231 \anchor{out}{
11232 \northwest
11233 \pgf@y=0pt
11234 \pgf@x=-\pgf@x
11235 }
11236 \anchor{west}{
11237 \left
11238 }
11239 \anchor{east}{
11240 \left
11241 \pgf@x=-\pgf@x
11242 }
11243 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11244 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11245 \anchor{north west}{ \northwest }
11246 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11247
11248 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11249
11250 % drawing of the component
11251 \backgroundpath{
11252 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11253
11254 \northwest
11255 \pgf@circ@res@up = \pgf@y
11256 \pgf@circ@res@down = -\pgf@y
11257 \pgf@circ@res@right = -\pgf@x
11258 \pgf@circ@res@left = \pgf@x
11259
11260 % main component, normally in thicker lines
11261 \pgfscope
11262 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11263 \pgftransformxshift{.7\pgf@circ@res@left}
11264 \pgf@circ@res@step=\pgf@circ@res@right
11265 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11266 \pgf@circ@res@step=.7\pgf@circ@res@step
11267 %primer punto: la linea de salida (lado componente)
11268 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
11269 %from the exit to the top (short side)... (note that the .4 must be copied in \up anchor
11270 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11271 % and then to the input "front up", "down", to the output short side "down"
11272 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11273 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
11274 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@down}}
11275 % ...and close
11276 \pgfpathclose
11277 \pgf@circ@draworfill
11278 \endpgfscope
11279
11280 % ra terminal -
11281 \pgfpathmoveto{\pgfpoint
11282 {\pgf@circ@res@left}
11283 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11284 %
11285 \pgfpathlineto{\pgfpoint
11286 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11287 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11288 % ra terminal +
11289 \pgfpathmoveto{\pgfpoint
11290 {\pgf@circ@res@left}
11291 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11292 %
11293 \pgfpathlineto{\pgfpoint
11294 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11295 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11296 % input terminal -
11297 \pgfpathmoveto{\pgfpoint
11298 {\pgf@circ@res@left}
11299 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
11300 %
11301 \pgfpathlineto{\pgfpoint
11302 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11303 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
11304 %
11305 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
11306
11307 % input terminal +
11308 \pgfpathmoveto{\pgfpoint
11309 {\pgf@circ@res@left}
11310 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
11311 %
11312 \pgfpathlineto{\pgfpoint
11313 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11314 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
11315 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
11316 % output lead
11317 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11318 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
11319 %
11320 \pgfsetrectcap
11321 \pgfusepath{draw}
11322 }
11323 }
11324 %% Potentiometer
11325 \pgfcircdeclarebipole{
11326 \anchor{wiper}{
11327 \northeast
11328 \pgfpoint{0pt}{\pgf@y}
11329 }
11330 \anchor{W}{
11331 \northeast
11332 \pgfpoint{0pt}{\pgf@y}
11333 }
11334 }
11335 {\ctikzvalof{bipoles/potentiometer/height 2}}
11336 {potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}
11337 {\ctikzvalof{bipoles/potentiometer/width}}
11338 {
11339 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11340 \pgftransformationadjustments
11341 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
11342 \divide \pgf@circ@res@step by 12
11343
11344 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
11345
11346 \pgf@circ@res@other = \pgf@circ@res@left
11347 \advance\pgf@circ@res@other by \pgf@circ@res@step
11348 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11349 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11350 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11351 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11352 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11353 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11354 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11355 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11356 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11357 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11358 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11359 \advance\pgf@circ@res@other by \pgf@circ@res@step
11360 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
11361 \pgfsetbeveljoin
11362 \pgfusepath{draw}
11363
11364 \pgfscope
11365 %\pgfsetlinewidth{\pgfstartlinewidth}
11366 \pgfsetarrowsend{latexslim}
11367 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11368 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
11369 \pgfusepath{draw}
11370 \endpgfscope
11371 }
11372
11373
11374
11375
11376
11377 %% Generic tunable
11378
11379 \pgfcircdeclarebipole{
11380 \anchor{wiper}{
11381 \northeast
11382 \pgfpoint{0pt}{\pgf@y}
11383 }
11384 }
11385 {\ctikzvalof{bipoles/generic potentiometer/height 2}}
11386 {genericpotentiometer}
11387 {\ctikzvalof{bipoles/generic potentiometer/height}}
11388 {\ctikzvalof{bipoles/generic potentiometer/width}}
11389 {
11390
11391 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
11392 \divide \pgf@circ@res@step by 14
11393
11394 \pgfscope
11395 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11396 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11397 \pgf@circ@draworfill
11398 \endpgfscope
11399 \pgfscope
11400 %\pgfsetlinewidth{\pgfstartlinewidth}
11401 \pgfsetarrowsend{latexslim}
11402 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11403 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
11404 \pgfusepath{draw}
11405 \endpgfscope
11406 }
11407
11408
11409 \pgfdeclareshape{mixer}
11410 {
11411 \savedanchor\northwest{
11412 \ifpgf@circuit@boxed
11413 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11414 \pgf@y=.5\pgf@y
11415 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11416 \pgf@x=.5\pgf@x
11417 \else
11418 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
11419 \pgf@y=.5\pgf@y
11420 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
11421 \pgf@x=.5\pgf@x
11422 \fi
11423 }
11424 \anchor{center}{
11425 \pgfpointorigin
11426 }
11427 \anchor{left}{%
11428 \northwest
11429 \pgf@y=0pt
11430 }
11431 \anchor{1}{
11432 \northwest
11433 \pgf@y=0pt
11434 }
11435 \anchor{2}{
11436 \northwest
11437 \pgf@y=-\pgf@y
11438 \pgf@x=0pt
11439 }
11440 \anchor{3}{
11441 \northwest
11442 \pgf@y=0pt
11443 \pgf@x=-\pgf@x
11444 }
11445 \anchor{4}{
11446 \northwest
11447 \pgf@y=\pgf@y
11448 \pgf@x=0pt
11449 }
11450 \anchor{in 1}{
11451 \northwest
11452 \pgf@y=0pt
11453 }
11454 \anchor{in1}{
11455 \northwest
11456 \pgf@y=0pt
11457 }
11458 \anchor{in}{
11459 \northwest
11460 \pgf@y=0pt
11461 }
11462 \anchor{in 2}{
11463 \northwest
11464 \pgf@y=-\pgf@y
11465 \pgf@x=0pt
11466 }
11467 \anchor{in2}{
11468 \northwest
11469 \pgf@y=-\pgf@y
11470 \pgf@x=0pt
11471 }
11472 \anchor{out}{
11473 \northwest
11474 \pgf@y=0pt
11475 \pgf@x=-\pgf@x
11476 }
11477 \anchor{center}{
11478 \pgf@y=0pt
11479 \pgf@x=0pt
11480 }
11481 \anchor{east}{
11482 \northwest
11483 \pgf@y=0pt
11484 \pgf@x=-\pgf@x
11485 }
11486 \anchor{west}{
11487 \northwest
11488 \pgf@y=0pt
11489 }
11490 \anchor{south}{
11491 \northwest
11492 \pgf@x=0pt
11493 \pgf@y=-\pgf@y
11494 }
11495 \anchor{north}{
11496 \northwest
11497 \pgf@x=0pt
11498 }
11499 \anchor{south west}{
11500 \northwest
11501 \pgf@y=-\pgf@y
11502 }
11503 \anchor{north east}{
11504 \northwest
11505 \pgf@x=-\pgf@x
11506 }
11507 \anchor{north west}{
11508 \northwest
11509 }
11510 \anchor{south east}{
11511 \northwest
11512 \pgf@x=-\pgf@x
11513 \pgf@y=-\pgf@y
11514 }
11515 \backgroundpath{
11516 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11517
11518 \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
11519
11520 \pgfscope
11521 \pgfstartlinewidth=\pgflinewidth
11522
11523 % draw outer box
11524 \ifpgf@circuit@boxed
11525 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11526 \fi
11527
11528 % draw outer circle
11529 \ifpgf@circuit@boxed
11530 \pgf@circ@res@step=.7\pgf@circ@res@step
11531 \pgfsetdash{}{0pt} % draw solid circle if boxed
11532 \else
11533 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11534 \fi
11535 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11536 \pgf@circ@draworfill
11537
11538 % draw inner stuff
11539 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11540 \pgfsetlinewidth{\pgfstartlinewidth}
11541 \pgfpathmoveto{\pgfpointorigin}
11542 \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
11543 \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
11544 \pgfpathmoveto{\pgfpointorigin}
11545 \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
11546 \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
11547 \pgfusepath{draw}
11548
11549 \endpgfscope
11550 }
11551 }
11552
11553 \pgfdeclareshape{adder}
11554 {
11555 \savedanchor\northwest{
11556 \ifpgf@circuit@boxed
11557 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11558 \pgf@y=.5\pgf@y
11559 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11560 \pgf@x=.5\pgf@x
11561 \else
11562 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
11563 \pgf@y=.5\pgf@y
11564 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
11565 \pgf@x=.5\pgf@x
11566 \fi
11567 }
11568 \anchor{center}{
11569 \pgfpointorigin
11570 }
11571 \anchor{left}{%
11572 \northwest
11573 \pgf@y=0pt
11574 }
11575 \anchor{1}{
11576 \northwest
11577 \pgf@y=0pt
11578 }
11579 \anchor{2}{
11580 \northwest
11581 \pgf@y=-\pgf@y
11582 \pgf@x=0pt
11583 }
11584 \anchor{3}{
11585 \northwest
11586 \pgf@y=0pt
11587 \pgf@x=-\pgf@x
11588 }
11589 \anchor{4}{
11590 \northwest
11591 \pgf@y=\pgf@y
11592 \pgf@x=0pt
11593 }
11594 \anchor{in 1}{
11595 \northwest
11596 \pgf@y=0pt
11597 }
11598 \anchor{in1}{
11599 \northwest
11600 \pgf@y=0pt
11601 }
11602 \anchor{in}{
11603 \northwest
11604 \pgf@y=0pt
11605 }
11606 \anchor{in 2}{
11607 \northwest
11608 \pgf@y=-\pgf@y
11609 \pgf@x=0pt
11610 }
11611 \anchor{in2}{
11612 \northwest
11613 \pgf@y=-\pgf@y
11614 \pgf@x=0pt
11615 }
11616 \anchor{out}{
11617 \northwest
11618 \pgf@y=0pt
11619 \pgf@x=-\pgf@x
11620 }
11621 \anchor{center}{
11622 \pgf@y=0pt
11623 \pgf@x=0pt
11624 }
11625 \anchor{east}{
11626 \northwest
11627 \pgf@y=0pt
11628 \pgf@x=-\pgf@x
11629 }
11630 \anchor{west}{
11631 \northwest
11632 \pgf@y=0pt
11633 }
11634 \anchor{south}{
11635 \northwest
11636 \pgf@x=0pt
11637 \pgf@y=-\pgf@y
11638 }
11639 \anchor{north}{
11640 \northwest
11641 \pgf@x=0pt
11642 }
11643 \anchor{south west}{
11644 \northwest
11645 \pgf@y=-\pgf@y
11646 }
11647 \anchor{north east}{
11648 \northwest
11649 \pgf@x=-\pgf@x
11650 }
11651 \anchor{north west}{
11652 \northwest
11653 }
11654 \anchor{south east}{
11655 \northwest
11656 \pgf@x=-\pgf@x
11657 \pgf@y=-\pgf@y
11658 }
11659 \backgroundpath{
11660 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11661
11662 \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
11663
11664 \pgfscope
11665 \pgfstartlinewidth=\pgflinewidth
11666
11667 % draw outer box
11668 \ifpgf@circuit@boxed
11669 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11670 \fi
11671
11672 % draw outer circle
11673 \ifpgf@circuit@boxed
11674 \pgf@circ@res@step=.7\pgf@circ@res@step{}
11675 \pgfsetdash{}{0pt} % draw solid circle if boxed
11676 \else
11677 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11678 \fi
11679 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11680 \pgf@circ@draworfill
11681
11682 % draw inner stuff
11683 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11684 \pgfsetlinewidth{\pgfstartlinewidth}
11685
11686 \pgfpathmoveto{\pgfpointorigin}
11687 \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
11688 \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
11689 \pgfpathmoveto{\pgfpointorigin}
11690 \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
11691 \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
11692 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11693 \pgfusepath{draw}
11694
11695 \endpgfscope
11696 }
11697 }
11698
11699 \pgfdeclareshape{oscillator}
11700 {
11701 \savedanchor\northwest{
11702 \ifpgf@circuit@boxed
11703 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11704 \pgf@y=.5\pgf@y
11705 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11706 \else
11707 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
11708 \pgf@y=.5\pgf@y
11709 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
11710 \fi
11711 }
11712 \anchor{center}{
11713 \pgfpointorigin
11714 }
11715 \anchor{north}{
11716 \northwest
11717 \pgf@x=.5\pgf@x
11718 }
11719 \anchor{south}{
11720 \northwest
11721 \pgf@x=.5\pgf@x
11722 \pgf@y=-\pgf@y
11723 }
11724 \anchor{east}{
11725 \northwest
11726 \pgf@y=0pt
11727 \pgf@x=0pt
11728 }
11729 \anchor{west}{
11730 \northwest
11731 \pgf@y=0pt
11732 }
11733 \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
11734 \anchor{north east}{ \northwest \pgf@x=0pt\relax}
11735 \anchor{north west}{ \northwest }
11736 \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
11737 \anchor{text}{
11738 \pgf@x=-2\pgf@x
11739 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
11740 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
11741 }
11742 \backgroundpath{
11743 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11744
11745 \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{}
11746
11747 \pgfscope
11748 \pgfstartlinewidth=\pgflinewidth
11749
11750 \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
11751
11752 % draw outer box
11753 \ifpgf@circuit@boxed{}
11754 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11755 \fi
11756
11757 % draw outer circle
11758 \ifpgf@circuit@boxed
11759 \pgf@circ@res@step=.7\pgf@circ@res@step{}
11760 \pgfsetdash{}{0pt} % draw solid circle if boxed
11761 \else
11762 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11763 \fi
11764 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11765 \pgf@circ@draworfill
11766
11767 % draw inner sine waves
11768 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11769 \pgfsetlinewidth{\pgfstartlinewidth}
11770 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
11771 \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
11772 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
11773 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
11774 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
11775 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
11776
11777 \pgfusepath{draw}
11778
11779 \endpgfscope
11780 }
11781 }
11782
11783 \pgfdeclareshape{circulator}
11784 {
11785 \savedanchor\northwest{
11786 \ifpgf@circuit@boxed
11787 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11788 \pgf@y=.5\pgf@y
11789 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11790 \pgf@x=.5\pgf@x
11791 \else
11792 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
11793 \pgf@y=.5\pgf@y
11794 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
11795 \pgf@x=.5\pgf@x
11796 \fi
11797 }
11798 \anchor{center}{
11799 \pgfpointorigin
11800 }
11801 \anchor{left}{%
11802 \northwest
11803 \pgf@y=0pt
11804 }
11805 \anchor{1}{
11806 \northwest
11807 \pgf@y=0pt
11808 }
11809 \anchor{2}{
11810 \northwest
11811 \pgf@y=0pt
11812 \pgf@x=-\pgf@x
11813 }
11814 \anchor{3}{
11815 \northwest
11816 \pgf@y=-\pgf@y
11817 \pgf@x=0pt
11818 }
11819 \anchor{east}{
11820 \northwest
11821 \pgf@y=0pt
11822 \pgf@x=-\pgf@x
11823 }
11824 \anchor{west}{
11825 \northwest
11826 \pgf@y=0pt
11827 }
11828 \anchor{south}{
11829 \northwest
11830 \pgf@x=0pt
11831 \pgf@y=-\pgf@y
11832 }
11833 \anchor{north}{
11834 \northwest
11835 \pgf@x=0pt
11836 }
11837 \anchor{south west}{
11838 \northwest
11839 \pgf@y=-\pgf@y
11840 }
11841 \anchor{north east}{
11842 \northwest
11843 \pgf@x=-\pgf@x
11844 }
11845 \anchor{north west}{
11846 \northwest
11847 }
11848 \anchor{south east}{
11849 \northwest
11850 \pgf@x=-\pgf@x
11851 \pgf@y=-\pgf@y
11852 }
11853 \backgroundpath{
11854 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11855
11856 \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
11857
11858 \pgfscope
11859 \pgfstartlinewidth=\pgflinewidth
11860
11861 % draw outer box
11862 \ifpgf@circuit@boxed
11863 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11864 \fi
11865
11866 % draw outer circle
11867 \ifpgf@circuit@boxed{}
11868 \pgf@circ@res@step=.7\pgf@circ@res@step{}
11869 \pgfsetdash{}{0pt} % draw solid circle if boxed
11870 \else
11871 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11872 \fi
11873 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11874 \pgf@circ@draworfill
11875
11876 % inner arrow
11877 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11878 \pgfsetlinewidth{\pgfstartlinewidth}
11879
11880 \pgfsetarrowsend{latex}
11881 \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
11882 \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
11883 \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
11884 \pgfusepath{draw}
11885
11886 \endpgfscope
11887 }
11888 }
11889
11890
11891 % Wilkinson divider
11892 \pgfdeclareshape{wilkinson}{
11893 \anchor{center}{
11894 \northwest
11895 \pgf@x=0pt
11896 \pgf@y=0pt
11897 }
11898 \savedanchor\northwest{%
11899 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@circ@Rlen
11900 \pgf@y=.5\pgf@y
11901 \pgf@x= \pgf@circ@Rlen
11902 \pgf@x=.5\pgf@x
11903 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
11904 }
11905 \anchor{north}{
11906 \northwest
11907 \pgf@x=0pt
11908 }
11909 \anchor{south}{
11910 \northwest
11911 \pgf@x=0pt
11912 \pgf@y=-\pgf@y
11913 }
11914 \anchor{west}{
11915 \northwest
11916 \pgf@y=0pt
11917 }
11918 \anchor{east}{
11919 \northwest
11920 \pgf@y=0pt
11921 \pgf@x=-\pgf@x
11922 }
11923 \anchor{south west}{
11924 \northwest
11925 \pgf@y=-\pgf@y
11926 }
11927 \anchor{north east}{
11928 \northwest
11929 \pgf@x=-\pgf@x
11930 }
11931 \anchor{north west}{
11932 \northwest
11933 }
11934 \anchor{south east}{
11935 \northwest
11936 \pgf@x=-\pgf@x
11937 \pgf@y=-\pgf@y
11938 }
11939 \anchor{in}{
11940 \northwest
11941 \pgf@y=0pt
11942 }
11943 \anchor{out1}{
11944 \northwest
11945 \pgf@x=-\pgf@x
11946 \pgf@y=-0.5\pgf@y
11947 }
11948 \anchor{out2}{
11949 \northwest
11950 \pgf@x=-\pgf@x
11951 \pgf@y=0.5\pgf@y
11952 }
11953 \anchor{text}{
11954 \northwest
11955 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
11956 \pgf@x=-.5\wd\pgfnodeparttextbox
11957 }
11958 \backgroundpath{
11959 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11960
11961 \northwest
11962 \pgf@circ@res@up = \pgf@y
11963 \pgf@circ@res@down = -\pgf@y
11964 \pgf@circ@res@right = -\pgf@x
11965 \pgf@circ@res@left = \pgf@x
11966
11967 \pgfstartlinewidth=\pgflinewidth
11968
11969 % draw outer box
11970 \pgf@circ@twoportbox
11971
11972 % draw inner stuff
11973 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11974 \pgfsetarrows{-} %never draw arrows
11975 \pgfsetlinewidth{\pgfstartlinewidth}
11976 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
11977 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
11978 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
11979 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
11980 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
11981 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
11982 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
11983
11984 \pgfusepath{draw}
11985
11986 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11987 % draw inner resisitor - european or american style is recognised
11988 {
11989 \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
11990 \pgftransformrotate{90}
11991
11992 % calculate size of resistor
11993 \ifpgf@circuit@europeanresistor
11994 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
11995 \pgftransformscale{\pgfmathresult}
11996 \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
11997 \else
11998 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
11999 \pgftransformscale{\pgfmathresult}
12000 \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
12001 \fi
12002 }
12003
12004 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
12005 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
12006
12007 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
12008 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
12009 \pgfusepath{draw}
12010
12011 }
12012 }
12013
12014 % electromechanical device (motor/generator)
12015 \pgfdeclareshape{elmech}
12016 {
12017 \savedanchor\northwest{
12018 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@circ@Rlen
12019 \pgf@y=.5\pgf@y
12020 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@circ@Rlen
12021 \pgf@x=.5\pgf@x
12022 }
12023 \anchor{center}{
12024 \pgfpointorigin
12025 }
12026 \anchor{text}{
12027 \pgfpointorigin
12028 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
12029 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
12030 }
12031 \anchor{left}{%
12032 \northwest
12033 \pgf@y=0pt
12034 }
12035 \anchor{right}{%
12036 \northwest
12037 \pgf@y=0pt
12038 \pgf@x=-\pgf@x
12039 }
12040 \anchor{top}{
12041 \northwest
12042 \pgf@x=0pt
12043 }
12044 \anchor{pathstart}{
12045 \northwest
12046 \pgf@x=0pt
12047 }
12048 \anchor{pathend}{
12049 \northwest
12050 \pgf@x=0pt
12051 \pgf@y=-\pgf@y
12052 }
12053 \anchor{bottom}{
12054 \northwest
12055 \pgf@x=0pt
12056 \pgf@y=-\pgf@y
12057 }
12058 \anchor{center}{
12059 \pgf@y=0pt
12060 \pgf@x=0pt
12061 }
12062 \anchor{east}{
12063 \northwest
12064 \pgf@y=0pt
12065 \pgf@x=-\pgf@x
12066 }
12067 \anchor{west}{
12068 \northwest
12069 \pgf@y=0pt
12070 }
12071 \anchor{south}{
12072 \northwest
12073 \pgf@x=0pt
12074 \pgf@y=-\pgf@y
12075 }
12076 \anchor{north}{
12077 \northwest
12078 \pgf@x=0pt
12079 }
12080 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12081 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12082 \anchor{north west}{ \northwest }
12083 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12084 \backgroundpath{
12085 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12086 \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen
12087 \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
12088 \pgfscope
12089 \pgfstartlinewidth=\pgflinewidth
12090 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12091 \pgfscope % clip the bar: whole size minus the circle
12092 \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
12093 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12094 \pgfseteorule
12095 \pgfusepath{clip}
12096 \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
12097 \pgfsetfillcolor{black}
12098 \pgfusepath{fill, draw}
12099 \endpgfscope
12100 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12101 \ifx\tikz@fillcolor\pgfutil@empty
12102 \pgfsetfillcolor{white}
12103 \else
12104 \pgfsetfillcolor{\tikz@fillcolor}
12105 \fi
12106 \pgfusepath{draw, fill}
12107 \endpgfscope
12108 }
12109 }
12110
12111 \pgfdeclareshape{magnetron}
12112 {
12113 \savedanchor\northwest{
12114 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
12115 \pgf@y=.5\pgf@y
12116 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
12117 \pgf@x=.5\pgf@x
12118 }
12119 \anchor{center}{
12120 \pgfpointorigin
12121 }
12122 \anchor{anode}{
12123 \northwest
12124 \pgf@x=0pt
12125 \pgf@y=-\pgf@y
12126 }
12127 \anchor{cathode1}{
12128 \northwest
12129 \pgf@circ@res@step=\pgf@y
12130 \pgfmathparse{cos(105)}
12131 \pgf@x=\pgfmathresult\pgf@circ@res@step
12132 \pgfmathparse{sin(105)}
12133 \pgf@y=\pgfmathresult\pgf@circ@res@step
12134 %\pgfpointorigin
12135 %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
12136 }
12137 \anchor{cathode2}{
12138 \northwest
12139 \pgf@circ@res@step=\pgf@y
12140 \pgfmathparse{cos(75)}
12141 \pgf@x=\pgfmathresult\pgf@circ@res@step
12142 \pgfmathparse{sin(75)}
12143 \pgf@y=\pgfmathresult\pgf@circ@res@step
12144 %\pgfpointorigin
12145 %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
12146 }
12147 \anchor{text}{
12148 \pgfpointorigin
12149 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
12150 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
12151 }
12152 \anchor{left}{%
12153 \northwest
12154 \pgf@y=0pt
12155 }
12156 \anchor{right}{%
12157 \northwest
12158 \pgf@y=0pt
12159 \pgf@x=-\pgf@x
12160 }
12161 \anchor{top}{
12162 \northwest
12163 \pgf@x=0pt
12164 }
12165 \anchor{pathstart}{
12166 \northwest
12167 \pgf@x=0pt
12168 }
12169 \anchor{pathend}{
12170 \northwest
12171 \pgf@x=0pt
12172 \pgf@y=-\pgf@y
12173 }
12174 \anchor{bottom}{
12175 \northwest
12176 \pgf@x=0pt
12177 \pgf@y=-\pgf@y
12178 }
12179 \anchor{center}{
12180 \pgf@y=0pt
12181 \pgf@x=0pt
12182 }
12183 \anchor{east}{
12184 \northwest
12185 \pgf@y=0pt
12186 \pgf@x=-\pgf@x
12187 }
12188 \anchor{west}{
12189 \northwest
12190 \pgf@y=0pt
12191 }
12192 \anchor{south}{
12193 \northwest
12194 \pgf@x=0pt
12195 \pgf@y=-\pgf@y
12196 }
12197 \anchor{north}{
12198 \northwest
12199 \pgf@x=0pt
12200 }
12201 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12202 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12203 \anchor{north west}{ \northwest }
12204 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12205 \backgroundpath{
12206 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12207 \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@Rlen
12208 \northwest
12209 \pgf@circ@res@up = \pgf@y
12210 \pgf@circ@res@down = -\pgf@y
12211 \pgf@circ@res@right = -\pgf@x
12212 \pgf@circ@res@left = \pgf@x
12213 \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
12214
12215 \pgfscope
12216 \pgfstartlinewidth=\pgflinewidth
12217 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12218 %create outer circle
12219 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
12220 \pgf@circ@draworfill
12221 %create chambers
12222 \foreach \angle in {45,135,225,315}{
12223 \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
12224 \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
12225 }
12226 \pgfsetroundcap
12227 \pgfusepath{draw}
12228 \pgfscope
12229 %draw connection from outside
12230 %anode
12231 \pgfsetlinewidth{\pgfstartlinewidth}
12232 \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
12233 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
12234 %cathodes
12235 \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
12236 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12237 \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
12238 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12239 \pgfsetbuttcap
12240 \pgfusepath{draw}
12241 \endpgfscope
12242 %create cathode
12243 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12244 \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
12245 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12246 \pgfusepath{draw}
12247 %create anode
12248 \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
12249 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
12250
12251 \pgfsetbuttcap
12252 \pgfusepath{draw}
12253 \endpgfscope
12254 }
12255 }
12256
12257 % Electronic tubes, submitted by J. op den Brouw
12258
12259 % Draw tube outline
12260 \def\pgf@circ@tubes@drawtube{%
12261 \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
12262 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12263 \pgfutil@tempdima=\pgf@circ@res@right
12264 \advance\pgfutil@tempdima by -\pgf@circ@res@up
12265 \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
12266 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
12267 \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
12268 \pgfpatharc{270}{90}{\pgf@circ@res@up}
12269 \else
12270 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
12271 \pgfutil@tempdima=\pgf@circ@res@up
12272 \advance\pgfutil@tempdima by -\pgf@circ@res@right
12273 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12274 \pgfpatharc{180}{0}{\pgf@circ@res@right}
12275 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
12276 \pgfpatharc{180}{0}{-\pgf@circ@res@right}
12277 \fi
12278 \pgfpathclose
12279 }
12280
12281 %% The diode (tube), triode, tetrode and pentode only differ in the
12282 %% number of grids. So we construct a generic declare function in
12283 %% which we can put code for the grid anchors and grid drawing code
12284 %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
12285 \long\def\pgfcircdeclaretube#1#2#3{%
12286 \pgfdeclareshape{#1}{
12287 \anchor{center}{
12288 \pgfpointorigin
12289 }
12290 \savedanchor\northwest{%
12291 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12292 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12293 % x and y should be half the Rlen
12294 \pgf@y=\pgf@circ@res@up
12295 \pgf@y=.5\pgf@y
12296 \pgf@x=-\pgf@circ@res@right
12297 \pgf@x=.5\pgf@x
12298 }
12299 \anchor{north} {%
12300 \northwest
12301 \pgf@x=0pt
12302 }
12303 \anchor{east}{%
12304 \northwest
12305 \pgf@x=-\pgf@x
12306 \pgf@y=0pt
12307 }
12308 \anchor{south}{%
12309 \northwest
12310 \pgf@y=-\pgf@y
12311 \pgf@x=0pt
12312 }
12313 \anchor{west}{%
12314 \northwest
12315 \pgf@y=0pt
12316 }
12317 \anchor{north west}{%
12318 \northwest
12319 }
12320 \anchor{north east}{%
12321 \northwest
12322 \pgf@x=-\pgf@x
12323 }
12324 \anchor{south east}{
12325 \northwest
12326 \pgf@x=-\pgf@x
12327 \pgf@y=-\pgf@y
12328 }
12329 \anchor{south west}{
12330 \northwest
12331 \pgf@y=-\pgf@y
12332 }
12333 \anchor{anode} {%
12334 \northwest
12335 \pgf@x=0pt
12336 }
12337 \anchor{cathode}{%
12338 \northwest
12339 \pgf@y=-\pgf@y
12340 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
12341 }
12342 \anchor{cathode 1}{%
12343 \northwest
12344 \pgf@y=-\pgf@y
12345 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
12346 }
12347 \anchor{cathode 2}{%
12348 \northwest
12349 \pgf@y=-\pgf@y
12350 \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
12351 }
12352 \anchor{filament 1}{%
12353 \northwest
12354 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12355 \pgf@x=\pgfmathresult\pgf@x
12356 \pgf@y=-\pgf@y
12357 }
12358 \anchor{filament 2}{%
12359 \northwest
12360 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12361 \pgf@x=-\pgfmathresult\pgf@x
12362 \pgf@y=-\pgf@y
12363 }
12364
12365 % Extra anchors
12366 #2
12367
12368 \backgroundpath{
12369 \pgfscope
12370 % Line width for tripoles
12371 \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
12372
12373 % Setup to draw tube
12374 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12375 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12376 \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
12377 \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12378
12379 % Tube fill color (if any)
12380 \ifx\tikz@fillcolor\pgfutil@empty
12381 \else
12382 \pgfscope
12383 \pgfsetfillcolor{\tikz@fillcolor}
12384 \pgf@circ@tubes@drawtube
12385 \pgfusepath{fill}
12386 \endpgfscope
12387 \fi
12388
12389 % Tube outline
12390 \pgf@circ@tubes@drawtube
12391
12392 % Setup to draw grid, filament, anode and cathode
12393 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12394 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12395 \pgf@circ@res@up=0.5\pgf@circ@res@up
12396 \pgf@circ@res@right=0.5\pgf@circ@res@right
12397
12398 % Grid drawing
12399 #3
12400
12401 % Filament (is not drawn by default)
12402 \ifpgf@circuit@tubes@filament
12403 \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
12404 \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
12405 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12406 \pgf@xa=\pgfmathresult\pgf@circ@res@right
12407 \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
12408 \pgf@ya=\pgfmathresult\pgf@circ@res@up
12409 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
12410 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
12411 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
12412 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
12413 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
12414 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
12415 \pgf@circuit@tubes@filamentfalse
12416 \fi
12417
12418 % Anode (or plate)
12419 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
12420 \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12421 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12422 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12423
12424 % Cathode
12425 \ifpgf@circuit@tubes@nocathode
12426 \pgf@circuit@tubes@nocathodefalse
12427 \else
12428 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
12429 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
12430 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
12431 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
12432 \ifpgf@circuit@tubes@fullcathode
12433 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
12434 \pgf@circuit@tubes@fullcathodefalse
12435 \else
12436 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
12437 \fi
12438 \fi
12439
12440 % Draw the background
12441 \pgfusepath{draw}
12442
12443 \endpgfscope
12444 }
12445 }
12446 }
12447
12448 \pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
12449
12450 \pgfcircdeclaretube{triode}
12451 {
12452 \anchor{grid} {% should not be used
12453 \northwest
12454 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12455 }
12456 \anchor{control} {%
12457 \northwest
12458 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12459 }
12460 }
12461 {
12462 % Grid protrusion
12463 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12464 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12465 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12466 \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12467 % Grid dashes: calculations
12468 \pgf@xb=2\pgf@circ@res@right
12469 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12470 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12471 \multiply\pgf@circ@count@a by 2\relax
12472 \advance\pgf@circ@count@a by 1\relax
12473 \advance\pgf@circ@res@step by -\pgf@xa
12474 \divide\pgf@circ@res@step by \pgf@circ@count@a
12475 % Grid dashes: draw
12476 \pgf@circ@res@temp=\pgf@xa
12477 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12478 \loop
12479 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12480 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12481 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12482 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12483 \advance\pgf@circ@count@a by-1
12484 \ifnum\pgf@circ@count@a>0\relax
12485 \repeat
12486 }
12487
12488 \pgfcircdeclaretube{tetrode}
12489 {
12490 \anchor{grid} {% should not be used
12491 \northwest
12492 \pgfutil@tempdima=\pgf@y
12493 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12494 \pgf@y=0.5\pgf@y
12495 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12496 }
12497 \anchor{control} {%
12498 \northwest
12499 \pgfutil@tempdima=\pgf@y
12500 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12501 \pgf@y=0.5\pgf@y
12502 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12503 }
12504 \anchor{screen} {%
12505 \northwest
12506 \pgfutil@tempdima=\pgf@y
12507 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
12508 \pgf@y=0.5\pgf@y
12509 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12510 }
12511 }
12512 {
12513 % Grid x/y points
12514 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12515 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12516 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12517 \pgfutil@tempdimb=-\pgfutil@tempdima
12518 \pgfutil@tempdima=0.5\pgfutil@tempdima
12519 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12520 \pgfutil@tempdimb=0.5\pgfutil@tempdimb
12521 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12522 % Grid protrusion
12523 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12524 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12525 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12526 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
12527 % Grid dashes: calculations
12528 \pgf@xb=2\pgf@circ@res@right
12529 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12530 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12531 \multiply\pgf@circ@count@a by 2\relax
12532 \advance\pgf@circ@count@a by 1\relax
12533 \advance\pgf@circ@res@step by -\pgf@xa
12534 \divide\pgf@circ@res@step by \pgf@circ@count@a
12535 % Grid dashes: draw
12536 \pgf@circ@res@temp=\pgf@xa
12537 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12538 \loop
12539 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12540 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12541 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12542 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12543 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12544 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12545 \advance\pgf@circ@count@a by-1
12546 \ifnum\pgf@circ@count@a>0\relax
12547 \repeat
12548 }
12549
12550 \pgfcircdeclaretube{pentode}
12551 {
12552 \anchor{grid} {% should not be used
12553 \northwest
12554 \pgfutil@tempdima=\pgf@y
12555 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12556 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12557 }
12558 \anchor{control} {%
12559 \northwest
12560 \pgfutil@tempdima=\pgf@y
12561 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12562 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12563 }
12564 \anchor{screen} {%
12565 \northwest
12566 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12567 }
12568 \anchor{suppressor} {%
12569 \northwest
12570 \pgfutil@tempdima=\pgf@y
12571 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
12572 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12573 }
12574 }
12575 {
12576 % Grid x/y points
12577 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12578 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12579 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12580 \pgfutil@tempdimb=-\pgfutil@tempdima
12581 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12582 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12583 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12584 % Grid protrusion
12585 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12586 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12587 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12588 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
12589 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
12590 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
12591 % Grid dashes: calculations
12592 \pgf@xb=2\pgf@circ@res@right
12593 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12594 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12595 \multiply\pgf@circ@count@a by 2\relax
12596 \advance\pgf@circ@count@a by 1\relax
12597 \advance\pgf@circ@res@step by -\pgf@xa
12598 \divide\pgf@circ@res@step by \pgf@circ@count@a
12599 % Grid dashes: draw
12600 \pgf@circ@res@temp=\pgf@xa
12601 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12602 \loop
12603 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12604 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12605 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12606 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12607 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12608 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
12609 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
12610 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12611 \advance\pgf@circ@count@a by-1
12612 \ifnum\pgf@circ@count@a>0\relax
12613 \repeat
12614 }
12615
12616 \pgfcircdeclaretube{pentode suppressor to cathode}
12617 {
12618 \anchor{grid} {% should not be used
12619 \northwest
12620 \pgfutil@tempdima=\pgf@y
12621 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12622 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12623 }
12624 \anchor{control} {%
12625 \northwest
12626 \pgfutil@tempdima=\pgf@y
12627 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12628 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12629 }
12630 \anchor{screen} {%
12631 \northwest
12632 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12633 }
12634 }
12635 {
12636 % Grid x/y points
12637 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12638 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12639 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12640 \pgfutil@tempdimb=-\pgfutil@tempdima
12641 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12642 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12643 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12644 % Grid protrusion
12645 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12646 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12647 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
12648 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
12649 % Grid dashes: calculations
12650 \pgf@xb=2\pgf@circ@res@right
12651 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12652 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12653 \multiply\pgf@circ@count@a by 2\relax
12654 \advance\pgf@circ@count@a by 1\relax
12655 \advance\pgf@circ@res@step by -\pgf@xa
12656 \divide\pgf@circ@res@step by \pgf@circ@count@a
12657 % Grid dashes: draw
12658 \pgf@circ@res@temp=\pgf@xa
12659 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12660 \loop
12661 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12662 \ifnum\pgf@circ@count@a>1\relax
12663 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12664 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12665 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
12666 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
12667 \fi
12668 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12669 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12670 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12671 \advance\pgf@circ@count@a by-1
12672 \ifnum\pgf@circ@count@a>0\relax
12673 \repeat
12674 % Grid: connection from suppressor to cathode
12675 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
12676 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
12677 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@[email protected]*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@[email protected]*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
12678
12679 }
12680
12681 %%%---------- close: tex/pgfcirctripoles
12682 %%%%%%%%%%% Springe nach tex/pgfcircquadpoles
12683 %%%---------- open: tex/pgfcircquadpoles.tex
12684 % Copyright 2007-2009 by Massimo Redaelli
12685 %
12686 % This file may be distributed and/or modified
12687 %
12688 % 1. under the LaTeX Project Public License and/or
12689 % 2. under the GNU Public License.
12690 %
12691 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
12692
12693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12694 %% Quadripoles
12695
12696 \long\def\pgfcircdeclarequadpole#1#2#3{
12697 \pgfdeclareshape{#1}
12698 {
12699 \anchor{center}{
12700 \northwest
12701 \pgf@x=0pt
12702 \pgf@y=0pt
12703 }
12704 \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
12705 \savedanchor\northwest{%
12706 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
12707 \pgf@y=.5\pgf@y
12708 \pgf@x=.5\pgf@circ@Rlen
12709 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
12710 }
12711 \anchor{A2}{
12712 \northwest
12713 \pgf@y=-\pgf@y
12714 }
12715 \anchor{B1}{
12716 \northwest
12717 \pgf@x=-\pgf@x
12718 }
12719 \anchor{A1}{
12720 \northwest
12721 }
12722 \anchor{B2}{
12723 \northwest
12724 \pgf@x=-\pgf@x
12725 \pgf@y=-\pgf@y
12726 }
12727 %% notice for the dot anchors: I use the cute inductors as reference
12728 %% size; if you change one you have to change all of them.
12729 \anchor{inner dot A1}{
12730 \northwest
12731 \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
12732 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12733 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
12734 }
12735 \anchor{outer dot A1}{
12736 \northwest
12737 \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
12738 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12739 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
12740 }
12741 \anchor{inner dot A2}{
12742 \northwest
12743 \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
12744 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12745 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
12746 }
12747 \anchor{outer dot A2}{
12748 \northwest
12749 \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
12750 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12751 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
12752 }
12753 \anchor{inner dot B1}{
12754 \northwest
12755 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
12756 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12757 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
12758 }
12759 \anchor{outer dot B1}{
12760 \northwest
12761 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
12762 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12763 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
12764 }
12765 \anchor{inner dot B2}{
12766 \northwest
12767 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
12768 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12769 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
12770 }
12771 \anchor{outer dot B2}{
12772 \northwest
12773 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
12774 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
12775 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
12776 }
12777 \anchor{north}{
12778 \northwest
12779 \pgf@x=0pt
12780 }
12781 \anchor{south}{
12782 \northwest
12783 \pgf@x=0pt
12784 \pgf@y=-\pgf@y
12785 }
12786 \anchor{west}{
12787 \northwest
12788 \pgf@y=0pt
12789 }
12790 \anchor{east}{
12791 \northwest
12792 \pgf@y=0pt
12793 \pgf@x=-\pgf@x
12794 }
12795 \anchor{south west}{
12796 \northwest
12797 \pgf@y=-\pgf@y
12798 }
12799 \anchor{north east}{
12800 \northwest
12801 \pgf@x=-\pgf@x
12802 }
12803 \anchor{north west}{
12804 \northwest
12805 }
12806 \anchor{south east}{
12807 \northwest
12808 \pgf@x=-\pgf@x
12809 \pgf@y=-\pgf@y
12810 }
12811 \anchor{base}{
12812 \northwest
12813 \pgf@x=0pt
12814 }
12815 #3
12816 \backgroundpath{
12817 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12818
12819 \northwest
12820 \pgf@circ@res@up = \pgf@y
12821 \pgf@circ@res@down = -\pgf@y
12822 \pgf@circ@res@right = -\pgf@x
12823 \pgf@circ@res@left = \pgf@x
12824 #2
12825 }
12826 }
12827 }
12828
12829
12830 \def\pgf@circ@drawtransformerbasicanchor{
12831 \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
12832 \anchor{AA2}{
12833 \northwest
12834 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
12835 \pgf@x=.7\pgf@x
12836 \pgf@y=-\pgf@y
12837 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
12838 }
12839 \anchor{BB1}{
12840 \northwest
12841 \pgf@x=-\pgf@x
12842 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
12843 \pgf@x=.7\pgf@x
12844 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
12845 }
12846 \anchor{AA1}{
12847 \northwest
12848 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
12849 \pgf@x=.7\pgf@x
12850 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
12851 }
12852 \anchor{BB2}{
12853 \northwest
12854 \pgf@x=-\pgf@x
12855 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
12856 \pgf@x=.7\pgf@x
12857 \pgf@y=-\pgf@y
12858 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
12859 }
12860 }
12861
12862 \def\pgf@circ@drawtransformerbasicbody{
12863 \pgfscope
12864 \pgfslopedattimetrue
12865 \pgfallowupsidedownattimetrue
12866 \pgftransformlineattime{.5}{%
12867 \pgfpoint%
12868 {\stretto\pgf@circ@res@left}%
12869 {\pgf@circ@res@up}%
12870 }{%
12871 \pgfpoint
12872 {\stretto\pgf@circ@res@left}%
12873 {\pgf@circ@res@down}%
12874 }
12875
12876 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
12877 \def\pgf@temp{european}%
12878 \ifx\pgf@temp\pgf@circ@temp%
12879 \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
12880 \else%
12881 \def\pgf@temp{cute}
12882 \ifx\pgf@temp\pgf@circ@temp%
12883 \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
12884 \else%
12885 \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
12886 \fi%
12887 \fi%
12888
12889
12890 \endpgfscope
12891 \pgfscope
12892 \pgfslopedattimetrue
12893 \pgfallowupsidedownattimetrue
12894 \pgftransformlineattime{.5}{%
12895 \pgfpoint%
12896 {\stretto\pgf@circ@res@right}%
12897 {\pgf@circ@res@down}%
12898 }{%
12899 \pgfpoint
12900 {\stretto\pgf@circ@res@right}%
12901 {\pgf@circ@res@up}%
12902 }
12903
12904 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
12905 \def\pgf@temp{european}%
12906 \ifx\pgf@temp\pgf@circ@temp%
12907 \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
12908 \else%
12909 \def\pgf@temp{cute}
12910 \ifx\pgf@temp\pgf@circ@temp%
12911 \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
12912 \else%
12913 \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
12914 \fi%
12915 \fi%
12916
12917 \endpgfscope
12918
12919 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
12920 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
12921 \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
12922
12923 \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
12924 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
12925 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
12926
12927 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
12928 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
12929 \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
12930
12931 \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
12932 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
12933 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
12934
12935 \pgfusepath{draw}
12936
12937 }
12938
12939
12940 \pgfcircdeclarequadpole{transformer}{
12941 \pgf@circ@drawtransformerbasicbody
12942 }{\pgf@circ@drawtransformerbasicanchor}
12943
12944 \pgfcircdeclarequadpole{transformer core}{
12945
12946 \pgf@circ@drawtransformerbasicbody
12947
12948 \pgfmoveto{\pgfpoint%
12949 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
12950 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
12951 }
12952 \pgflineto{
12953 \pgfpoint
12954 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
12955 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
12956 }
12957
12958 \pgfmoveto{\pgfpoint%
12959 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
12960 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
12961 }
12962 \pgflineto{
12963 \pgfpoint
12964 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
12965 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
12966 }
12967
12968 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
12969 \pgfusepath{draw}
12970 }{\pgf@circ@drawtransformerbasicanchor}
12971
12972
12973 \pgfcircdeclarequadpole{gyrator}{
12974
12975 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
12976 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
12977 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
12978 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
12979
12980 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
12981 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
12982 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
12983 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
12984
12985 \pgfusepath{draw}
12986
12987 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
12988 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
12989 \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
12990
12991 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
12992 \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
12993 \pgfusepath{draw}
12994
12995 }{}
12996
12997 %% four-port
12998 % defines a general outer box for four-ports
12999 % TikZ usage:
13000 % \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
13001 % (coup.port1) to[short,-o] ++(-1,0)
13002 %
13003
13004 \long\def\pgfcircdeclarefourport#1#2{
13005 \pgfdeclareshape{#1}{
13006 \anchor{center}{
13007 \northwest
13008 \pgf@x=0pt
13009 \pgf@y=0pt
13010 }
13011 \savedanchor\northwest{%
13012 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
13013 \pgf@y=.5\pgf@y
13014 \pgf@x=.5\pgf@circ@Rlen
13015 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
13016 }
13017 \anchor{north}{
13018 \northwest
13019 \pgf@x=0pt
13020 }
13021 \anchor{south}{
13022 \northwest
13023 \pgf@x=0pt
13024 \pgf@y=-\pgf@y
13025 }
13026 \anchor{west}{
13027 \northwest
13028 \pgf@y=0pt
13029 }
13030 \anchor{east}{
13031 \northwest
13032 \pgf@y=0pt
13033 \pgf@x=-\pgf@x
13034 }
13035 \anchor{south west}{
13036 \northwest
13037 \pgf@y=-\pgf@y
13038 }
13039 \anchor{north east}{
13040 \northwest
13041 \pgf@x=-\pgf@x
13042 }
13043 \anchor{north west}{
13044 \northwest
13045 }
13046 \anchor{south east}{
13047 \northwest
13048 \pgf@x=-\pgf@x
13049 \pgf@y=-\pgf@y
13050 }
13051 \anchor{port1}{
13052 \northwest
13053 \pgf@y=-0.5\pgf@y
13054 }
13055 \anchor{port2}{
13056 \northwest
13057 \pgf@x=-\pgf@x
13058 \pgf@y=-0.5\pgf@y
13059 }
13060 \anchor{port3}{
13061 \northwest
13062 \pgf@x=-\pgf@x
13063 \pgf@y=0.5\pgf@y
13064 }
13065 \anchor{port4}{
13066 \northwest
13067 \pgf@y=0.5\pgf@y
13068 }
13069 \anchor{1}{
13070 \northwest
13071 \pgf@y=-0.5\pgf@y
13072 }
13073 \anchor{2}{
13074 \northwest
13075 \pgf@x=-\pgf@x
13076 \pgf@y=-0.5\pgf@y
13077 }
13078 \anchor{3}{
13079 \northwest
13080 \pgf@x=-\pgf@x
13081 \pgf@y=0.5\pgf@y
13082 }
13083 \anchor{4}{
13084 \northwest
13085 \pgf@y=0.5\pgf@y
13086 }
13087
13088 \anchor{text}{
13089 \northwest
13090 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
13091 \pgf@x=-.5\wd\pgfnodeparttextbox
13092 }
13093 \backgroundpath{
13094 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13095
13096 \northwest
13097 \pgf@circ@res@up = \pgf@y
13098 \pgf@circ@res@down = -\pgf@y
13099 \pgf@circ@res@right = -\pgf@x
13100 \pgf@circ@res@left = \pgf@x
13101
13102 \pgfstartlinewidth=\pgflinewidth
13103
13104 % draw outer box
13105 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
13106 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
13107 \pgfusepath{draw}
13108
13109 % draw inner stuff
13110 #2
13111
13112 % draw inner text
13113 \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
13114 }
13115 }
13116 }
13117
13118 % four-port
13119 \pgfcircdeclarefourport{fourport}{}
13120
13121
13122 % straight coupler
13123 \pgfcircdeclarefourport{coupler}{
13124 \pgfsetlinewidth{\pgfstartlinewidth}
13125 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
13126 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
13127 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
13128 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
13129 \pgfusepath{draw}
13130
13131 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
13132 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
13133 \pgfsetarrows{latex-latex}
13134 \pgfusepath{draw}
13135 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
13136 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
13137 \pgfsetarrows{latex-latex}
13138 \pgfusepath{draw}
13139 }
13140
13141 % "bended" coupler
13142 \pgfcircdeclarefourport{coupler2}{
13143 \pgfsetlinewidth{\pgfstartlinewidth}
13144 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
13145 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
13146 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
13147 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
13148 \pgfusepath{draw}
13149
13150 \pgfscope
13151 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
13152 \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
13153 \pgfsetarrowsend{latex}
13154 \pgfusepath{draw}
13155 \endpgfscope
13156 \pgfscope
13157 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
13158 \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
13159 \pgfsetarrowsend{latex}
13160 \pgfusepath{draw}
13161 \endpgfscope
13162 \pgfscope
13163 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
13164 \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
13165 \pgfsetarrowsend{latex}
13166 \pgfusepath{draw}
13167 \endpgfscope
13168 \pgfscope
13169 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
13170 \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
13171 \pgfsetarrowsend{latex}
13172 \pgfusepath{draw}
13173 \endpgfscope
13174 }
13175
13176 % contrib Kristofer M. Monisit
13177
13178 \pgfdeclareshape{fd op amp}
13179 {
13180 \anchor{center}{\pgfpointorigin}
13181 \savedanchor\northwest{%
13182 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13183 \pgf@y=.5\pgf@y
13184 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13185 \pgf@x=.5\pgf@x
13186 }
13187 \savedanchor\outline{%
13188 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13189 \pgf@y=.5\pgf@y
13190 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13191 \pgf@x=.5\pgf@x
13192 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
13193 }
13194 \anchor{south}{
13195 \northwest
13196 \pgf@y=-\pgf@y\pgf@x=0pt\relax
13197 }
13198 \anchor{north}{
13199 \northwest\pgf@x=0pt\relax
13200 }
13201 \savedanchor\left{%
13202 \pgf@y=0pt
13203 }
13204 \savedanchor\inOneFixed{%
13205 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13206 \pgf@y=.5\pgf@y
13207 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13208 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13209 \pgf@x=.5\pgf@x
13210 }
13211 \anchor{in up}{
13212 \inOneFixed
13213 }
13214 \anchor{in down}{
13215 \inOneFixed
13216 \pgf@y=-\pgf@y
13217 }
13218 \savedanchor\inOne{%
13219 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13220 \pgf@y=.5\pgf@y
13221 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13222 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13223 \pgf@x=.5\pgf@x
13224 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13225 }
13226 \anchor{-}{
13227 \inOne
13228 }
13229 \anchor{+}{
13230 \inOne
13231 \pgf@y=-\pgf@y
13232 }
13233 \savedanchor\up{%
13234 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13235 \pgf@y=.5\pgf@y
13236 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13237 \pgf@x=.5\pgf@x
13238 \pgf@circ@res@up = \pgf@y
13239 \pgf@circ@res@right = -\pgf@x
13240 \pgf@circ@res@left = \pgf@x
13241 \pgfpointlineattime{
13242 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
13243 \pgfpoint{
13244 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13245 {\pgf@circ@res@up}}
13246 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
13247 }
13248 \anchor{up}{
13249 \up
13250 }
13251 \anchor{down}{
13252 \up
13253 \pgf@y=-\pgf@y
13254 }
13255 \anchor{out up}{
13256 \northwest
13257 \pgf@y=.5\pgf@y
13258 \pgf@x=-.7\pgf@x
13259 }
13260 \anchor{out down}{
13261 \northwest
13262 \pgf@y=-.5\pgf@y
13263 \pgf@x=-.7\pgf@x
13264 }
13265 \anchor{out +}{
13266 \outline
13267 \pgf@y=.5\pgf@y
13268 \pgf@x=-.7\pgf@x
13269 }
13270 \anchor{out -}{
13271 \outline
13272 \pgf@y=-.5\pgf@y
13273 \pgf@x=-.7\pgf@x
13274 }
13275 \anchor{west}{
13276 \left
13277 }
13278 \anchor{east}{
13279 \left
13280 \pgf@x=-.7\pgf@x
13281 }
13282
13283 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13284 \anchor{north east}{ \northwest \pgf@x=-.7\pgf@x }
13285 \anchor{north west}{ \northwest }
13286 \anchor{south east}{ \northwest \pgf@x=-.7\pgf@x \pgf@y=-\pgf@y }
13287 \backgroundpath{
13288 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13289
13290 \northwest
13291 \pgf@circ@res@up = \pgf@y
13292 \pgf@circ@res@down = -\pgf@y
13293 \pgf@circ@res@right = -\pgf@x
13294 \pgf@circ@res@left = \pgf@x
13295
13296 % Triangle
13297 \pgfscope
13298 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
13299 \pgftransformxshift{.7\pgf@circ@res@left}
13300 \pgf@circ@res@step=\pgf@circ@res@right
13301 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13302 \pgf@circ@res@step=.7\pgf@circ@res@step
13303 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13304 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13305 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13306 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13307 \pgfpathclose
13308 \pgf@circ@draworfill
13309 \endpgfscope
13310 % Negative input terminal
13311 \pgfpathmoveto{\pgfpoint
13312 {\pgf@circ@res@left}
13313 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13314 \pgfpathlineto{\pgfpoint
13315 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13316 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13317 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
13318
13319 % Positive input terminal
13320 \pgfpathmoveto{\pgfpoint
13321 {\pgf@circ@res@left}
13322 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13323 \pgfpathlineto{\pgfpoint
13324 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13325 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13326 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
13327
13328 % Negative output terminal
13329 \pgfpathmoveto{\pgfpoint
13330 {0.7\pgf@circ@res@right}
13331 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13332 \pgfpathlineto{\pgfpoint
13333 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
13334 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13335 \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@oplusup$-$\else$+$\fi}
13336
13337 % Positive output terminal
13338 \pgfpathmoveto{\pgfpoint
13339 {0.7\pgf@circ@res@right}
13340 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13341 \pgfpathlineto{\pgfpoint
13342 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
13343 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13344 \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf@circuit@oa@oplusup$+$\else$-$\fi}
13345
13346 \pgfsetrectcap
13347 % Draw them all!
13348 \pgfusepath{draw}
13349
13350 }
13351 }
13352
13353
13354 %% instrumentation amplifier diff output
13355
13356 \pgfdeclareshape{fd inst amp}
13357 {
13358 % when tikz calls the anchor it wants the relative position in the lengths
13359 % \pgf@x \pgf@y
13360 % \pgfpoint* functions set that variables
13361 % anchors are visible outside and run on use
13362 \anchor{center}{\pgfpointorigin}
13363 % savedanchors are internals and run on node creation (not use)
13364 % bounding-box top left
13365 \savedanchor\northwest{%
13366 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13367 \pgf@y=.5\pgf@y
13368 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13369 \pgf@x=.5\pgf@x
13370 }
13371 \anchor{nw}{
13372 \northwest
13373 }
13374 \anchor{south}{
13375 \northwest
13376 \pgf@y=-\pgf@y\pgf@x=0pt\relax
13377 }
13378 \anchor{north}{
13379 \northwest\pgf@x=0pt\relax
13380 }
13381 \savedanchor\left{%
13382 \pgf@y=0pt
13383 }
13384 \anchor{leftedge}
13385 {\left
13386 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
13387 }
13388 \savedanchor\inOneFixed{%
13389 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13390 \pgf@y=.5\pgf@y
13391 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13392 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13393 \pgf@x=.5\pgf@x
13394 }
13395 \anchor{in up}{
13396 \inOneFixed
13397 }
13398 \anchor{in down}{
13399 \inOneFixed
13400 \pgf@y=-\pgf@y
13401 }
13402 \savedanchor\inOne{%
13403 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13404 \pgf@y=.5\pgf@y
13405 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13406 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13407 \pgf@x=.5\pgf@x
13408 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13409 }
13410 \anchor{-}{
13411 \inOne
13412 }
13413 \anchor{+}{
13414 \inOne
13415 \pgf@y=-\pgf@y
13416 }
13417 \savedanchor\up{%
13418 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13419 \pgf@y=.5\pgf@y
13420 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13421 \pgf@x=.5\pgf@x
13422 \pgf@circ@res@up = \pgf@y
13423 \pgf@circ@res@right = -\pgf@x
13424 \pgf@circ@res@left = \pgf@x
13425 \pgfpointlineattime{
13426 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/up pos}}{
13427 \pgfpoint{
13428 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13429 {\pgf@circ@res@up}}
13430 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13431 }
13432 \anchor{up}{
13433 \up
13434 }
13435 \anchor{down}{
13436 \up
13437 \pgf@y=-\pgf@y
13438 }
13439 % reference voltage input anchors.
13440 \savedanchor\refv{%
13441 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13442 \pgf@y=.5\pgf@y
13443 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13444 \pgf@x=.5\pgf@x
13445 \pgf@circ@res@up = \pgf@y
13446 \pgf@circ@res@right = -\pgf@x
13447 \pgf@circ@res@left = \pgf@x
13448 \pgfpointlineattime{
13449 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/refv pos}}{
13450 \pgfpoint{
13451 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13452 {\pgf@circ@res@up}}
13453 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13454 }
13455 % we need both because they are normally drawn under the amp, and if you
13456 % mirror it vertically you need them
13457 \anchor{refv up}{
13458 \refv
13459 }
13460 \anchor{refv down}{
13461 \refv
13462 \pgf@y=-\pgf@y
13463 }
13464 \savedanchor\outport{
13465 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13466 \pgf@y=.5\pgf@y
13467 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13468 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13469 \pgf@x=-.5\pgf@x
13470 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
13471 }
13472 \anchor{out}{
13473 \outport
13474 \pgf@y=0pt
13475 }
13476 \anchor{out +}{
13477 \outport
13478 }
13479 \anchor{out -}{
13480 \outport
13481 \pgf@y=-\pgf@y
13482 }
13483 \savedanchor\outportfixed{
13484 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13485 \pgf@y=.5\pgf@y
13486 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13487 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13488 \pgf@x=-.5\pgf@x
13489 }
13490 \anchor{out up}{
13491 \outportfixed
13492 }
13493 \anchor{out down}{
13494 \outportfixed
13495 \pgf@y=-\pgf@y
13496 }
13497 %
13498 \anchor{west}{
13499 \left
13500 }
13501 \anchor{east}{
13502 \left
13503 \pgf@x=-\pgf@x
13504 }
13505 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13506 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13507 \anchor{north west}{ \northwest }
13508 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13509 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13510
13511 % let's start drawing the component
13512 \backgroundpath{
13513 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13514 %
13515 \northwest
13516 \pgf@circ@res@up = \pgf@y
13517 \pgf@circ@res@down = -\pgf@y
13518 \pgf@circ@res@right = -\pgf@x
13519 \pgf@circ@res@left = \pgf@x
13520 % main component, normally in thicker lines
13521 \pgfscope
13522 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
13523 \pgftransformxshift{.7\pgf@circ@res@left}
13524 \pgf@circ@res@step=\pgf@circ@res@right
13525 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13526 \pgf@circ@res@step=.7\pgf@circ@res@step
13527 %first point (near output)
13528 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
13529 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
13530 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13531 % and then to the input "front up", "down", to the output short side "down"
13532 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13533 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13534 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
13535 % ...and close
13536 \pgfpathclose
13537 \pgf@circ@draworfill
13538 \endpgfscope
13539 % input terminal up
13540 \pgfpathmoveto{\pgfpoint
13541 {\pgf@circ@res@left}
13542 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13543 %
13544 \pgfpathlineto{\pgfpoint
13545 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13546 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13547 %
13548 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
13549
13550 % input terminal down
13551 \pgfpathmoveto{\pgfpoint
13552 {\pgf@circ@res@left}
13553 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13554 %
13555 \pgfpathlineto{\pgfpoint
13556 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13557 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13558 \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
13559 % output leads down and up
13560 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13561 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}} %
13562 \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
13563 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13564 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}} %
13565 \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
13566 %
13567 \pgfsetrectcap
13568 \pgfusepath{draw}
13569 }
13570 }
13571 %%%---------- close: tex/pgfcircquadpoles
13572 %%%%%%%%%%% Springe nach tex/pgfcircmultipoles
13573 %%%---------- open: tex/pgfcircmultipoles.tex
13574 % Copyright 2007-2009 by Massimo Redaelli
13575 % Copyright 2019 by Romano Giannetti
13576 %
13577 % This file may be distributed and/or modified
13578 %
13579 % 1. under the LaTeX Project Public License and/or
13580 % 2. under the GNU Public License.
13581 %
13582 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
13583
13584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13585 %% Multipoles
13586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13587
13588 % counters for pin accounting...
13589 \def\pgf@circ@dip@pin@shift{0.5}
13590 \def\pgf@circ@qfp@pin@shift{0.25}
13591
13592 % derived from https://tex.stackexchange.com/a/146753/38080
13593 % original author Mark Wibrow
13594 % Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
13595 % a lot of thanks to @marmot for the un-rotation hint
13596 % https://tex.stackexchange.com/a/473571/38080
13597
13598 % DIP (dual in line package) chips
13599
13600 \pgfdeclareshape{dipchip}{
13601 \savedmacro\numpins{%
13602 \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
13603 \def\numpins{\the\pgf@circ@count@a}
13604 }
13605 \savedanchor\centerpoint{%
13606 \pgf@x=-.5\wd\pgfnodeparttextbox%
13607 \pgf@y=-.5\ht\pgfnodeparttextbox%
13608 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
13609 }%
13610 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
13611 \anchor{center}{\origin}
13612 \anchor{text}{\centerpoint}% to adjust text
13613 \saveddimen\height{%
13614 \pgfmathsetlength\pgf@x{((\numpins)
13615 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
13616 }%
13617 \saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}}}
13618 \saveddimen{\width}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}}
13619 \saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
13620 % standard anchors
13621 \savedanchor\northwest{%
13622 \pgfmathsetlength\pgf@y{0.5*((\numpins)
13623 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
13624 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}
13625 }
13626 \anchor{dot}{\northwest
13627 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
13628 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
13629 }
13630 \anchor{nw}{\northwest}
13631 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
13632 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
13633 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
13634 \anchor{north west}{\northwest}
13635 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
13636 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
13637 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
13638 \anchor{n}{\northwest\pgf@x=0pt }
13639 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13640 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13641 \anchor{w}{\northwest\pgf@y=0pt }
13642 \anchor{north}{\northwest\pgf@x=0pt }
13643 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13644 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13645 \anchor{west}{\northwest\pgf@y=0pt }
13646 % start drawing
13647 \backgroundpath{%
13648 \northwest
13649 \pgf@circ@res@up = \pgf@y
13650 \pgf@circ@res@down = -\pgf@y
13651 \pgf@circ@res@right = -\pgf@x
13652 \pgf@circ@res@left = \pgf@x
13653 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}\pgf@circ@Rlen
13654 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
13655 \pgfscope% (for the line width)
13656 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
13657 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
13658 \pgf@circ@draworfill
13659 %% upside mark
13660 \ifpgf@circuit@chip@topmark
13661 \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
13662 \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
13663 \fi
13664 \pgfusepath{stroke}%
13665 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13666 % Adding the pin number
13667 \ifpgf@circuit@chip@shownumbers
13668 \pgf@circ@count@a=\numpins\relax
13669 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
13670 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
13671 \ifpgf@circuit@chip@straightnumbers
13672 \pgfgettransformentries\a\b\temp\temp\temp\temp
13673 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
13674 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
13675 \else
13676 \pgfmathsetmacro{\rot}{0}
13677 \pgfmathsetmacro{\quadrant}{0}
13678 \fi
13679 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
13680 \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
13681 \pgfmathloop%
13682 \ifnum\pgf@circ@count@a>0
13683 \ifcase\quadrant % rotation 0
13684 % left
13685 \pgf@circ@count@c=\pgf@circ@count@a
13686 \pgftext[left,
13687 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13688 rotate=\rot]{\mytext}
13689 % right
13690 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13691 \pgftext[right,
13692 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13693 rotate=\rot]{\mytext}
13694 \or % rotation -90
13695 % left
13696 \pgf@circ@count@c=\pgf@circ@count@a
13697 \pgftext[top,
13698 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13699 rotate=\rot]{\mytext}
13700 % right
13701 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13702 \pgftext[bottom,
13703 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13704 rotate=\rot]{\mytext}
13705 \or %rotation 180
13706 % left
13707 \pgf@circ@count@c=\pgf@circ@count@a
13708 \pgftext[right,
13709 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13710 rotate=\rot]{\mytext}
13711 % right
13712 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13713 \pgftext[left,
13714 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13715 rotate=\rot]{\mytext}
13716 \or % rotation +90
13717 % left
13718 \pgf@circ@count@c=\pgf@circ@count@a
13719 \pgftext[bottom,
13720 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13721 rotate=\rot]{\mytext}
13722 % right
13723 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13724 \pgftext[top,
13725 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13726 rotate=\rot]{\mytext}
13727 \fi
13728 \advance\pgf@circ@count@a-1\relax%
13729 \repeatpgfmathloop
13730 \fi
13731 \endpgfscope
13732 \ifdim\pgf@circ@res@other>0pt
13733 \pgfscope
13734 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
13735 \pgf@circ@count@a=\numpins\relax
13736 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
13737 \pgfmathloop%
13738 \ifnum\pgf@circ@count@a>0
13739 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
13740 \ifnum\padfrac>0
13741 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
13742 % left side pads
13743 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13744 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13745 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13746 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13747 % right side pads
13748 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13749 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13750 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13751 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13752 \else
13753 % left side pins
13754 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13755 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13756 % right side pins
13757 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13758 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13759 \fi
13760 \advance\pgf@circ@count@a by -1\relax%
13761 \repeatpgfmathloop
13762 \pgfusepath{stroke}
13763 \endpgfscope
13764 \fi
13765 }%
13766 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
13767 % and is executed just before a node is drawn.
13768 \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
13769 % Start with the maximum pin number and go backwards.
13770 \pgf@circ@count@a=\numpins\relax
13771 \pgfmathloop%
13772 \ifnum\pgf@circ@count@a>0
13773 % we will create two anchors per pin: the "normal one" like `pin 1` for the
13774 % electrical contact, and the "border one" like `bpin 1` for labels.
13775 % they will coincide if `external pins width` is set to 0.
13776 \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
13777 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
13778 }
13779 \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
13780 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
13781 }
13782 \advance\pgf@circ@count@a by -1\relax%
13783 \repeatpgfmathloop%
13784 }%
13785 }
13786
13787 % QFP (quad flat package) chips
13788
13789 \pgfdeclareshape{qfpchip}{
13790 \savedmacro\numpins{%
13791 \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
13792 \def\numpins{\the\pgf@circ@count@a}
13793 }
13794 \savedanchor\centerpoint{%
13795 \pgf@x=-.5\wd\pgfnodeparttextbox%
13796 \pgf@y=-.5\ht\pgfnodeparttextbox%
13797 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
13798 }%
13799 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
13800 \anchor{center}{\origin}
13801 \anchor{text}{\centerpoint}% to adjust text
13802 \saveddimen\height{%
13803 \pgfmathsetlength\pgf@x{((\numpins+2)
13804 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
13805 }%
13806 \saveddimen\width{%
13807 \pgfmathsetlength\pgf@x{((\numpins+2)
13808 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
13809 }%
13810 \saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}}}
13811 \saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
13812 % standard anchors
13813 \savedanchor\northwest{%
13814 \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
13815 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
13816 \pgf@x=-\pgf@y
13817 }
13818 \anchor{dot}{\northwest
13819 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
13820 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
13821 }
13822 \anchor{nw}{\northwest}
13823 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
13824 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
13825 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
13826 \anchor{north west}{\northwest}
13827 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
13828 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
13829 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
13830 \anchor{n}{\northwest\pgf@x=0pt }
13831 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13832 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13833 \anchor{w}{\northwest\pgf@y=0pt }
13834 \anchor{north}{\northwest\pgf@x=0pt }
13835 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13836 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13837 \anchor{west}{\northwest\pgf@y=0pt }
13838 % start drawing
13839 \backgroundpath{%
13840 \northwest
13841 \pgf@circ@res@up = \pgf@y
13842 \pgf@circ@res@down = -\pgf@y
13843 \pgf@circ@res@right = -\pgf@x
13844 \pgf@circ@res@left = \pgf@x
13845 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}\pgf@circ@Rlen
13846 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
13847 \pgfscope% (for the line width)
13848 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
13849 %% upside mark
13850 \ifpgf@circuit@chip@topmark
13851 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
13852 \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
13853 \else
13854 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
13855 \fi
13856 %% rest of the shape
13857 \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
13858 \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
13859 \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
13860 \pgfpathclose
13861 \pgf@circ@draworfill
13862 % Adding the pin number
13863 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13864 \ifpgf@circuit@chip@shownumbers
13865 \pgf@circ@count@a=\numpins%
13866 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
13867 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
13868 \ifpgf@circuit@chip@straightnumbers
13869 \pgfgettransformentries\a\b\temp\temp\temp\temp
13870 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
13871 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
13872 \else
13873 \pgfmathsetmacro{\rot}{0}
13874 \pgfmathsetmacro{\quadrant}{0}
13875 \fi
13876 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
13877 \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
13878 \pgfmathloop%
13879 \ifnum\pgf@circ@count@a>0
13880 \ifcase\quadrant % rotation 0
13881 % left
13882 \pgf@circ@count@c=\pgf@circ@count@a
13883 \pgftext[left,
13884 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13885 rotate=\rot]{\mytext}
13886 % bottom
13887 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
13888 \pgftext[bottom,
13889 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
13890 rotate=\rot]{\mytext}
13891 % right
13892 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13893 \pgftext[right,
13894 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13895 rotate=\rot]{\mytext}
13896 % top
13897 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
13898 \pgftext[top,
13899 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
13900 rotate=\rot]{\mytext}
13901 \or % rotation -90
13902 % left
13903 \pgf@circ@count@c=\pgf@circ@count@a
13904 \pgftext[top,
13905 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13906 rotate=\rot]{\mytext}
13907 % bottom
13908 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
13909 \pgftext[left,
13910 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
13911 rotate=\rot]{\mytext}
13912 % right
13913 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13914 \pgftext[bottom,
13915 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13916 rotate=\rot]{\mytext}
13917 % top
13918 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
13919 \pgftext[right,
13920 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
13921 rotate=\rot]{\mytext}
13922 \or %rotation 180
13923 % left
13924 \pgf@circ@count@c=\pgf@circ@count@a
13925 \pgftext[right,
13926 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13927 rotate=\rot]{\mytext}
13928 % bottom
13929 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
13930 \pgftext[top,
13931 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
13932 rotate=\rot]{\mytext}
13933 % right
13934 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13935 \pgftext[left,
13936 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13937 rotate=\rot]{\mytext}
13938 % top
13939 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
13940 \pgftext[bottom,
13941 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
13942 rotate=\rot]{\mytext}
13943 \or % rotation +90
13944 % left
13945 \pgf@circ@count@c=\pgf@circ@count@a
13946 \pgftext[bottom,
13947 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13948 rotate=\rot]{\mytext}
13949 % bottom
13950 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
13951 \pgftext[right,
13952 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
13953 rotate=\rot]{\mytext}
13954 % right
13955 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
13956 \pgftext[top,
13957 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13958 rotate=\rot]{\mytext}
13959 % top
13960 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
13961 \pgftext[left,
13962 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
13963 rotate=\rot]{\mytext}
13964 \fi
13965 \advance\pgf@circ@count@a-1\relax%
13966 \repeatpgfmathloop
13967 \fi
13968 \endpgfscope
13969 \ifdim\pgf@circ@res@other>0pt
13970 \pgfscope
13971 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
13972 \pgf@circ@count@a=\numpins%
13973 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
13974 \pgfmathloop%
13975 \ifnum\pgf@circ@count@a>0
13976 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
13977 \ifnum\padfrac>0
13978 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
13979 % left side pads
13980 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13981 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13982 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13983 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13984 % bottom side pads
13985 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
13986 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
13987 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
13988 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
13989 % right side pads
13990 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13991 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13992 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13993 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
13994 % top side pads
13995 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
13996 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
13997 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
13998 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
13999 \else
14000 % left side pins
14001 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14002 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14003 % bottom side pins
14004 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
14005 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
14006 % right side pins
14007 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14008 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14009 % top side pins
14010 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
14011 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
14012 \fi
14013 \advance\pgf@circ@count@a-1\relax%
14014 \repeatpgfmathloop
14015 \pgfusepath{stroke}
14016 \endpgfscope
14017 \fi
14018 }%
14019 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
14020 % and is executed just before a node is drawn.
14021 \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
14022 % Start with the maximum pin number and go backwards.
14023 \pgf@circ@count@a=\numpins%
14024 \pgfmathloop%
14025 \ifnum\pgf@circ@count@a>0
14026 \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
14027 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
14028 }
14029 \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
14030 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
14031 }
14032 \advance\pgf@circ@count@a-1\relax%
14033 \repeatpgfmathloop%
14034 }%
14035 }
14036
14037 %% anchors for DIP
14038 \def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
14039 \c@pgf@countc=\numpins\relax
14040 \divide\c@pgf@countc by 2
14041 \ifnum #1 > \the\c@pgf@countc
14042 % right side
14043 \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
14044 \else
14045 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
14046 \fi
14047 }
14048
14049 %% anchors for QFP
14050 \def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
14051 \c@pgf@countc=\numpins\relax
14052 \divide\c@pgf@countc by 4
14053 \ifnum #1 > \the\c@pgf@countc
14054 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
14055 \ifnum #1 > \the\c@pgf@countb
14056 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
14057 \ifnum #1 > \the\c@pgf@countb
14058 % 3*npins/4 < pin, top side
14059 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
14060 \else
14061 % 2*npins/4 < pin <= 3*npins/4, right side
14062 \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
14063 \fi
14064 \else
14065 % npins/4 < pin <= 2*npins/4, bottom side
14066 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
14067 \fi
14068 \else
14069 % <= npins/4, left side
14070 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
14071 \fi
14072 }
14073
14074
14075 %% Rotary Switch
14076
14077 \pgfdeclareshape{rotaryswitch}
14078 {
14079 \savedanchor\northeast{%
14080 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14081 % the magic number is 0.25/cos(35)
14082 % try to recalculate it for the actual switch
14083 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14084 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14085 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14086 \edef\r{\ctikzvalof{nodes width}}
14087 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14088 \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@Rlen + \pgf@circ@res@temp}
14089 }
14090 \savedanchor\northwest{%
14091 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14092 % the magic number is 0.25/cos(35)
14093 % try to recalculate it for the actual switch
14094 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14095 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14096 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14097 \edef\r{\ctikzvalof{nodes width}}
14098 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14099 \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
14100 }
14101 \savedanchor\central{%
14102 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14103 % the magic number is 0.25/cos(35)
14104 % try to recalculate it for the actual switch
14105 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14106 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14107 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14108 \edef\r{\ctikzvalof{nodes width}}
14109 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14110 \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
14111 }
14112 % external square limits
14113 \savedanchor\extnorthwest{%
14114 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14115 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14116 \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
14117 \pgf@x=2.5\pgf@x % external square size
14118 \pgf@y=-\pgf@x %square thing when angle=180?
14119 }
14120 \saveddimen{\width}{\pgfmathsetlength\pgf@x{0.3052*\pgf@circ@Rlen*\ctikzvalof{tripoles/spdt/width}}}
14121 % radius of the connector
14122 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
14123 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
14124 % shapename
14125 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
14126 % shape type
14127 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
14128 \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
14129 \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
14130 \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
14131 \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
14132 % mid of the lever, to stack switches
14133 %\anchor{mid}{\midlever}
14134 \anchor{mid}{\northwest
14135 \pgf@circ@res@temp=-\pgf@x
14136 \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
14137 \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
14138 }
14139 % center anchors
14140 \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
14141 % horizontal angles
14142 \anchor{in}{ \northwest \pgf@y=0pt}
14143 \anchor{ain}{ \northwest \pgf@y=0pt}
14144
14145 \anchor{center}{ \central \pgf@y=0pt }
14146 \anchor{east}{ \northeast \pgf@y=0pt }
14147 \anchor{west}{ \northwest \pgf@y=0pt }
14148 \anchor{south}{ \central \pgf@y=-\pgf@y }
14149 \anchor{north}{ \central }
14150 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14151 \anchor{north east}{ \northeast }
14152 \anchor{north west}{ \northwest }
14153 \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
14154
14155 \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
14156 \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
14157 \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
14158 \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14159 \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
14160 \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14161 \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
14162 \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
14163 \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14164
14165 \backgroundpath{
14166 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
14167 \pgf@circ@res@right = \width
14168 \pgf@circ@res@left = -\width
14169
14170 \pgfscope %wiper
14171 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
14172 \pgf@circ@res@temp=\radius\relax
14173 \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
14174 \pgfsetlinewidth{2\pgf@circ@res@temp}
14175 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
14176 \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
14177 \pgfsetroundcap\pgfusepath{draw}
14178 \endpgfscope
14179
14180 \ifpgf@circ@rotaryarrow
14181 \pgfscope % arrow
14182 \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
14183 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
14184 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
14185 \pgftransformrotate{\wiper}
14186 \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
14187 \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
14188 \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
14189 \pgfusepath{draw}
14190 \endpgfscope
14191 \fi
14192
14193 % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
14194 \pgf@circ@count@a=\channels\relax
14195 \pgfmathsetmacro{\currenta}{-\angle}
14196 \pgfmathloop%
14197 \ifnum\pgf@circ@count@a>0
14198 % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
14199 \pgfscope
14200 \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
14201 \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
14202 \endpgfscope
14203 \pgfmathsetmacro{\currenta}{\currenta+\stepa}
14204 % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
14205 \advance\pgf@circ@count@a by -1\relax%
14206 \repeatpgfmathloop
14207
14208 \pgfscope % input
14209 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
14210 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
14211 \endpgfscope
14212 }
14213 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
14214 % and is executed just before a node is drawn.
14215 \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
14216 % Start with the maximum pin number and go backwards.
14217 \pgf@circ@count@a=\channels\relax
14218 \pgfmathloop%
14219 \ifnum\pgf@circ@count@a>0
14220 % we will create two anchors per pin: the "normal one" like `pin 1` for the
14221 % electrical contact, and the "border one" like `bpin 1` for labels.
14222 % they will coincide if `external pins width` is set to 0.
14223 \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
14224 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
14225 }
14226 \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
14227 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
14228 }
14229 \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
14230 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
14231 }
14232 \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
14233 \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
14234 }
14235 \advance\pgf@circ@count@a by -1\relax%
14236 \repeatpgfmathloop%
14237 }%
14238 }
14239
14240 \def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
14241 \pgf@circ@res@temp=\width
14242 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
14243 \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
14244 \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
14245 \advance\pgf@x by -\pgf@circ@res@temp
14246 }
14247
14248 \def\pgf@circ@rotarysqanchor#1{% external square anchors
14249 \pgf@circ@res@temp=\width
14250 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
14251 \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
14252 \advance\pgf@x by -\pgf@circ@res@temp
14253 }
14254
14255 % Seven segments displays
14256
14257 \pgfdeclareshape{bare7seg}{
14258 \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
14259 \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
14260 \ifpgf@circ@sevenseg@dot
14261 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
14262 \else
14263 \pgf@x=0pt
14264 \fi
14265 }
14266 % The object extension is more or less (-width/2,-width) to (width/2,width)
14267 % and adjusted for line thickness (both sides) and eventually the dot
14268 \saveddimen{\width}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}}
14269 \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
14270 \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
14271 \savedanchor{\southwest}{% both negative
14272 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14273 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
14274 \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14275 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
14276 }
14277 \savedanchor{\northeast}{% both positive
14278 \ifpgf@circ@sevenseg@dot
14279 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
14280 \else
14281 \pgf@circ@res@other=0pt
14282 \fi
14283 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14284 +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
14285 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14286 +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
14287 }
14288 \savedanchor{\topright}{% anchor without the box sep and the thickness
14289 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
14290 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
14291 }
14292 \anchor{center}{\pgfpointorigin}
14293 \anchor{north west}{\southwest\pgf@y=-\pgf@y}
14294 \anchor{north east}{\northeast}
14295 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
14296 \anchor{south west}{\southwest}
14297 \anchor{north}{\northeast\pgf@x=0pt}
14298 \anchor{east}{\northeast\pgf@y=0pt}
14299 \anchor{south}{\southwest\pgf@x=0pt}
14300 \anchor{west}{\southwest\pgf@y=0pt}
14301 \anchor{a}{\topright\pgf@x=0pt}
14302 \anchor{b}{\topright\pgf@y=0.5\pgf@y}
14303 \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
14304 \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
14305 \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
14306 \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
14307 \anchor{g}{\pgfpointorigin}
14308 \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
14309 \behindbackgroundpath{%
14310 \southwest % I do not want the dot here, it will stick out
14311 \pgf@circ@res@up = -\pgf@y
14312 \pgf@circ@res@down = \pgf@y
14313 \pgf@circ@res@right = \pgf@x
14314 \pgf@circ@res@left = -\pgf@x
14315 \pgfscope
14316 \pgfsetlinewidth{\ctikzvalof{multipoles/thickness}\pgflinewidth}
14317 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
14318 \pgfpathrectanglecorners%
14319 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14320 {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
14321 \ifpgf@circ@sevenseg@box
14322 \pgf@circ@draworfill
14323 \else
14324 \pgf@circ@maybefill
14325 \fi
14326 \endpgfscope
14327 \edef\bits{\ctikzvalof{seven seg/bits}}
14328 \pgfscope
14329 \pfg@circ@sseg@drawbits{\bits}
14330 \endpgfscope
14331 \pgfscope
14332 \ifpgf@circ@sevenseg@dot
14333 \pgf@circ@sseg@drawdots
14334 \fi
14335 \endpgfscope
14336 }
14337 }
14338
14339 \def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
14340 \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
14341 }
14342 \def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
14343 \ifnum #1 > 0\relax
14344 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
14345 \else
14346 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
14347 \fi
14348 \pgfpathmoveto{\pgfpoint{#2}{#3}}
14349 \pgfpathlineto{\pgfpoint{#4}{#5}}
14350 \pgfusepath{draw}
14351 }
14352 \def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
14353 \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
14354 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
14355 \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
14356 % \pgfsetroundcap
14357 \pgfsetarrowsstart{Triangle Cap[]}
14358 \pgfsetarrowsend{Triangle Cap[]}
14359 % segments
14360 \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
14361 \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
14362 \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
14363 \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
14364 \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
14365 \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
14366 \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
14367 }
14368 \def\pgf@circ@sseg@drawdots{% dots
14369 \edef\what{empty}
14370 \ifx\what\pgf@circ@sevenseg@dotstate
14371 % do nothing
14372 \else
14373 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
14374 \edef\what{off}
14375 \ifx\what\pgf@circ@sevenseg@dotstate
14376 % dot off
14377 \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
14378 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
14379 \else
14380 % dot on
14381 \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
14382 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
14383 \fi
14384 \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
14385 \pgfusepath{draw,fill}
14386 \fi
14387 }
14388 %%%---------- close: tex/pgfcircmultipoles
14389
14390 %%%%%%%%%%% Springe nach tex/pgfcirclabel
14391 %%%---------- open: tex/pgfcirclabel.tex
14392 % Copyright 2007-2009 by Massimo Redaelli
14393 %
14394 % This file may be distributed and/or modified
14395 %
14396 % 1. under the LaTeX Project Public License and/or
14397 % 2. under the GNU Public License.
14398 %
14399 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
14400
14401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14402 %% Bipole label positioning
14403
14404 %% Options
14405 \ctikzset{label/.style = { l=#1 } }
14406 \ctikzset{l/.code = {
14407 \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
14408 \ctikzsetvalof{bipole/label/unit}{}
14409 \ifpgf@circ@siunitx
14410 \pgf@circ@handleSI{#1}
14411 \ifpgf@circ@siunitx@res
14412 \edef\pgf@temp{\pgf@circ@handleSI@val}
14413 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
14414 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14415 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
14416 \else
14417 \fi
14418 \else
14419 \fi
14420 }}
14421
14422 \ctikzset{label above/.code = {
14423 l=#1,
14424 \circuitikzbasekey/bipole/label/position=90 }
14425 }
14426
14427 \ctikzset{l^/.style = {
14428 l=#1,
14429 \circuitikzbasekey/bipole/label/position=90 }
14430 }
14431
14432 \ctikzset{label below/.code = {
14433 l=#1,
14434 \circuitikzbasekey/bipole/label/position=-90 }
14435 }
14436
14437 \ctikzset{l_/.style = {
14438 l=#1,
14439 \circuitikzbasekey/bipole/label/position=-90 }
14440 }
14441
14442 \ctikzset{annotation/.style = { a=#1 } }
14443 \ctikzset{a/.code = {
14444 \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
14445 \ctikzsetvalof{bipole/annotation/unit}{}
14446 \ifpgf@circ@siunitx
14447 \pgf@circ@handleSI{#1}
14448 \ifpgf@circ@siunitx@res
14449 \edef\pgf@temp{\pgf@circ@handleSI@val}
14450 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
14451 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14452 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
14453 \else
14454 \fi
14455 \else
14456 \fi
14457 }}
14458
14459 \ctikzset{annotation above/.code = {
14460 a=#1,
14461 \circuitikzbasekey/bipole/annotation/position=90 }
14462 }
14463
14464 \ctikzset{a^/.style = {
14465 a=#1,
14466 \circuitikzbasekey/bipole/annotation/position=90 }
14467 }
14468
14469 \ctikzset{annotation below/.code = {
14470 a=#1,
14471 \circuitikzbasekey/bipole/annotation/position=-90 }
14472 }
14473 \ctikzset{a_/.style = {
14474 a=#1,
14475 \circuitikzbasekey/bipole/annotation/position=-90 }
14476 }
14477
14478 % This is to adjust spacing for the labels so that they are not cramped on components
14479 \def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
14480
14481 \def\pgf@circ@drawlabels#1{
14482 \pgfextra{
14483 % This function will be called with argument #1 equal
14484 % to "label" or "annotation" form pgfcircpath.tex.
14485 % pgf@circ@direction is the direction of the path,
14486 % its value is set in pgfcircpath.tex
14487 \pgfmathsubtract{\pgf@circ@direction}{90}
14488 \pgfmathround{\pgfmathresult} % avoid precision loss errors
14489 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14490
14491 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
14492 \ifnum \pgf@circ@temp < 0
14493 \pgfmathadd{\pgf@circ@labanc}{180}
14494 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14495 \fi
14496 % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
14497 %
14498 % normalize the angle values
14499 %
14500 \pgfmathmod{\pgf@circ@labanc}{360}
14501 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14502 %
14503 \ifpgf@circuit@bipole@inverted
14504 \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
14505 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14506 \fi
14507 %
14508 \ifnum \ctikzvalof{mirror value} = -1
14509 \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
14510 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14511 \fi
14512 % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
14513 }
14514 %Firstly, place a coordinate directly at the edge of the shape
14515 (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
14516 %now decide, which labels should be drawn
14517 \pgfextra{
14518 \edef\pgf@temp{\ctikzvalof{label/align}}
14519 \def\pgf@circ@temp{straight}
14520 }
14521 \ifx\pgf@temp\pgf@circ@temp %straight
14522 \pgf@circ@drawreglabels{#1}
14523 \else
14524 \pgfextra{\def\pgf@circ@temp{rotate}}
14525 \ifx\pgf@temp\pgf@circ@temp %rotate
14526 \pgf@circ@drawrotlabels{#1}
14527 \else% smart
14528 \pgf@circ@drawsmartlabels{#1}
14529 \fi
14530 \fi
14531 }
14532
14533
14534 \def\pgf@circ@drawsmartlabels#1{
14535 \pgfextra{
14536 \pgfmathmod{\pgf@circ@direction}{90}
14537 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14538 }
14539 \ifnum \pgfcircmathresult > 20
14540 \ifnum \pgfcircmathresult < 70
14541 \pgf@circ@drawrotlabels{#1}
14542 \else
14543 \pgf@circ@drawreglabels{#1}
14544 \fi
14545 \else
14546 \pgf@circ@drawreglabels{#1}
14547 \fi
14548 }
14549
14550
14551 \def\pgf@circ@drawrotlabels#1{
14552 \pgfextra{
14553 % scale the distances in function of zoom, so that they are not
14554 % dependent on it but on font size. Thanks to @marmot
14555 % https://tex.stackexchange.com/a/476018/38080
14556 % the coeffcient is adjusted so that the distance is more or less
14557 % the same for rotated labels and straight ones (although it will
14558 % depend on the font, so it's not exact).
14559 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
14560 \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
14561 \ifnum \ctikzvalof{bipole/#1/position}>0
14562 %we need some more space for placement below, due to mid-anchor
14563 \else % we do not have <= in \ifnum...
14564 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
14565 \fi
14566 %Calculate rotation of the label from direction and strip decimals
14567 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
14568 % rotate the label at second or third quadrant:
14569 \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
14570 \pgfmathsubtract{\pgf@circ@direction}{180}
14571 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14572 %invert the space relationships due to rotated strings
14573 \ifnum \ctikzvalof{bipole/#1/position}>0
14574 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
14575 \fi
14576 \fi\fi
14577 \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
14578 \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14579 }
14580 % reset cm is not working correctly here
14581 (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
14582 node[anchor=mid, rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
14583 }
14584
14585 \def\pgf@circ@drawreglabels#1{
14586 %Now calculate all shape positions
14587 %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
14588 %All points between will be addressed by angled-anchors:
14589 \pgfextra{
14590 % scale ex-distance to make it independent on scale
14591 % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
14592 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
14593 \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
14594 \pgfmathadd{\pgf@circ@labanc}{90}
14595 \pgfmathround{\pgfmathresult}
14596 \def\pgf@circ@labanctext{\pgf@circ@labanc}
14597 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14598 \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
14599 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14600 }
14601 %Values around 90 are at both y-axis
14602 \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
14603 \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
14604 \ifnum \pgf@circ@labpos > 180
14605 \ifnum \ctikzvalof{bipole/#1/position} > 0
14606 \pgfextra{\def\pgf@circ@labanctext{mid west}}
14607 \else
14608 \pgfextra{\def\pgf@circ@labanctext{mid east}}
14609 \fi
14610 \else
14611 \ifnum \ctikzvalof{bipole/#1/position} > 0
14612 \pgfextra{\def\pgf@circ@labanctext{mid east}}
14613 \else
14614 \pgfextra{\def\pgf@circ@labanctext{mid west}}
14615 \fi
14616 \fi
14617 \fi\fi
14618 %Values between -5 and 5 are at pos /neg x-axis
14619 \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
14620 \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
14621 \ifnum \ctikzvalof{bipole/#1/position} < 0
14622 \ifnum \pgf@circ@labanc > 90
14623 % using base coordinate instead of south to naturally align
14624 % symbols with descendants; but this invalidate the effect of
14625 % the inner sep, so recover it by shifting the anchor
14626 % reset cm is not working sometime, use @marmot solution
14627 % see https://tex.stackexchange.com/a/476018/38080
14628 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14629 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14630 \else
14631 \pgfextra{\def\pgf@circ@labanctext{north}}%north
14632 \fi
14633 \else
14634 \ifnum \pgf@circ@labanc < 90
14635 % shift, as above
14636 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14637 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14638 \else
14639 \ifnum \pgf@circ@labanc > 180
14640 % this shouldn't happen, but somehow it does (270 degree anchors)
14641 % shift, as above
14642 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14643 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14644 \else
14645 \pgfextra{\def\pgf@circ@labanctext{north}}%north
14646 \fi
14647 \fi
14648 \fi
14649 \fi\fi
14650 (labelcoor) node[anchor=\pgf@circ@labanctext,
14651 inner sep=0.5\pgf@circ@res@temp, outer sep=0pt,
14652 ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
14653 }
14654 }
14655
14656 \def\pgf@circ@finallabels#1{%
14657 \edef\pgf@temp{}%
14658 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
14659 \ifx\pgf@temp\pgf@circ@temp%
14660 \ctikzvalof{bipole/#1/name}%
14661 \else%
14662 $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
14663 \fi%
14664 }
14665
14666 \ctikzset{text/.style = { t=#1 } }
14667 \ctikzset{t/.code = {
14668 \ctikzsetvalof{bipoles/twoport/text}{#1}
14669 }}
14670
14671 %%%% Stacked labels
14672 %
14673 % stacked labels by Romano Giannetti [email protected]
14674 % heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
14675 % \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
14676 %
14677 % labels are in a tabular, globally aligned:
14678 % vertically with key l2 valign (default c)
14679 % c: center t: top b: bottom
14680 % horizontally with key l2 align (default l)
14681 % l: left c: centered r: right
14682 % you can switch sides using l2_=... and l2^=...
14683 % syntax is l2_ = line1 and line2 (same for l2^)
14684 %
14685 \ctikzset{%
14686 l2 valign/.store in=\ltwo@valign, l2 valign=c,
14687 l2 halign/.store in=\ltwo@halign, l2 halign=l,
14688 }
14689 \ctikzset{l2base/.code n args={2}{
14690 \pgfkeys{/tikz/circuitikz/bipole/label/name=%
14691 \bgroup
14692 \setlength{\tabcolsep}{2pt}%
14693 \def\ltwo@tabu{\tabular[\ltwo@valign]}%
14694 \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
14695 #1\\ #2%
14696 \endtabular
14697 \egroup
14698 }%
14699 \ctikzsetvalof{bipole/label/unit}{}
14700 \ifpgf@circ@siunitx
14701 \pgf@circ@handleSI{#2}
14702 \ifpgf@circ@siunitx@res
14703 \edef\pgf@temp{\pgf@circ@handleSI@val}
14704 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
14705 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14706 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
14707 \else
14708 \fi
14709 \else
14710 \fi
14711 }}
14712 \ctikzset{l2/.style args={#1 and #2}{
14713 l2base={#1}{#2},
14714 \circuitikzbasekey/bipole/label/position=90 }
14715 }
14716 \ctikzset{l2 above/.style args={#1 and #2}{
14717 l2base={#1}{#2},
14718 \circuitikzbasekey/bipole/label/position=90 }
14719 }
14720 \ctikzset{l2^/.style args={#1 and #2}{
14721 l2base={#1}{#2},
14722 \circuitikzbasekey/bipole/label/position=90 }
14723 }
14724 \ctikzset{l2 below/.style args={#1 and #2}{
14725 l2base={#1}{#2},
14726 \circuitikzbasekey/bipole/label/position=-90 }
14727 }
14728 \ctikzset{l2_/.style args={#1 and #2}{
14729 l2base={#1}{#2},
14730 \circuitikzbasekey/bipole/label/position=-90 }
14731 }
14732
14733 %%%---------- close: tex/pgfcirclabel
14734 %%%%%%%%%%% Springe nach tex/pgfcircvoltage
14735 %%%---------- open: tex/pgfcircvoltage.tex
14736 % Copyright 2007-2009 by Massimo Redaelli
14737 %
14738 % This file may be distributed and/or modified
14739 %
14740 % 1. under the LaTeX Project Public License and/or
14741 % 2. under the GNU Public License.
14742 %
14743 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
14744
14745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14746 %% Voltage management
14747
14748
14749 \ctikzset{v^>/.style = {
14750 v = #1,
14751 \circuitikzbasekey/bipole/voltage/direction = forward,
14752 \circuitikzbasekey/bipole/voltage/position = above
14753 }
14754 }
14755
14756 \ctikzset{v^</.style = {
14757 v = #1,
14758 \circuitikzbasekey/bipole/voltage/direction = backward,
14759 \circuitikzbasekey/bipole/voltage/position = above
14760 }
14761 }
14762
14763 \ctikzset{v_>/.style = {
14764 v = #1,
14765 \circuitikzbasekey/bipole/voltage/direction = forward,
14766 \circuitikzbasekey/bipole/voltage/position = below
14767 }
14768 }
14769
14770 \ctikzset{v_</.style = {
14771 v = #1,
14772 \circuitikzbasekey/bipole/voltage/direction = backward,
14773 \circuitikzbasekey/bipole/voltage/position = below
14774 }
14775 }
14776
14777 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
14778 \ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
14779 \ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
14780 \ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
14781
14782 % Default position varies whether the component is a voltage source
14783 % or not
14784 \ctikzset{v/.code = {
14785 \ifpgf@circuit@bipole@isvoltage
14786 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
14787 \circuitikzbasekey/bipole/voltage/direction=forward}
14788 \else
14789 \ifpgf@circ@oldvoltagedirection
14790 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
14791 \circuitikzbasekey/bipole/voltage/direction=backward}
14792 \else
14793 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
14794 \circuitikzbasekey/bipole/voltage/direction=forward}
14795 \fi
14796 \fi
14797 \ifpgf@circ@oldvoltagedirection
14798 \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
14799 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
14800 \circuitikzbasekey/bipole/voltage/direction=forward}
14801 \fi\fi
14802 \else
14803 \ifpgf@circuit@bipole@iscurrent
14804 \ifpgf@circuit@bipole@current@backward
14805 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
14806 \circuitikzbasekey/bipole/voltage/direction=forward}
14807 \else
14808 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
14809 \circuitikzbasekey/bipole/voltage/direction=backward}
14810 \fi\fi\fi
14811 \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
14812 \ctikzsetvalof{bipole/voltage/label/unit}{}
14813 \ifpgf@circ@siunitx
14814 \pgf@circ@handleSI{#1}
14815 \ifpgf@circ@siunitx@res
14816 \edef\pgf@temp{\pgf@circ@handleSI@val}
14817 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
14818 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14819 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
14820 \else
14821 \fi
14822 \else
14823 \fi
14824 }
14825 }
14826
14827 % american voltage font selection and symbol definition
14828 % the default font command is {} --- nothing
14829 \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
14830 %
14831 % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
14832 % notice that the double braces are needed to be able
14833 % to use \boldmath in the font (although it is semi-deprecated...)
14834 %
14835 \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
14836 \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
14837
14838 %% Output routine for generic bipoles
14839
14840 \def\pgf@circ@drawvoltagegeneric{
14841 \pgfextra{
14842 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}
14843 \pgfkeysifdefined{\pgf@temp}
14844 {
14845 \edef\partheight{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}}
14846 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
14847 }
14848 {
14849 \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
14850 {
14851 \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
14852 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
14853 }
14854 {%calculate default value from part height
14855 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}
14856 \pgfkeysifdefined{\pgf@temp}
14857 {
14858 \edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
14859 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen+0.2\pgf@circ@Rlen)}
14860 }
14861 {
14862 \edef\tmpdistfromline{(.5\pgf@circ@Rlen)} %fallback to fixed value
14863 }
14864 }
14865 }
14866 \ifnum \ctikzvalof{mirror value}=-1
14867 \ifpgf@circuit@bipole@inverted
14868 \ifpgf@circuit@bipole@voltage@straight
14869 \def\distfromline{\tmpdistfromline}
14870 \else
14871 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
14872 \fi
14873 \else
14874 \ifpgf@circuit@bipole@voltage@straight
14875 \def\distfromline{-\tmpdistfromline}
14876 \else
14877 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
14878 \fi
14879 \fi
14880 \else
14881 \ifpgf@circuit@bipole@inverted
14882 \ifpgf@circuit@bipole@voltage@straight
14883 \def\distfromline{-\tmpdistfromline}
14884 \else
14885 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
14886 \fi
14887 \else
14888 \ifpgf@circuit@bipole@voltage@straight
14889 \def\distfromline{\tmpdistfromline}
14890 \else
14891 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
14892 \fi
14893 \fi
14894 \fi
14895 \ifpgf@circuit@bipole@voltage@below
14896 \def\pgf@circ@voltage@angle{90}
14897 \else
14898 \def\pgf@circ@voltage@angle{-90}
14899 \fi
14900 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
14901 \pgfkeysifdefined{\pgf@temp}
14902 { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
14903 { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
14904 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
14905 \pgfkeysifdefined{\pgf@temp}
14906 { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
14907 { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
14908 \edef\shiftv{\ctikzvalof{voltage/shift}}
14909 \pgfmathsetmacro{\bumpb}{\bumpb + \shiftv} %% adjust the bump is shift
14910 \ifpgf@circuit@bipole@inverted
14911 \pgfmathsetmacro{\shiftv}{-\shiftv}
14912 \fi
14913 \ifnum \ctikzvalof{mirror value} = -1
14914 \pgfmathsetmacro{\shiftv}{-\shiftv}
14915 \fi
14916 }
14917 % %\pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} is equal to the length of the currarrow
14918 coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
14919 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorstartnode)$)
14920
14921 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
14922 coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
14923 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorendnode)$)
14924
14925 coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
14926
14927 \ifpgf@circuit@bipole@voltage@below
14928 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto) ! \shiftv!90 : (anchorendnode)$)
14929 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! \shiftv!-90 : (anchorstartnode)$)
14930 coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
14931 coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
14932 \else
14933 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto) ! -\shiftv!90 : (anchorendnode)$)
14934 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! -\shiftv!-90 : (anchorstartnode)$)
14935 coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
14936 coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
14937 \fi
14938
14939 \ifpgf@circuit@europeanvoltage
14940 \ifpgf@circuit@bipole@voltage@straight
14941 \ifpgf@circuit@bipole@voltage@backward
14942 (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
14943 \else
14944 (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
14945 \fi
14946 \else
14947 \ifpgf@circuit@bipole@voltage@backward
14948 (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
14949 node[currarrow, sloped, allow upside down, pos=1] {}
14950 (pgfcirc@Vfrom)
14951 \else
14952 (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
14953 node[currarrow, sloped, allow upside down, pos=1] {}
14954 (pgfcirc@Vto)
14955 \fi
14956 \fi
14957 \else
14958 \ifpgf@circuit@bipole@voltage@backward
14959 \ifpgf@circ@oldvoltagedirection
14960 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
14961 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
14962 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
14963 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
14964 \else
14965 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
14966 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
14967 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
14968 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
14969 \fi
14970 \else
14971 \ifpgf@circ@oldvoltagedirection
14972 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
14973 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
14974 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
14975 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
14976 \else
14977 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
14978 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
14979 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
14980 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
14981 \fi
14982 \fi
14983 \fi
14984 }
14985
14986 %% Output routine for voltage sources
14987 \def\pgf@circ@drawvoltagegenerator{
14988 % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
14989 % it's not perfect, but I can't find the way to do it correctly...
14990 \pgfextra{
14991 \edef\shiftv{\ctikzvalof{voltage/shift}}
14992 \edef\bumpa{\ctikzvalof{voltage/bump a}}
14993 \pgfmathsetmacro{\bumpaplus}{\bumpa + \shiftv}
14994 }
14995 \ifpgf@circuit@bipole@voltage@below
14996 coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
14997 coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
14998 \else
14999 coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
15000 coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
15001 \fi
15002 \ifpgf@circuit@europeanvoltage
15003 \ifpgf@circuit@bipole@voltage@backward
15004 (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vfrom)
15005 \else
15006 (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vto)
15007 \fi
15008 \else% american voltage
15009 \ifpgf@circuit@bipole@voltageoutsideofsymbol
15010 % if it is a battery, must put + and -
15011
15012 \ifpgf@circ@fixbatteries
15013 \ifpgf@circuit@bipole@voltage@backward
15014 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15015 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15016 \else
15017 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15018 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15019 \fi
15020 \else
15021 \ifpgf@circuit@bipole@voltage@backward
15022 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15023 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15024 \else
15025 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15026 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15027 \fi
15028 \fi
15029 \fi
15030 \fi
15031 }
15032
15033 %% Output routine
15034 \def\pgf@circ@drawvoltage{% node name
15035 \pgfextra{ %WARNING: indentation is probably wrong
15036 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
15037 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15038 \ifpgf@circuit@bipole@voltage@below
15039 \def\pgf@circ@bipole@voltage@label@anchor{north west}
15040 \else
15041 \def\pgf@circ@bipole@voltage@label@anchor{south east}
15042 \fi
15043 \fi\fi
15044 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15045 \ifpgf@circuit@bipole@voltage@below
15046 \def\pgf@circ@bipole@voltage@label@anchor{west}
15047 \else
15048 \def\pgf@circ@bipole@voltage@label@anchor{east}
15049 \fi
15050 \fi\fi
15051 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15052 \ifpgf@circuit@bipole@voltage@below
15053 \def\pgf@circ@bipole@voltage@label@anchor{south west}
15054 \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
15055 \fi
15056 \fi\fi
15057 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15058 \ifpgf@circuit@bipole@voltage@below
15059 \def\pgf@circ@bipole@voltage@label@anchor{south}
15060 \else\def\pgf@circ@bipole@voltage@label@anchor{north}
15061 \fi
15062 \fi\fi
15063 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15064 \ifpgf@circuit@bipole@voltage@below
15065 \def\pgf@circ@bipole@voltage@label@anchor{south east}
15066 \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
15067 \fi
15068 \fi\fi
15069 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15070 \ifpgf@circuit@bipole@voltage@below
15071 \def\pgf@circ@bipole@voltage@label@anchor{east}
15072 \else \def\pgf@circ@bipole@voltage@label@anchor{west}
15073 \fi
15074 \fi\fi
15075 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15076 \ifpgf@circuit@bipole@voltage@below
15077 \def\pgf@circ@bipole@voltage@label@anchor{north east}
15078 \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
15079 \fi
15080 \fi\fi
15081 \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
15082 \ifpgf@circuit@bipole@voltage@below
15083 \def\pgf@circ@bipole@voltage@label@anchor{north}
15084 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
15085 \fi
15086 \fi\fi
15087 \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
15088 \ifpgf@circuit@bipole@voltage@below
15089 \def\pgf@circ@bipole@voltage@label@anchor{north}
15090 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
15091 \fi
15092 \fi\fi
15093
15094 \ifnum \ctikzvalof{mirror value}=-1
15095 \ifpgf@circuit@bipole@voltage@below
15096 \pgf@circuit@bipole@voltage@belowfalse
15097 \else
15098 \pgf@circuit@bipole@voltage@belowtrue
15099 \fi
15100 \fi
15101
15102 \ifpgf@circuit@bipole@inverted
15103 \ifpgf@circuit@bipole@voltage@below
15104 \pgf@circuit@bipole@voltage@belowfalse
15105 \else
15106
15107 \pgf@circuit@bipole@voltage@belowtrue
15108 \fi
15109 \fi
15110
15111 \ifpgf@circuit@bipole@voltage@below
15112 \def\pgf@circ@bipole@voltage@label@where{-90}
15113 \else
15114 \def\pgf@circ@bipole@voltage@label@where{90}
15115 \fi
15116
15117
15118 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
15119 \pgfkeysifdefined{\pgf@temp}
15120 { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
15121 { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
15122 \edef\shiftv{\ctikzvalof{voltage/shift}}
15123 % adjust the label distance to the shift.
15124 \pgfmathsetmacro{\eudistplus}{\eudist+\shiftv}
15125
15126 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
15127 }%end pgfextra
15128
15129 \ifpgf@circuit@bipole@isvoltage
15130 \pgf@circ@drawvoltagegenerator
15131 \else
15132 \pgf@circ@drawvoltagegeneric
15133 \fi
15134
15135 % (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) %Zeile sinnlos!?
15136 \ifpgf@circuit@bipole@voltage@straight
15137 coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
15138 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt]
15139 at (Vlab) { \pgf@circ@finallabels{voltage/label} }
15140 \else
15141 coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
15142 \ifpgf@circuit@europeanvoltage
15143 \eudistplus
15144 \else
15145 \ctikzvalof{voltage/american label distance}
15146 \fi !
15147 (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
15148 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] at (Vlab) { \pgf@circ@finallabels{voltage/label} }
15149 \fi
15150 }%end drawvoltages
15151 %%%---------- close: tex/pgfcircvoltage
15152 %%%%%%%%%%% Springe nach tex/pgfcirccurrent
15153 %%%---------- open: tex/pgfcirccurrent.tex
15154 % Copyright 2007-2009 by Massimo Redaelli
15155 %
15156 % This file may be distributed and/or modified
15157 %
15158 % 1. under the LaTeX Project Public License and/or
15159 % 2. under the GNU Public License.
15160 %
15161 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15162
15163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15164 %% Current handling
15165
15166 %% Options
15167 \ctikzset{i^>/.style = {
15168 i = #1,
15169 \circuitikzbasekey/bipole/current/direction = forward,
15170 \circuitikzbasekey/bipole/current/x position = after,
15171 \circuitikzbasekey/bipole/current/y position = above
15172 }
15173 }
15174
15175 \ctikzset{i_>/.style = {
15176 i = #1,
15177 \circuitikzbasekey/bipole/current/direction = forward,
15178 \circuitikzbasekey/bipole/current/x position = after,
15179 \circuitikzbasekey/bipole/current/y position = below
15180 }
15181 }
15182
15183 \ctikzset{i>^/.style = {
15184 i = #1,
15185 \circuitikzbasekey/bipole/current/direction = forward,
15186 \circuitikzbasekey/bipole/current/x position = before,
15187 \circuitikzbasekey/bipole/current/y position = above
15188 }
15189 }
15190
15191 \ctikzset{i>_/.style = {
15192 i = #1,
15193 \circuitikzbasekey/bipole/current/direction = forward,
15194 \circuitikzbasekey/bipole/current/x position = before,
15195 \circuitikzbasekey/bipole/current/y position = below
15196 }
15197 }
15198
15199 \ctikzset{i^</.style = {
15200 i = #1,
15201 \circuitikzbasekey/bipole/current/direction = backward,
15202 \circuitikzbasekey/bipole/current/x position = after,
15203 \circuitikzbasekey/bipole/current/y position = above
15204 }
15205 }
15206
15207 \ctikzset{i_</.style = {
15208 i = #1,
15209 \circuitikzbasekey/bipole/current/direction = backward,
15210 \circuitikzbasekey/bipole/current/x position = after,
15211 \circuitikzbasekey/bipole/current/y position = below
15212 }
15213 }
15214
15215 \ctikzset{i<^/.style = {
15216 i = #1,
15217 \circuitikzbasekey/bipole/current/direction = backward,
15218 \circuitikzbasekey/bipole/current/x position = before,
15219 \circuitikzbasekey/bipole/current/y position = above
15220 }
15221 }
15222
15223 \ctikzset{i<_/.style = {
15224 i = #1,
15225 \circuitikzbasekey/bipole/current/direction = backward,
15226 \circuitikzbasekey/bipole/current/x position = before,
15227 \circuitikzbasekey/bipole/current/y position = below
15228 }
15229 }
15230
15231 \ctikzset{i/.code = {
15232 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
15233 \circuitikzbasekey/bipole/current/x position = after,
15234 \circuitikzbasekey/bipole/current/y position = above }
15235 \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
15236 \ctikzsetvalof{bipole/current/label/unit}{}
15237 \ifpgf@circ@siunitx
15238 \pgf@circ@handleSI{#1}
15239 \ifpgf@circ@siunitx@res
15240 \edef\pgf@temp{\pgf@circ@handleSI@val}
15241 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
15242 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15243 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
15244 \else
15245 \fi
15246 \else
15247 \fi
15248 %reverse current direction for voltage sources
15249 \ifpgf@circ@oldvoltagedirection\else
15250 \ifpgf@circuit@bipole@isvoltage
15251 \ifpgf@circuit@bipole@voltage@backward
15252 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
15253 \circuitikzbasekey/bipole/current/x position = after,
15254 \circuitikzbasekey/bipole/current/y position = below }
15255 \else
15256 \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
15257 \circuitikzbasekey/bipole/current/x position = before,
15258 \circuitikzbasekey/bipole/current/y position = above }
15259 \fi\fi\fi
15260 }
15261 }
15262
15263 \ifpgf@circ@oldvoltagedirection
15264 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
15265 \else
15266 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
15267 \fi
15268 \ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
15269 \ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
15270 \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
15271
15272 %% Output routine
15273 \def\pgf@circ@drawcurrent{
15274 \pgfextra{
15275 \edef\pgf@circ@ffffff{\pgf@circ@direction}
15276 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
15277
15278 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15279 \ifpgf@circuit@bipole@current@below
15280 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
15281 \fi
15282 \fi\fi
15283 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15284 \ifpgf@circuit@bipole@current@below
15285 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
15286 \fi
15287 \fi\fi
15288 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15289 \ifpgf@circuit@bipole@current@below
15290 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
15291 \fi
15292 \fi\fi
15293 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15294 \ifpgf@circuit@bipole@current@below
15295 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
15296 \fi
15297 \fi\fi
15298 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15299 \ifpgf@circuit@bipole@current@below
15300 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
15301 \fi
15302 \fi\fi
15303 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15304 \ifpgf@circuit@bipole@current@below
15305 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
15306 \fi
15307 \fi\fi
15308 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15309 \ifpgf@circuit@bipole@current@below
15310 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
15311 \fi
15312 \fi\fi
15313 \ifnum\pgfcircmathresult <5
15314 \ifpgf@circuit@bipole@current@below
15315 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15316 \fi
15317 \fi
15318 \ifnum\pgfcircmathresult >355
15319 \ifpgf@circuit@bipole@current@below
15320 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15321 \fi
15322 \fi
15323
15324 \ifpgf@circuit@bipole@current@below
15325 \def\pgf@circ@bipole@current@label@where{-90}
15326 \else
15327 \def\pgf@circ@bipole@current@label@where{+90}
15328 \fi
15329 }
15330
15331 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
15332 \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
15333 (\tikztostart)--(\tikztotarget)
15334 \else% normal bipole or source
15335 \ifpgf@circuit@bipole@current@before
15336 (\tikztostart)--(anchorstartnode)
15337 \else
15338 (anchorendnode)--(\tikztotarget)
15339 \fi
15340 \fi
15341 \ifpgf@circuit@bipole@current@backward
15342 \pgfextra{
15343 \pgfmathsubtract{\pgf@circ@ffffff}{180}
15344 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15345 }
15346 \fi
15347 coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff](Iarrow)
15348 (Iarrow.\pgf@circ@bipole@current@label@where) node[anchor=\pgf@circ@dir]{\pgf@circ@finallabels{current/label}}
15349 }
15350
15351 %%%---------- close: tex/pgfcirccurrent
15352 %%%%%%%%%%% Springe nach tex/pgfcircflow
15353 %%%---------- open: tex/pgfcircflow.tex
15354 % Copyright 2007-2009 by Massimo Redaelli
15355 %
15356 % This file may be distributed and/or modified
15357 %
15358 % 1. under the LaTeX Project Public License and/or
15359 % 2. under the GNU Public License.
15360 %
15361 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15362
15363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15364 %% flow handling
15365
15366 %% Options
15367 \ctikzset{f^>/.style = {
15368 f = #1,
15369 \circuitikzbasekey/bipole/flow/direction = forward,
15370 \circuitikzbasekey/bipole/flow/x position = after,
15371 \circuitikzbasekey/bipole/curflowrent/y position = above
15372 }
15373 }
15374
15375 \ctikzset{f_>/.style = {
15376 f = #1,
15377 \circuitikzbasekey/bipole/flow/direction = forward,
15378 \circuitikzbasekey/bipole/flow/x position = after,
15379 \circuitikzbasekey/bipole/flow/y position = below
15380 }
15381 }
15382
15383 \ctikzset{f>^/.style = {
15384 f = #1,
15385 \circuitikzbasekey/bipole/flow/direction = forward,
15386 \circuitikzbasekey/bipole/flow/x position = before,
15387 \circuitikzbasekey/bipole/flow/y position = above
15388 }
15389 }
15390
15391 \ctikzset{f>_/.style = {
15392 f = #1,
15393 \circuitikzbasekey/bipole/flow/direction = forward,
15394 \circuitikzbasekey/bipole/flow/x position = before,
15395 \circuitikzbasekey/bipole/flow/y position = below
15396 }
15397 }
15398
15399 \ctikzset{f^</.style = {
15400 f = #1,
15401 \circuitikzbasekey/bipole/flow/direction = backward,
15402 \circuitikzbasekey/bipole/flow/x position = after,
15403 \circuitikzbasekey/bipole/flow/y position = above
15404 }
15405 }
15406
15407 \ctikzset{f_</.style = {
15408 f = #1,
15409 \circuitikzbasekey/bipole/flow/direction = backward,
15410 \circuitikzbasekey/bipole/flow/x position = after,
15411 \circuitikzbasekey/bipole/flow/y position = below
15412 }
15413 }
15414
15415 \ctikzset{f<^/.style = {
15416 f = #1,
15417 \circuitikzbasekey/bipole/flow/direction = backward,
15418 \circuitikzbasekey/bipole/flow/x position = before,
15419 \circuitikzbasekey/bipole/flow/y position = above
15420 }
15421 }
15422
15423 \ctikzset{f<_/.style = {
15424 f = #1,
15425 \circuitikzbasekey/bipole/flow/direction = backward,
15426 \circuitikzbasekey/bipole/flow/x position = before,
15427 \circuitikzbasekey/bipole/flow/y position = below
15428 }
15429 }
15430
15431 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
15432 \ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
15433 \ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
15434 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
15435
15436 \ctikzset{f/.code = {
15437 \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
15438 \circuitikzbasekey/bipole/flow/x position = after,
15439 \circuitikzbasekey/bipole/flow/y position = above }
15440 \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
15441 \ctikzsetvalof{bipole/flow/label/unit}{}
15442 \ifpgf@circ@siunitx
15443 \pgf@circ@handleSI{#1}
15444 \ifpgf@circ@siunitx@res
15445 \edef\pgf@temp{\pgf@circ@handleSI@val}
15446 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
15447 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15448 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
15449 \else
15450 \fi
15451 \else
15452 \fi
15453 }
15454 }
15455
15456 %% Output routine
15457 \def\pgf@circ@drawflow{
15458 \pgfextra{
15459 \edef\pgf@circ@ffffff{\pgf@circ@direction}
15460 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
15461
15462 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15463 \ifpgf@circuit@bipole@flow@below
15464 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
15465 \fi
15466 \fi\fi
15467 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15468 \ifpgf@circuit@bipole@flow@below
15469 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
15470 \fi
15471 \fi\fi
15472 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15473 \ifpgf@circuit@bipole@flow@below
15474 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
15475 \fi
15476 \fi\fi
15477 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15478 \ifpgf@circuit@bipole@flow@below
15479 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
15480 \fi
15481 \fi\fi
15482 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15483 \ifpgf@circuit@bipole@flow@below
15484 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
15485 \fi
15486 \fi\fi
15487 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15488 \ifpgf@circuit@bipole@flow@below
15489 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
15490 \fi
15491 \fi\fi
15492 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15493 \ifpgf@circuit@bipole@flow@below
15494 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
15495 \fi
15496 \fi\fi
15497 \ifnum\pgfcircmathresult <5
15498 \ifpgf@circuit@bipole@flow@below
15499 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15500 \fi
15501 \fi
15502 \ifnum\pgfcircmathresult >355
15503 \ifpgf@circuit@bipole@flow@below
15504 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15505 \fi
15506 \fi
15507
15508 \ifpgf@circuit@bipole@flow@below
15509 \def\pgf@circ@bipole@flow@label@where{-90}
15510 \else
15511 \def\pgf@circ@bipole@flow@label@where{+90}
15512 \fi
15513 }
15514
15515 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
15516 \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
15517 (\tikztostart)--(\tikztotarget)
15518 \else% normal bipole or source
15519 \ifpgf@circuit@bipole@flow@before
15520 (\tikztostart)--(anchorstartnode)
15521 \else
15522 (anchorendnode)--(\tikztotarget)
15523 \fi
15524 \fi
15525 \pgfextra{
15526 \ifpgf@circuit@bipole@flow@backward
15527 \ifpgf@circuit@bipole@flow@below
15528 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15529 \else
15530 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15531 \fi
15532 \pgfmathsubtract{\pgf@circ@ffffff}{180}
15533 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15534 \else
15535 \ifpgf@circuit@bipole@flow@below
15536 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15537 \else
15538 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15539 \fi
15540 \fi
15541 }
15542 coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset](Farrowpos)
15543 (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir]{ \pgf@circ@finallabels{flow/label}}
15544 }
15545
15546 %%%---------- close: tex/pgfcircflow
15547
15548 % defaults
15549
15550 \setupmodule
15551 [current=european,
15552 voltage=european,
15553 resistor=american,
15554 inductor=cute,
15555 logic=american,
15556 siunitx=true,
15557 arrowmos=false]
15558
15559 \processaction
15560 [\currentmoduleparameter{voltage}]
15561 [european=>\ctikzset{voltage=european},
15562 american=>\ctikzset{voltage=american}]
15563
15564 \processaction
15565 [\currentmoduleparameter{current}]
15566 [european=>\ctikzset{ current=european},
15567 american=>\ctikzset{ current=american}]
15568
15569 \processaction
15570 [\currentmoduleparameter{label}]
15571 [straight=>\ctikzset{label/align = straight},
15572 align=>\ctikzset{label/align = rotate},
15573 smart=>\ctikzset{label/align = smart}]
15574
15575 \processaction
15576 [\currentmoduleparameter{resistor}]
15577 [european=>\ctikzset{ resistor=european},
15578 american=>\ctikzset{ resistor=american}]
15579
15580 \processaction
15581 [\currentmoduleparameter{inductor}]
15582 [european=>\ctikzset{ inductor=european},
15583 american=>\ctikzset{ inductor=american},
15584 cute=>\ctikzset{ inductor=cute}]
15585
15586 \processaction
15587 [\currentmoduleparameter{diode}]
15588 [full=>\ctikzset{ diode=full},
15589 empty=>\ctikzset{ diode=empty}]
15590
15591 \processaction
15592 [\currentmoduleparameter{logic}]
15593 [european=>\ctikzset{ logic ports=european},
15594 american=>\ctikzset{ logic ports=american}]
15595
15596 \processaction
15597 [\currentmoduleparameter{siunitx}]
15598 [true=>\def\SI#1#2{#1\,#2}
15599 \def\ampere{\rm{A}}
15600 \def\volt{\rm{V}}
15601 \def\ohm{\Omega}
15602 \def\siemens{\rm{S}}
15603 \def\farad{\rm{F}}
15604 \def\henry{\rm{H}}
15605 \def\second{\rm{s}}
15606 \def\coulomb{\rm{C}}
15607 \def\siemens{\rm{S}}
15608 \def\radians{\rm{rad}}
15609 \def\milli{\rm{m}}
15610 \def\micro{\mu}
15611 \def\nano{\rm{n}}
15612 \def\pico{\rm{p}}
15613 \def\kilo{\rm{k}}
15614 \def\mega{\rm{M}}
15615 \def\giga{\rm{G}}
15616 \def\tera{\rm{T}},
15617 false=>]
15618 % \s!default=>\pgf@circ@siunitxtrue,
15619
15620 \processaction
15621 [\currentmoduleparameter{arrowmos}]
15622 [true=>\pgf@circuit@mos@arrowstrue,
15623 false=>\pgf@circuit@mos@arrowsfalse]
15624 % \s!default=>\pgf@circuit@mos@arrowstrue,
15625
15626
15627 \ifpgf@circ@siunitx
15628 % nothing! siunitx and xstrings don't work in context
15629 \fi
15630
15631
15632 % Context specific
15633
15634 \ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]}
15635
15636 %%%%%%%%%%% Springe nach tex/pgfcircpath
15637 %%%---------- open: tex/pgfcircpath.tex
15638
15639 \def\pgf@circ@direction{0.0}
15640
15641 % Names
15642 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
15643 \ctikzset{n/.code = {
15644 \pgfkeys{/tikz/circuitikz/bipole/name=#1}
15645 }}
15646
15647 % Reflect the node along
15648 \ctikzset{mirrored/.is choice}
15649 \ctikzset{mirror value/.initial=1}
15650 \ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
15651 \ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
15652 \ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
15653
15654 % Invert node along path
15655 \ctikzset{inverted/.is choice}
15656 \ctikzset{invert value/.initial=1}
15657 \ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
15658 \ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
15659 \ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
15660 \newif\ifpgf@circuit@bipole@inverted
15661 \ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
15662
15663 \newif\ifpgf@circuit@bipole@voltage@backward
15664 \ctikzset{bipole/voltage/direction/.is choice}
15665 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
15666 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
15667
15668 % Initialize paths
15669 \def\pgfcircresetpath{
15670 \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
15671 bipole/inverted=false, bipole/kind=,
15672 bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
15673 bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
15674 bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
15675 bipole/current/y position=above, bipole/current/direction=forward,
15676 mirrored=false
15677 }
15678 }
15679
15680 %% Helper function for path-function to ensure using anchors between nodes
15681 \def\set@explicit@center@anchor#1{
15682 \pgfutil@ifundefined{pgf@sh@ns@#1}
15683 {
15684 %This coordinate is no node(but a relative position or a coordinate), no further handling needed
15685 }{
15686 \pgfutil@in@.{#1}
15687 \ifpgfutil@in@
15688 % Anchor is used, do nothing!
15689 \else%
15690 \let\tikz@moveto@waiting=\relax
15691 \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
15692 \edef#1{#1.center}%ensure using center anchor
15693 \fi
15694 }
15695 }
15696
15697
15698 %% Generic bipole path
15699 \def\pgf@circ@bipole@path#1#2{
15700
15701 \pgfextra{
15702 \set@explicit@center@anchor{\tikztostart}
15703 \set@explicit@center@anchor{\tikztotarget}
15704 \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
15705 \ctikzset{bipole/kind = #1}
15706 \edef\pgf@temp{\ctikzvalof{bipole/name}}
15707 \def\pgf@circ@temp{}
15708 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
15709 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
15710 \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
15711 \fi
15712 }
15713
15714 (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
15715 (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
15716 \pgfextra{
15717 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
15718 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
15719 \pgfmathround{\pgfmathresult}
15720 \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
15721 \pgfsyssoftpath@setcurrentpath{\myp@th}
15722 }
15723 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15724 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15725 \else
15726 --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
15727 \fi
15728 ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
15729 node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
15730 (\ctikzvalof{bipole/name}) {}
15731 \ifpgf@circuit@bipole@inverted
15732 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
15733 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
15734 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
15735 \else
15736 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
15737 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
15738 \fi
15739 \else
15740 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
15741 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
15742 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
15743 \else
15744 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
15745 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
15746 \fi
15747 \fi
15748 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15749 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15750 \else
15751 (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
15752 (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
15753 \fi
15754
15755 \drawpoles
15756 \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
15757 \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
15758 \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
15759 \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
15760 \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
15761 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15762 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15763 (\ctikzvalof{bipole/name}end)%Move to end of path
15764 \else
15765 ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
15766 %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
15767
15768 \fi
15769 % reset
15770 \pgfextra{
15771 \pgfcircresetpath
15772 }
15773 \tikztonodes%draw pending nodes an path
15774 }
15775
15776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15777 %% Handling of terminals
15778
15779 \ctikzset{bipole/nodes/.is family}
15780 \ctikzset{bipole/nodes/left/.initial=none}
15781 \ctikzset{bipole/nodes/right/.initial=none}
15782 \tikzset{bipole nodes/.style n args={2}{%
15783 \circuitikzbasekey/bipole/nodes/left=#1,
15784 \circuitikzbasekey/bipole/nodes/right=#2
15785 }
15786 }
15787
15788 %% Easily usable styles
15789
15790 \ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
15791 \ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
15792 \ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
15793 \ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
15794 \ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
15795 \ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
15796 \ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
15797 \ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
15798 \ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
15799 \ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
15800 \ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
15801 \ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
15802 \ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
15803 \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
15804 \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
15805
15806 % rectjoinfill workarounds
15807
15808 \ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
15809 \ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
15810 \ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
15811 \ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
15812 \ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
15813 \ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
15814 \ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
15815 \ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
15816 \ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
15817
15818 \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
15819
15820 \def\drawpoles{
15821 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
15822 \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
15823 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
15824 \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
15825 }
15826
15827 %% Path definitions
15828 \def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
15829 \def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
15830 \def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
15831 \def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
15832 \def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
15833 \def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
15834 \def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
15835 \def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
15836 \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
15837 \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
15838 \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
15839 \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
15840 \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
15841 \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
15842 \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
15843 \def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
15844 \def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
15845 \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
15846 \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
15847 \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
15848 \def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
15849 \def\pgf@circ@inductor@path#1{%
15850 \pgfextra{
15851 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
15852 \def\pgf@temp{european}%
15853 }
15854 \ifx\pgf@temp\pgf@circ@temp%
15855 \pgf@circ@europeaninductor@path{#1}%
15856 \else%
15857 \pgfextra{ \def\pgf@temp{cute} }%
15858 \ifx\pgf@temp\pgf@circ@temp%
15859 \pgf@circ@cuteinductor@path{#1}%
15860 \else%
15861 \pgf@circ@americaninductor@path{#1}%
15862 \fi%
15863 \fi%
15864 }
15865 \def\pgf@circ@vinductor@path#1{
15866 \pgfextra{
15867 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
15868 \def\pgf@temp{european}%
15869 }
15870 \ifx\pgf@temp\pgf@circ@temp%
15871 \pgf@circ@veuropeaninductor@path{#1}%
15872 \else%
15873 \pgfextra{ \def\pgf@temp{cute} }%
15874 \ifx\pgf@temp\pgf@circ@temp%
15875 \pgf@circ@vcuteinductor@path{#1}%
15876 \else%
15877 \pgf@circ@vamericaninductor@path{#1}%
15878 \fi%
15879 \fi%
15880 }
15881 \def\pgf@circ@inductivesens@path#1{%
15882 \pgfextra{
15883 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
15884 \def\pgf@temp{european}%
15885 }
15886 \ifx\pgf@temp\pgf@circ@temp%
15887 \pgf@circ@europeaninductivesens@path{#1}%
15888 \else%
15889 \pgfextra{ \def\pgf@temp{cute} }%
15890 \ifx\pgf@temp\pgf@circ@temp%
15891 \pgf@circ@cuteinductivesens@path{#1}%
15892 \else%
15893 \pgf@circ@americaninductivesens@path{#1}%
15894 \fi%
15895 \fi%
15896 }
15897 \def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
15898 \def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
15899 \def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
15900 \def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
15901 \def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
15902 \def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
15903 \def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
15904 \def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
15905 \def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
15906 \def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
15907 \def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
15908 \def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
15909 \def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
15910 \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
15911 \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
15912 \def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
15913 \def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
15914 \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
15915 \def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
15916 \def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
15917 \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
15918 \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
15919 \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
15920 \def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
15921 \def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
15922 \def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
15923 \def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
15924 \def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
15925 \def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
15926 \def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
15927 \def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
15928 \def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
15929 \def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
15930 \def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
15931 \def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
15932 \def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
15933 \def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
15934 \def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
15935 \def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
15936 \def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
15937 \def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
15938 \def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
15939 \def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
15940 \def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
15941 \def\pgf@circ@empty@path#1{}
15942 \def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
15943 \def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
15944 \def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
15945 \def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
15946 \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
15947 \def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
15948 \def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
15949 \def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
15950 \def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
15951 \def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
15952 \def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
15953 \def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
15954 \def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
15955 \def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
15956
15957 \def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
15958 \def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
15959 \def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
15960
15961 \def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
15962 \def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
15963 \def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
15964 \def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
15965 \def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
15966 \def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
15967 \def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
15968 \def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
15969 \def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
15970 \def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
15971 \def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
15972 \def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
15973 \def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
15974 \def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
15975 \def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
15976 \def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
15977 \def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
15978 \def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
15979 \def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
15980
15981 %%Mechanical
15982 \def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
15983 \def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
15984 \def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
15985 \def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
15986
15987 %% Styles
15988
15989 \def\comnpatname{\ifpgf@circuit@compat *\else\fi}
15990 \def\compattikzset#1{\tikzset{\comnpatname#1}}
15991
15992 %\def\ctikzsetbipole#1#2{%
15993 % \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
15994 %}
15995
15996 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
15997 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
15998 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
15999 \compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
16000 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
16001 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
16002 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
16003 \compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
16004 \compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
16005 \compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
16006 \compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
16007 \compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
16008 \compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
16009 \compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
16010 \compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
16011 \compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
16012 \compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
16013 \compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
16014 \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
16015 \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
16016 \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
16017 \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
16018 \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
16019 \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
16020 \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16021 \compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16022 \compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16023 \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
16024 \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
16025 \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
16026 \compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
16027 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
16028 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
16029 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
16030 \compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
16031 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
16032 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
16033 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
16034 \compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
16035 \compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
16036 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
16037 \compattikzset{transmission line/.style = {tline = #1}}
16038 \compattikzset{TL/.style = {tline = #1}}
16039 \compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
16040 \compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16041 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16042 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16043 \compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16044 \compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16045 \compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16046 \compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16047 \compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16048 \compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
16049 \compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
16050 \compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
16051 \compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16052 \compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16053 \compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16054
16055 \compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16056 \compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
16057 \compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16058 \compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
16059
16060
16061 \compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
16062 \compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
16063 \compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
16064 \compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
16065 \compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
16066 \compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
16067 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
16068
16069 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
16070 \compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
16071
16072 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
16073 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
16074 \compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
16075 \compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
16076 \compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
16077
16078 \compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
16079 \compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
16080 \compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
16081 \compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
16082 \compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
16083 \compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
16084 \compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
16085 \compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
16086 \compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
16087 \compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
16088 \compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
16089 \compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
16090 \compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
16091 \compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
16092 \compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
16093 \compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
16094 \compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
16095 \compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
16096 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
16097
16098 % % % % % %
16099 % % Begin of Diodes
16100 % % % % % %
16101
16102 \def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
16103 \def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
16104 \def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
16105 \def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
16106 \def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
16107 \def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
16108 \def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
16109 \def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
16110 \def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
16111 \def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
16112 \def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
16113 \def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
16114 \def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
16115 \def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
16116 \def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
16117 \def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
16118 \def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
16119 \def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
16120
16121 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
16122 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
16123 \compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
16124 \compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
16125 \compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
16126 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
16127 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
16128 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
16129 \compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
16130 \compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
16131 \compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
16132
16133 \compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
16134 \compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
16135 \compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
16136 \compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
16137 \compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
16138 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
16139 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
16140 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
16141 \compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
16142 \compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
16143 \compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
16144
16145 \compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
16146 \compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
16147 \compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
16148 \compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
16149 \compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
16150 \compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
16151 \compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
16152 \compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
16153 \compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
16154 %\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
16155
16156 \def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
16157
16158 \compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
16159 \compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
16160 \compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
16161 \compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
16162 \compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
16163 \compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
16164 \compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
16165 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
16166 \compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
16167 \compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
16168 \compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
16169
16170 %% Define Shortcuts
16171 \compattikzset{Do/.style = {\comnpatname empty diode}}
16172 \compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
16173 \compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
16174 \compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
16175 \compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
16176 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
16177 \compattikzset{leDo/.style = {\comnpatname empty led}}
16178 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
16179 \compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
16180 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
16181 \compattikzset{Tro/.style = {\comnpatname empty triac}}
16182
16183 \compattikzset{D*/.style = {\comnpatname full diode}}
16184 \compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
16185 \compattikzset{zD*/.style = {\comnpatname full Zener diode}}
16186 \compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
16187 \compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
16188 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
16189 \compattikzset{leD*/.style = {\comnpatname full led}}
16190 \compattikzset{VC*/.style = {\comnpatname full varcap}}
16191 \compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
16192 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
16193 \compattikzset{Tr*/.style = {\comnpatname full triac}}
16194
16195 \compattikzset{D/.style = {\comnpatname diode}}
16196 \compattikzset{tD/.style = {\comnpatname tunnel diode}}
16197 \compattikzset{zD/.style = {\comnpatname Zener diode}}
16198 \compattikzset{zzD/.style = {\comnpatname ZZener diode}}
16199 \compattikzset{sD/.style = {\comnpatname Schottky diode}}
16200 \compattikzset{pD/.style = {\comnpatname photodiode}}
16201 \compattikzset{leD/.style = {\comnpatname led}}
16202 \compattikzset{VC/.style = {\comnpatname varcap}}
16203 \compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
16204 \compattikzset{Ty/.style = {\comnpatname thyristor}}
16205 \compattikzset{Tr/.style = {\comnpatname triac}}
16206
16207 \compattikzset{D-/.style = {\comnpatname stroke diode}}
16208 \compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
16209 \compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
16210 \compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
16211 \compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
16212 \compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
16213 \compattikzset{leD-/.style = {\comnpatname stroke led}}
16214 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
16215 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
16216 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
16217 \compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
16218
16219 % % % % % %
16220 % % End of Diodes
16221 % % % % % %
16222
16223
16224 \compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
16225 \compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
16226 \compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
16227 \compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
16228 \compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
16229 \compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
16230 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
16231 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
16232 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16233 \compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16234 \compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16235 \compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
16236 \compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
16237 \compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
16238
16239 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
16240 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
16241 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
16242 \tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
16243
16244 % cute switches
16245 %% closed cute switch
16246 \def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
16247 \compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
16248 \compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
16249
16250 %% open cute switch
16251 \def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
16252 \compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
16253 \compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
16254
16255 %% closing cute switch
16256 \def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
16257 \compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
16258 \compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
16259
16260 %% opening cute switch
16261 \def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
16262 \compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
16263 \compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
16264
16265
16266 % short forms
16267 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16268 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16269 \compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16270 \compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
16271
16272 \compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
16273 \compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
16274
16275 \compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
16276 \compattikzset{isource/.style = {\comnpatname current source = #1}}
16277 \compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
16278 \compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
16279 \compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
16280 \compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
16281 \compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
16282 \compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
16283 \compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
16284 \compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16285
16286 \compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
16287 \compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
16288 \compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16289 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
16290
16291 \compattikzset{R/.style= {\comnpatname resistor = #1}}
16292 \compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
16293 \compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
16294 \compattikzset{thR/.style= {\comnpatname thermistor = #1}}
16295 \compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
16296 \compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
16297 \compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
16298 \compattikzset{C/.style = {\comnpatname capacitor = #1}}
16299 \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
16300 \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
16301 \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
16302 \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
16303 \compattikzset{L/.style = {\comnpatname inductor = #1}}
16304 \compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
16305 \compattikzset{V/.style = {\comnpatname voltage source = #1}}
16306 \compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
16307 \compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
16308 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
16309 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
16310 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16311 \def\pgf@temp#1{
16312 \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
16313 \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
16314 \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
16315 \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
16316 }
16317 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
16318 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
16319
16320 %current sources
16321 \compattikzset{I/.style = {\comnpatname current source = #1}}
16322 \compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
16323 \compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
16324 \compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
16325 \def\pgf@temp#1{
16326 \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
16327 \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
16328 \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
16329 \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
16330 }
16331 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
16332 \pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
16333 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
16334
16335 % cute sources
16336 \def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
16337 \compattikzset{cute european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16338 \compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
16339 \compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
16340
16341 \def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
16342 \compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16343 \compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
16344 \compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
16345
16346 \def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
16347 \compattikzset{cute european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16348 \compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
16349 \compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
16350
16351 \def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
16352 \compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16353 \compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
16354 \compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
16355
16356 % noise sources
16357 \def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
16358 \compattikzset{noise voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceN@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16359 \compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
16360 \compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
16361
16362 \def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
16363 \compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16364 \compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
16365 \compattikzset{nI/.style= {\comnpatname noise current source= #1}}
16366
16367 % resistive sensor american style
16368 \def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
16369 \compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
16370 \compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
16371 \compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
16372 \compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
16373
16374 \compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
16375 \compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
16376
16377 \compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
16378 \compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
16379 \compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
16380 \compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
16381 \compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
16382
16383 \compattikzset{Mr/.style = {\comnpatname memristor}}
16384
16385 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
16386 \compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
16387 \compattikzset{spst/.style = {\comnpatname switch = #1}}
16388
16389 \compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
16390
16391 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
16392 \compattikzset{vss/.style = {\comnpatname vee = #1}}
16393
16394 % activate the to-style crossing
16395 \def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
16396 \compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
16397 \compattikzset{xing/.style= {\comnpatname crossing= #1}}
16398
16399 %% loudspeaker and microphone
16400
16401 \def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
16402 \compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
16403
16404 \def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
16405 \compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
16406
16407 % more instrument
16408 \def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
16409 \compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
16410 \def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
16411 \compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
16412 \def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
16413 \compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
16414 % current loop probes
16415 \def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
16416 \compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
16417 \def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
16418 \compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
16419 % qucs-style probes
16420 \def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
16421 \compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
16422 \def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
16423 \compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
16424 \def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
16425 \compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
16426
16427
16428 % Transistor like bipoles
16429
16430 \def\pgf@circ@trans@path#1#2{
16431 \pgfextra{
16432 \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
16433 \def\pgf@circ@temp{#2}
16434 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
16435 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
16436 \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
16437 \fi
16438 }
16439 \ifpgf@circuit@bipole@inverted
16440 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
16441 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
16442 \else
16443 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
16444 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
16445 \fi
16446 \pgfextra{
16447 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
16448 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
16449 \pgfmathadd{\pgfmathresult}{-90}
16450 \pgfmathround{\pgfmathresult}
16451 \edef\pgf@circ@direction{\pgfmathresult}
16452 }
16453 ($(\tikztostart) ! .5 ! (\tikztotarget)$)
16454 node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
16455 (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
16456 \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
16457 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
16458 (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
16459 \else
16460 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
16461 (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
16462 \fi
16463 \pgfextra{
16464 \pgfcircresetpath
16465 }
16466 (\tikztotarget) \tikztonodes % e si continua
16467 }
16468
16469
16470 \def\pgf@circ@definetranspath#1{
16471 \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
16472 }
16473
16474 \pgf@circ@definetranspath{elmech}
16475 \pgf@circ@definetranspath{nmos}
16476 \pgf@circ@definetranspath{pmos}
16477 \pgf@circ@definetranspath{hemt}
16478 \pgf@circ@definetranspath{npn}
16479 \pgf@circ@definetranspath{pnp}
16480 \pgf@circ@definetranspath{nfet}
16481 \pgf@circ@definetranspath{nigfete}
16482 \pgf@circ@definetranspath{nigfetd}
16483 \pgf@circ@definetranspath{nigfetebulk}
16484 \pgf@circ@definetranspath{pfet}
16485 \pgf@circ@definetranspath{pigfete}
16486 \pgf@circ@definetranspath{pigfetd}
16487 \pgf@circ@definetranspath{pigfetebulk}
16488 \pgf@circ@definetranspath{njfet}
16489 \pgf@circ@definetranspath{pjfet}
16490 \pgf@circ@definetranspath{pigbt}
16491 \pgf@circ@definetranspath{nigbt}
16492 \pgf@circ@definetranspath{Lpigbt}
16493 \pgf@circ@definetranspath{Lnigbt}
16494 %%%---------- close: tex/pgfcircpath
16495
16496 \catcode`\@=\tikzatcode
16497 \catcode`\|=\tikzbarcode
16498 \catcode`\!=\tikzexclaimcode
16499
16500 % define the environment
16501 \long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture}
16502
16503 \protect
16504
16505 \stopmodule
16506
16507 \endinput