Debian Codegraph @

texmf-dist/tex/latex/circuitikz/circuitikz-0.9.3-body.tex

raw
1 % Copyright 2018-2026 by Romano Giannetti
2 % Copyright 2015-2026 by Stefan Lindner
3 % Copyright 2013-2026 by Stefan Erhardt
4 % Copyright 2007-2026 by Massimo Redaelli
5 %
6 % This file may be distributed and/or modified
7 %
8 % 1. under the LaTeX Project Public License and/or
9 % 2. under the GNU Public License.
10 %
11 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
12
13 \NeedsTeXFormat{LaTeX2e}
14
15 \def\pgfcircversion{0.9.3}
16 \def\pgfcircversiondate{2019/07/13}
17
18 %% Version 3.0 of pgf/TikZ is required
19 \RequirePackage{tikz}
20 \usetikzlibrary{calc}
21 %
22 % "arrows" library is deprecated, and behave badly with
23 % arrows on short paths. Change to the new arrows.meta
24 % In pfgcirc.define, we will add the old definition of
25 % latex' which we have lost in the transition
26 %
27 \usetikzlibrary{arrows.meta, bending}
28
29 % The options are listed in the manual in this order
30
31 \DeclareOption{europeanvoltage}{
32 \ctikzset{voltage=european}
33 }
34
35 \DeclareOption{straightvoltages}{
36 \pgf@circuit@bipole@voltage@straighttrue
37 }
38
39 \DeclareOption{americanvoltage}{
40 \ctikzset{voltage=american}
41 }
42
43 \DeclareOption{europeancurrent}{
44 \ctikzset{current = european}
45 }
46
47 \DeclareOption{americancurrent}{
48 \ctikzset{current = american}
49 }
50
51
52
53 \DeclareOption{americanresistor}{
54 \ctikzset{resistor = american}
55 }
56
57 \DeclareOption{europeanresistor}{
58 \ctikzset{resistor = european}
59 }
60
61 \DeclareOption{americaninductor}{
62 \ctikzset{inductor = american}
63 }
64
65 \DeclareOption{europeaninductor}{
66 \ctikzset{inductor = european}
67 }
68
69 \DeclareOption{cuteinductor}{
70 \ctikzset{inductor = cute}
71 }
72
73 \DeclareOption{americanport}{
74 \ctikzset{logic ports = american}
75 }
76
77 \DeclareOption{europeanport}{
78 \ctikzset{logic ports = european}
79 }
80
81 \DeclareOption{european}{
82 \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
83 \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
84 }
85
86 \DeclareOption{american}{
87 \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
88 \ctikzset{logic ports = american}
89 }
90
91 \DeclareOption{fulldiodes}{
92 \ctikzset{diode = full}
93 }
94
95 \DeclareOption{emptydiodes}{
96 \ctikzset{diode = empty}
97 }
98
99 \DeclareOption{europeanvoltages}{
100 \ctikzset{voltage=european}
101 }
102
103 \DeclareOption{americanvoltages}{
104 \ctikzset{voltage=american}
105 }
106
107 \DeclareOption{europeancurrents}{
108 \ctikzset{current = european}
109 }
110
111 \DeclareOption{americancurrents}{
112 \ctikzset{current = american}
113 }
114
115 \DeclareOption{americanresistors}{
116 \ctikzset{resistor = american}
117 }
118
119 \DeclareOption{europeanresistors}{
120 \ctikzset{resistor = european}
121 }
122
123 \DeclareOption{americaninductors}{
124 \ctikzset{inductor = american}
125 }
126
127 \DeclareOption{europeaninductors}{
128 \ctikzset{inductor = european}
129 }
130
131 \DeclareOption{cuteinductors}{
132 \ctikzset{inductor = cute}
133 }
134
135 \DeclareOption{americanports}{
136 \ctikzset{logic ports = american}
137 }
138
139 \DeclareOption{europeanports}{
140 \ctikzset{logic ports = european}
141 }
142
143 \DeclareOption{americangfsurgearrester}{
144 \ctikzset{gas filled surge arrester choice = american}
145 }
146
147 \DeclareOption{europeangfsurgearrester}{
148 \ctikzset{gas filled surge arrester choice = european}
149 }
150
151 \DeclareOption{siunitx}{
152 \pgf@circ@siunitxtrue
153 }
154
155 \DeclareOption{nosiunitx}{
156 \pgf@circ@siunitxfalse
157 }
158
159 \DeclareOption{fulldiode}{
160 \ctikzset{diode = full}
161 }
162
163 \DeclareOption{emptydiode}{
164 \ctikzset{diode = empty}
165 }
166
167 \DeclareOption{strokediode}{
168 \ctikzset{diode = stroke}
169 }
170
171 \DeclareOption{arrowmos}{
172 \pgf@circuit@mos@arrowstrue
173 }
174
175 \DeclareOption{noarrowmos}{
176 \pgf@circuit@mos@arrowsfalse
177 }
178
179 \DeclareOption{fetbodydiode}{
180 \pgf@circuit@fet@bodydiodetrue
181 }
182
183 \DeclareOption{nofetbodydiode}{
184 \pgf@circuit@fet@bodydiodefalse
185 }
186
187 \DeclareOption{fetsolderdot}{
188 \pgf@circuit@fet@solderdottrue
189 }
190
191 \DeclareOption{nofetsolderdot}{
192 \pgf@circuit@fet@solderdotfalse
193 }
194
195 \DeclareOption{emptypmoscircle}{
196 \pgf@circuit@pmos@emptycircletrue
197 }
198
199
200 \DeclareOption{lazymos}{
201 \ctikzset{tripoles/nmos/width=.5}
202 \ctikzset{tripoles/nmos/gate height=.35}
203 \ctikzset{tripoles/nmos/base height=.35}
204 \ctikzset{tripoles/nmos/height/.initial=1.2}
205 \ctikzset{tripoles/nmos/base width=.5}
206 \ctikzset{tripoles/nmos/gate width=.65}
207
208 \ctikzset{tripoles/pmos/width=.5}
209 \ctikzset{tripoles/pmos/gate height=.35}
210 \ctikzset{tripoles/pmos/base height=.35}
211 \ctikzset{tripoles/pmos/height/.initial=1.2}
212 \ctikzset{tripoles/pmos/base width=.5}
213 \ctikzset{tripoles/pmos/gate width=.65}
214
215 \pgf@circuit@pmos@emptycircletrue
216 }
217
218 \DeclareOption{straightlabels}{
219 \ctikzset{label/align = straight}
220 }
221
222 \DeclareOption{rotatelabels}{
223 \ctikzset{label/align = rotate}
224 }
225
226 \DeclareOption{smartlabels}{
227 \ctikzset{label/align = smart}
228 }
229
230 \DeclareOption{compatibility}{
231 \pgf@circuit@compattrue
232 }
233
234 \DeclareOption{oldvoltagedirection}{
235 \pgf@circ@oldvoltagedirectiontrue
236 \pgf@circ@explicitvdirtrue
237 \pgf@circ@fixbatteriesfalse
238 }
239 \DeclareOption{nooldvoltagedirection}{
240 \pgf@circ@oldvoltagedirectionfalse
241 \pgf@circ@explicitvdirtrue
242 \pgf@circ@fixbatteriesfalse
243 }
244
245 \DeclareOption{RPvoltages}{
246 \pgf@circ@oldvoltagedirectiontrue
247 \pgf@circ@explicitvdirtrue
248 \pgf@circ@fixbatteriestrue
249 }
250 \DeclareOption{EFvoltages}{
251 \pgf@circ@oldvoltagedirectionfalse
252 \pgf@circ@explicitvdirtrue
253 \pgf@circ@fixbatteriestrue
254 }
255
256
257 \DeclareOption{betterproportions}{
258 \ctikzset{monopoles/ground/width/.initial=.15}
259
260 \ctikzset{bipoles/resistor/height/.initial=.23}
261 \ctikzset{bipoles/resistor/width/.initial=.6}
262 \ctikzset{bipoles/capacitor/height/.initial=.4}
263 \ctikzset{bipoles/capacitor/width/.initial=.1}
264 \ctikzset{bipoles/potentiometer/height/.initial=.6}
265 \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
266 \ctikzset{bipoles/potentiometer/width/.initial=.6}
267 \ctikzset{bipoles/photoresistor/height/.initial=.6}
268 \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
269 \ctikzset{bipoles/photoresistor/width/.initial=.6}
270 \ctikzset{bipoles/thermistor/main/.initial=.7}
271 \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
272 \ctikzset{bipoles/thermistor/width/.initial=.6}
273 \ctikzset{bipoles/thermistorntc/width/.initial=.6}
274 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
275 \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
276 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
277 \ctikzset{bipoles/thermistorptc/width/.initial=.6}
278 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
279 \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
280 \ctikzset{bipoles/varistor/main/.initial=.7}
281 \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
282 \ctikzset{bipoles/varistor/width/.initial=.6}
283 \ctikzset{bipoles/vresistor/height/.initial=.45}
284 \ctikzset{bipoles/vresistor/width/.initial=.6}
285 \ctikzset{bipoles/generic/height/.initial=.23}
286 \ctikzset{bipoles/generic/width/.initial=.6}
287 \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
288 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
289 \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
290 \ctikzset{bipoles/ageneric/height/.initial=.23}
291 \ctikzset{bipoles/ageneric/width/.initial=.6}
292 \ctikzset{bipoles/memristor/height/.initial=.23}
293 \ctikzset{bipoles/memristor/wave height/.initial=.375}
294 \ctikzset{bipoles/memristor/width/.initial=.60}
295 \ctikzset{bipoles/tgeneric/height/.initial=.525}
296 \ctikzset{bipoles/tgeneric/width/.initial=.6}
297 \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
298 \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
299 \ctikzset{bipoles/fullgeneric/height/.initial=.23}
300 \ctikzset{bipoles/fullgeneric/width/.initial=.6}
301 \ctikzset{bipoles/diode/height/.initial=.3}
302 \ctikzset{bipoles/diode/width/.initial=.25}
303 \ctikzset{bipoles/bidirectionaldiode/height/.initial=.66}
304 \ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
305 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
306 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
307
308 \ctikzset{tripoles/thyristor/height/.initial=.66}
309 \ctikzset{tripoles/thyristor/height 2/.initial=.3}
310 \ctikzset{tripoles/thyristor/width/.initial=.6}
311 \ctikzset{tripoles/thyristor/diode height/.initial=.3}
312 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
313 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
314
315 \ctikzset{tripoles/triac/height/.initial=.66}
316 \ctikzset{tripoles/triac/width/.initial=.6}
317 \ctikzset{tripoles/triac/diode width left/.initial=.3}
318 \ctikzset{tripoles/triac/diode width right/.initial=.3}
319 }
320
321 % This is a nice hack that prints all the shapes declared
322 % by the package. Very useful for coverage testing and debugging.
323 %
324 % \let\origpgfdeclareshape=\pgfdeclareshape
325 % \def\pgfdeclareshape#1{%
326 % \typeout{SHAPE:\space"#1"}%
327 % \origpgfdeclareshape{#1}
328 % }
329
330
331 %%%%%%%%%
332 %%%%%%%%%%% Springe nach tex/pgfcirc.defines
333 %%%---------- open: tex/pgfcirc.defines.tex
334 %% Counters
335
336 \newcount\pgf@circ@count@a
337 \newcount\pgf@circ@count@b
338 \newcount\pgf@circ@count@c
339 %%%%%%%%%%%%
340 %% Dimensions
341
342 % coordinates
343 \newdimen\pgf@circ@res@up
344 \newdimen\pgf@circ@res@down
345 \newdimen\pgf@circ@res@zero
346 \newdimen\pgf@circ@res@left
347 \newdimen\pgf@circ@res@right
348 \newdimen\pgf@circ@res@other
349 \newdimen\pgf@circ@res@step
350 \newdimen\pgf@circ@res@temp
351 % inital thickness
352 \newdimen \pgfstartlinewidth
353
354 % arrow tips, ported over old arrows library (deprecated)
355 % see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
356 % this was the original definition of latex' tips, renamed to avoid clashes
357 %
358 \pgfarrowsdeclare{latexslim}{latexslim}
359 {
360 \pgfutil@tempdima=0.28pt%
361 \advance\pgfutil@tempdima by.3\pgflinewidth%
362 \pgfarrowsleftextend{+-4\pgfutil@tempdima}
363 \pgfarrowsrightextend{+6\pgfutil@tempdima}
364 }
365 {
366 \pgfutil@tempdima=0.28pt%
367 \advance\pgfutil@tempdima by.3\pgflinewidth%
368 \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
369 \pgfpathcurveto
370 {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
371 {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
372 {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
373 \pgfpathcurveto
374 {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
375 {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
376 {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
377 \pgfpathcurveto
378 {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
379 {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
380 {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
381 \pgfpathclose
382 \pgfusepathqfill
383 }
384
385 \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
386
387 %% Macro to fill or draw
388
389 \def\pgf@circ@draworfill{%
390 \ifx\tikz@fillcolor\pgfutil@empty
391 \pgfusepath{draw}
392 \else
393 \pgfsetfillcolor{\tikz@fillcolor}
394 \pgfusepath{draw, fill}
395 \fi
396 }
397
398 \def\pgf@circ@draworfillandclip{%
399 \ifx\tikz@fillcolor\pgfutil@empty
400 \pgfusepath{draw, clip}
401 \else
402 \pgfsetfillcolor{\tikz@fillcolor}
403 \pgfusepath{draw, clip, fill}
404 \fi
405 }
406
407 \def\pgf@circ@maybefill{%
408 \ifx\tikz@fillcolor\pgfutil@empty
409 \pgfusepath{discard}
410 \else
411 \pgfsetfillcolor{\tikz@fillcolor}
412 \pgfusepath{fill}
413 \fi
414 }
415 %% Keys
416
417 \long\def\pgf@circ@comment#1{}
418
419 \def\circuitikzbasekey{/tikz/circuitikz}
420
421 \pgfkeys{\circuitikzbasekey/.is family}
422
423 \def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
424 \let\ctikzset\circuitikzset
425 \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
426 \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
427
428 \newif\ifpgf@circ@siunitx
429 \newif\ifpgf@circuit@compat
430 \newif\ifpgf@circ@oldvoltagedirection % default false
431 \newif\ifpgf@circ@explicitvdir
432 \newif\ifpgf@circ@fixbatteries
433
434 \ctikzset{voltage dir/.is choice}
435 \ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
436 \ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
437 \ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
438 \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
439 \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
440
441
442 % Option ">" for twoports
443 \newif\ifpgf@circuit@inputarrow
444 \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
445 \ctikzset{inputarrow/.is choice}
446 \ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
447 \ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
448
449 % Option "boxed" for nodes and twoports
450 \newif\ifpgf@circuit@boxed
451 \pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
452 \ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
453 \pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
454 \ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
455
456 % Option "dashed" for nodes and twoports
457 \newif\ifpgf@circuit@dashed
458 \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
459 \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
460
461 % Option "t=*" for nodes
462 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
463
464 \ctikzset{current arrow scale/.initial=16}
465
466 \ctikzset{bipoles/.is family}
467 \ctikzset{bipoles/border margin/.initial=1.1}
468 \ctikzset{bipoles/thickness/.initial=2}
469 \ctikzset{tripoles/thickness/.initial=2}
470 \ctikzset{quadpoles/thickness/.initial=2}
471 \ctikzset{nodes width/.initial=.04}
472
473 % Base len for all circuitikz
474 \newdimen\pgf@circ@Rlen
475 \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
476 \pgf@circ@Rlen = 1.4cm
477
478 \ctikzset{monopoles/.is family}
479 \ctikzset{monopoles/ground/width/.initial=.25}
480 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
481 \ctikzset{monopoles/ground/thickness/.initial=2}
482 \ctikzset{monopoles/rground/thickness/.initial=2}
483 \ctikzset{monopoles/tground/thickness/.initial=3}
484 \ctikzset{monopoles/vcc/width/.initial=.2}
485 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
486 \ctikzset{monopoles/vee/arrow/.initial=legacy}
487 \ctikzset{monopoles/match/width/.initial=.4}
488 \ctikzset{monopoles/chassis/width/.initial=.25}
489 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
490 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
491 \ctikzset{monopoles/tlinestub/width/.initial=.25}
492 \ctikzset{monopoles/antenna/width/.initial=.25}
493 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
494 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
495 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
496 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
497 \ctikzset{monopoles/txantenna/width/.initial=.25}
498 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
499 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
500 \ctikzset{monopoles/rxantenna/width/.initial=.25}
501 \ctikzset{monopoles/bareantenna/width/.initial=.25}
502 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
503 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
504 \ctikzset{monopoles/waves/width/.initial=0.5}
505 % microstrips
506 \ctikzset{bipoles/mstline/height/.initial=0.3}
507 \ctikzset{bipoles/mstline/width/.initial=1.2}
508 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
509 \ctikzset{monopoles/msport/width/.initial=.5}
510 \ctikzset{monopoles/msrstub/height/.initial=1.0}
511 \ctikzset{monopoles/msrstub/width/.initial=0.6}
512
513 % microphone and loudspeaker
514 \ctikzset{bipoles/loudspeaker/height/.initial=.8}
515 \ctikzset{bipoles/loudspeaker/depth/.initial=.3}
516 \ctikzset{bipoles/loudspeaker/width/.initial=.8}
517 \ctikzset{bipoles/mic/height/.initial=1.2}
518 \ctikzset{bipoles/mic/depth/.initial=.0}
519 \ctikzset{bipoles/mic/width/.initial=.8}
520
521 \ctikzset{bipoles/resistor/height/.initial=.3}
522 \ctikzset{bipoles/resistor/width/.initial=.8}
523 \ctikzset{bipoles/potentiometer/height/.initial=.8}
524 \ctikzset{bipoles/potentiometer/height 2/.initial=.3}
525 \ctikzset{bipoles/potentiometer/width/.initial=.8}
526 \ctikzset{bipoles/photoresistor/height/.initial=.6}
527 \ctikzset{bipoles/photoresistor/height 2/.initial=.3}
528 \ctikzset{bipoles/photoresistor/width/.initial=.8}
529 \ctikzset{bipoles/thermistor/main/.initial=.7}
530 \ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
531 \ctikzset{bipoles/thermistorntc/width/.initial=.8}
532 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
533 \ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
534 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
535 \ctikzset{bipoles/thermistorptc/width/.initial=.8}
536 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
537 \ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
538 \ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
539 \ctikzset{bipoles/thermistor/width/.initial=.8}
540 \ctikzset{bipoles/varistor/main/.initial=.7}
541 \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
542 \ctikzset{bipoles/varistor/width/.initial=.8}
543 \ctikzset{bipoles/vresistor/height/.initial=.6}
544 \ctikzset{bipoles/vresistor/width/.initial=.8}
545 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
546 \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
547 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
548 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
549 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
550 %% Cute choke settings
551 \ctikzset{bipoles/cutechoke/height/.initial=.3}
552 \ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
553 \ctikzset{bipoles/cutechoke/width/.initial=.6}
554 \ctikzset{bipoles/cutechoke/coils/.initial=5}
555 \ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
556 \ctikzset{bipoles/cutechoke/cstep/.initial=.3}
557 \ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
558 \ctikzset{bipoles/cutechoke/cthick/.initial=1}
559 \newif\ifpgf@circuit@bipole@twolines
560 \pgf@circuit@bipole@twolinesfalse
561 %
562 \ctikzset{bipoles/americaninductor/height/.initial=.3}
563 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
564 \ctikzset{bipoles/americaninductor/width/.initial=.8}
565 \ctikzset{bipoles/americaninductor/coils/.initial=4}
566 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
567 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
568 \ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
569 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
570 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
571 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
572 \ctikzset{bipoles/vamericaninductor/height/.initial=.6}
573 \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
574 \ctikzset{bipoles/vamericaninductor/width/.initial=.8}
575 \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
576 \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
577 \ctikzset{bipoles/esource/height/.initial=.60}
578 \ctikzset{bipoles/esource/width/.initial=.60}
579 \ctikzset{bipoles/pvsource/height/.initial=.60}
580 \ctikzset{bipoles/pvsource/width/.initial=.60}
581 \ctikzset{bipoles/isource/height/.initial=.60}
582 \ctikzset{bipoles/isource/width/.initial=.60}
583 \ctikzset{bipoles/oosource/height/.initial=.60}
584 \ctikzset{bipoles/oosource/width/.initial=.60}
585 \ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
586 \ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
587 \ctikzset{bipoles/dcisource/angle/.initial=80}
588 \ctikzset{bipoles/dcisource/height/.initial=.60}
589 \ctikzset{bipoles/dcisource/width/.initial=.60}
590 \ctikzset{bipoles/dcvsource/height/.initial=.60}
591 \ctikzset{bipoles/dcvsource/width/.initial=.60}
592 \ctikzset{bipoles/vsourcetri/height/.initial=.60}
593 \ctikzset{bipoles/vsourcetri/width/.initial=.60}
594 \ctikzset{bipoles/isourceam/height/.initial=.60}
595 \ctikzset{bipoles/isourceam/width/.initial=.60}
596 \ctikzset{bipoles/vsource/height/.initial=.60}
597 \ctikzset{bipoles/vsource/width/.initial=.60}
598 \ctikzset{bipoles/vsourceam/height/.initial=.60}
599 \ctikzset{bipoles/vsourceam/width/.initial=.60}
600 \ctikzset{bipoles/vsourceam/margin/.initial=.7}
601 \ctikzset{bipoles/isourcesin/height/.initial=.60}
602 \ctikzset{bipoles/isourcesin/width/.initial=.60}
603 \ctikzset{bipoles/vsourcesin/height/.initial=.60}
604 \ctikzset{bipoles/vsourcesin/width/.initial=.60}
605 \ctikzset{bipoles/vsourcesquare/height/.initial=.60}
606 \ctikzset{bipoles/vsourcesquare/width/.initial=.60}
607 \ctikzset{bipoles/cisource/height/.initial=.7}
608 \ctikzset{bipoles/cisource/width/.initial=.7}
609 \ctikzset{bipoles/cisourceam/height/.initial=.7}
610 \ctikzset{bipoles/cisourceam/width/.initial=.7}
611 \ctikzset{bipoles/cvsource/height/.initial=.7}
612 \ctikzset{bipoles/cvsource/width/.initial=.7}
613 \ctikzset{bipoles/cvsourceam/height/.initial=.7}
614 \ctikzset{bipoles/cvsourceam/width/.initial=.7}
615 \ctikzset{bipoles/cvsourceam/margin/.initial=.7}
616 \ctikzset{bipoles/cvsourceam/text scale/.initial=1}
617 \ctikzset{bipoles/cisourcesin/width/.initial=.7}
618 \ctikzset{bipoles/cvsourcesin/height/.initial=.7}
619 \ctikzset{bipoles/cvsourcesin/width/.initial=.7}
620 \ctikzset{bipoles/capacitor/height/.initial=.6}
621 \ctikzset{bipoles/capacitor/width/.initial=.2}
622 \ctikzset{bipoles/ecapacitor/height/.initial=.5}
623 \ctikzset{bipoles/ecapacitor/width/.initial=.2}
624 \ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath}
625 \ctikzset{bipoles/pcapacitor/height/.initial=.6}
626 \ctikzset{bipoles/pcapacitor/width/.initial=.2}
627 \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
628 \ctikzset{bipoles/vcapacitor/height/.initial=.6}
629 \ctikzset{bipoles/vcapacitor/width/.initial=.5}
630 \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
631 \ctikzset{bipoles/piezoelectric/height/.initial=.7}
632 \ctikzset{bipoles/piezoelectric/width/.initial=.5}
633 \ctikzset{bipoles/battery/height/.initial=.6}
634 \ctikzset{bipoles/battery/width/.initial=.3}
635 \ctikzset{bipoles/battery1/height/.initial=.6}
636 \ctikzset{bipoles/battery1/width/.initial=.3}
637 \ctikzset{bipoles/battery2/height/.initial=.6}
638 \ctikzset{bipoles/battery2/width/.initial=.3}
639 \ctikzset{bipoles/diode/height/.initial=.50}
640 \ctikzset{bipoles/diode/width/.initial=.40}
641 \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
642 \ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
643 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
644 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
645 \ctikzset{bipoles/varcap/height/.initial=.50}
646 \ctikzset{bipoles/varcap/width/.initial=.45}
647 \ctikzset{bipoles/spst/height/.initial=.35}
648 \ctikzset{bipoles/spst/width/.initial=.35}
649 \ctikzset{bipoles/spst/depth/.initial=.2}
650 \ctikzset{bipoles/nos/height/.initial=.3}
651 \ctikzset{bipoles/nos/width/.initial=.35}
652 \ctikzset{bipoles/nos/depth/.initial=.2}
653 \ctikzset{bipoles/ncs/height/.initial=.35}
654 \ctikzset{bipoles/ncs/width/.initial=.35}
655 \ctikzset{bipoles/ncs/depth/.initial=.2}
656 \ctikzset{bipoles/generic/height/.initial=.30}
657 \ctikzset{bipoles/generic/width/.initial=.80}
658 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
659 \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
660 \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
661 \ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
662 \ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
663 \ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
664 \ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
665 \ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
666 \ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
667 \ctikzset{bipoles/fuse/height/.initial=.20}
668 \ctikzset{bipoles/fuse/width/.initial=.50}
669 \ctikzset{bipoles/afuse/height/.initial=.20}
670 \ctikzset{bipoles/afuse/width/.initial=.50}
671 \ctikzset{bipoles/generic potentiometer/height/.initial=.80}
672 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
673 \ctikzset{bipoles/generic potentiometer/width/.initial=.80}
674 \ctikzset{bipoles/ageneric/height/.initial=.30}
675 \ctikzset{bipoles/ageneric/width/.initial=.80}
676 \ctikzset{bipoles/memristor/height/.initial=.30}
677 \ctikzset{bipoles/memristor/wave height/.initial=.5}
678 \ctikzset{bipoles/memristor/width/.initial=.80}
679 \ctikzset{bipoles/tgeneric/height/.initial=.70}
680 \ctikzset{bipoles/tgeneric/width/.initial=.80}
681 \ctikzset{bipoles/tfullgeneric/height/.initial=.70}
682 \ctikzset{bipoles/tfullgeneric/width/.initial=.80}
683 \ctikzset{bipoles/fullgeneric/height/.initial=.30}
684 \ctikzset{bipoles/fullgeneric/width/.initial=.80}
685 \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
686 \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
687 \ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
688 \ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
689 \ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
690 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
691 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
692 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
693 \ctikzset{bipoles/ammeter/height/.initial=.60}
694 \ctikzset{bipoles/ammeter/width/.initial=.60}
695 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
696 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
697 \ctikzset{bipoles/voltmeter/height/.initial=.60}
698 \ctikzset{bipoles/voltmeter/width/.initial=.60}
699 \ctikzset{bipoles/smeter/height/.initial=.60}
700 \ctikzset{bipoles/smeter/width/.initial=.60}
701 \ctikzset{bipoles/qmeter/depth/.initial=.40}
702 \ctikzset{bipoles/qmeter/height/.initial=.80}
703 \ctikzset{bipoles/qmeter/width/.initial=.60}
704 \ctikzset{bipoles/iloop/width/.initial=.40}
705 \ctikzset{bipoles/iloop/height/.initial=.60}
706 \ctikzset{bipoles/oscope/height/.initial=.60}
707 \ctikzset{bipoles/oscope/width/.initial=.60}
708 \ctikzset{bipoles/buffer/height/.initial=1}
709 \ctikzset{bipoles/buffer/width/.initial=1}
710 \ctikzset{bipoles/not port/width/.initial=1}
711 \ctikzset{bipoles/not port/height/.initial=.8}
712 \ctikzset{bipoles/not port/circle width/.initial=.15}
713 \ctikzset{bipoles/lamp/height/.initial=.60}
714 \ctikzset{bipoles/lamp/width/.initial=.60}
715 \ctikzset{bipoles/bulb/height/.initial=.8}
716 \ctikzset{bipoles/bulb/width/.initial=.8}
717 \ctikzset{bipoles/tline/height/.initial=.3}
718 \ctikzset{bipoles/tline/width/.initial=.8}
719 \ctikzset{bipoles/squid/height/.initial=.60}
720 \ctikzset{bipoles/squid/width/.initial=.60}
721 \ctikzset{bipoles/barrier/height/.initial=.60}
722 \ctikzset{bipoles/barrier/width/.initial=.60}
723 \ctikzset{bipoles/thermocouple/height/.initial=.250}
724 \ctikzset{bipoles/thermocouple/height 2/.initial=.60}
725 \ctikzset{bipoles/thermocouple/width/.initial=.140}
726 \ctikzset{bipoles/pushbutton/height/.initial=.5}
727 \ctikzset{bipoles/pushbutton/height 2/.initial=.2}
728 \ctikzset{bipoles/pushbutton/width/.initial=.50}
729
730 \ctikzset{bipoles/twoport/width/.initial=.7}
731 \ctikzset{bipoles/twoport/height/.initial=.7}
732 \ctikzset{bipoles/twoport/text/.initial=}
733 \ctikzset{bipoles/vco/width/.initial=.7}
734 \ctikzset{bipoles/bandpass/width/.initial=.7}
735 \ctikzset{bipoles/bandstop/width/.initial=.7}
736 \ctikzset{bipoles/highpass/width/.initial=.7}
737 \ctikzset{bipoles/lowpass/width/.initial=.7}
738 \ctikzset{bipoles/adc/width/.initial=.7}
739 \ctikzset{bipoles/dac/width/.initial=.7}
740 \ctikzset{bipoles/dsp/width/.initial=.7}
741 \ctikzset{bipoles/fft/width/.initial=.7}
742 \ctikzset{bipoles/amp/width/.initial=.7}
743 \ctikzset{bipoles/vamp/width/.initial=.7}
744 \ctikzset{bipoles/piattenuator/width/.initial=.7}
745 \ctikzset{bipoles/vpiattenuator/width/.initial=.7}
746 \ctikzset{bipoles/tattenuator/width/.initial=.7}
747 \ctikzset{bipoles/vtattenuator/width/.initial=.7}
748 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
749 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
750 \ctikzset{bipoles/detector/width/.initial=.7}
751 % resistive sensor american style
752 \ctikzset{bipoles/resistivesens/height/.initial=.6}
753 \ctikzset{bipoles/resistivesens/width/.initial=.8}
754
755 % crossing wires
756 \ctikzset{bipoles/crossing/size/.initial=.2}
757
758 \newif\ifpgf@circuit@trans@depletiontype
759 \pgf@circuit@trans@depletiontypefalse
760
761 \newif\ifpgf@circuit@mos@arrows
762 \ctikzset{tripoles/mos style/.is choice}
763 \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
764 \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
765 \pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
766 \pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
767
768 % Option solderdot for fet
769 \newif\ifpgf@circuit@fet@solderdot
770 \pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
771 \ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
772 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
773 \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
774
775 % Option bodydiode for fet
776 \newif\ifpgf@circuit@fet@bodydiode
777 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
778 \ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
779 \pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
780 \ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
781
782 % Option draw fet without gate connection
783 \newif\ifpgf@circuit@bpt@drawgate
784 \pgf@circuit@bpt@drawgatetrue
785 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
786 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
787 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
788 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
789
790 % Option draw bpt without base connection
791 \newif\ifpgf@circuit@bpt@drawbase
792 \pgf@circuit@bpt@drawbasetrue
793 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
794 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
795 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
796 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
797
798 % Option draw bpt with optical input
799 \newif\ifpgf@circuit@bpt@drawphoto
800 \pgf@circuit@bpt@drawphotofalse
801 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
802 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
803 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
804 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
805
806 % Option draw pmos with empty circle
807 \newif\ifpgf@circuit@pmos@emptycircle
808 \pgf@circuit@pmos@emptycirclefalse
809 \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
810 \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
811 % Option draw pmos with no circle
812 \newif\ifpgf@circuit@pmos@nocircle
813 \pgf@circuit@pmos@nocirclefalse
814 \pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
815 \ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
816 % back to normal
817 \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
818 \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
819
820
821 \newif\ifpgf@circuit@trans@ntype
822 \pgf@circuit@trans@ntypetrue %default true
823 %\newif\ifpgf@circuit@trans@ptype
824 %\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
825 \ctikzset{tripoles/nmos/width/.initial=.7}
826 \ctikzset{tripoles/nmos/gate height/.initial=.35}
827 \ctikzset{tripoles/nmos/base height/.initial=.5}
828 \ctikzset{tripoles/nmos/conn height/.initial=0}
829 \ctikzset{tripoles/nmos/height/.initial=1.1}
830 \ctikzset{tripoles/nmos/base width/.initial=.5}
831 \ctikzset{tripoles/nmos/gate width/.initial=.62}
832 \ctikzset{tripoles/nmos/arrow pos/.initial=.6}
833 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
834 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
835 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
836 \ctikzset{tripoles/nmos/curr direction/.initial=1}
837
838 \ctikzset{tripoles/pmos/width/.initial=.7}
839 \ctikzset{tripoles/pmos/gate height/.initial=.35}
840 \ctikzset{tripoles/pmos/base height/.initial=.5}
841 \ctikzset{tripoles/pmos/conn height/.initial=0}
842 \ctikzset{tripoles/pmos/height/.initial=1.1}
843 \ctikzset{tripoles/pmos/base width/.initial=.5}
844 \ctikzset{tripoles/pmos/gate width/.initial=.62}
845 \ctikzset{tripoles/pmos/arrow pos/.initial=.4}
846 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
847 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
848 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
849 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
850
851 \ctikzset{tripoles/hemt/width/.initial=.7}
852 \ctikzset{tripoles/hemt/gate height/.initial=.35}
853 \ctikzset{tripoles/hemt/base height/.initial=.5}
854 \ctikzset{tripoles/hemt/conn height/.initial=0}
855 \ctikzset{tripoles/hemt/height/.initial=1.1}
856 \ctikzset{tripoles/hemt/base width/.initial=.5}
857 \ctikzset{tripoles/hemt/gate width/.initial=.62}
858 \ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
859 \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
860 \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
861 \ctikzset{tripoles/hemt/curr direction/.initial=1}
862
863 \ctikzset{tripoles/nfet/width/.initial=.7}
864 \ctikzset{tripoles/nfet/gate height/.initial=.35}
865 \ctikzset{tripoles/nfet/base height/.initial=.5}
866 \ctikzset{tripoles/nfet/conn height/.initial=0}
867 \ctikzset{tripoles/nfet/height/.initial=1.1}
868 \ctikzset{tripoles/nfet/base width/.initial=.5}
869 \ctikzset{tripoles/nfet/gate width/.initial=.62}
870 \ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
871 \ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
872 \ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
873 \ctikzset{tripoles/nfet/curr direction/.initial=1}
874
875 \ctikzset{tripoles/pfet/width/.initial=.7}
876 \ctikzset{tripoles/pfet/gate height/.initial=.35}
877 \ctikzset{tripoles/pfet/base height/.initial=.5}
878 \ctikzset{tripoles/pfet/conn height/.initial=0}
879 \ctikzset{tripoles/pfet/height/.initial=1.1}
880 \ctikzset{tripoles/pfet/base width/.initial=.5}
881 \ctikzset{tripoles/pfet/gate width/.initial=.62}
882 \ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
883 \ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
884 \ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
885 \ctikzset{tripoles/pfet/curr direction/.initial=-1}
886
887 \ctikzset{tripoles/nigfete/width/.initial=.7}
888 \ctikzset{tripoles/nigfete/gate height/.initial=.35}
889 \ctikzset{tripoles/nigfete/base height/.initial=.5}
890 \ctikzset{tripoles/nigfete/conn height/.initial=.35}
891 \ctikzset{tripoles/nigfete/height/.initial=1.1}
892 \ctikzset{tripoles/nigfete/base width/.initial=.5}
893 \ctikzset{tripoles/nigfete/gate width/.initial=.62}
894 \ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
895 \ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
896 \ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
897 \ctikzset{tripoles/nigfete/curr direction/.initial=1}
898
899 \ctikzset{tripoles/nigfetd/width/.initial=.7}
900 \ctikzset{tripoles/nigfetd/gate height/.initial=.35}
901 \ctikzset{tripoles/nigfetd/base height/.initial=.5}
902 \ctikzset{tripoles/nigfetd/conn height/.initial=.35}
903 \ctikzset{tripoles/nigfetd/height/.initial=1.1}
904 \ctikzset{tripoles/nigfetd/base width/.initial=.5}
905 \ctikzset{tripoles/nigfetd/gate width/.initial=.62}
906 \ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
907 \ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
908 \ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
909 \ctikzset{tripoles/nigfetd/curr direction/.initial=1}
910
911 \ctikzset{tripoles/nigfetebulk/width/.initial=.7}
912 \ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
913 \ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
914 \ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
915 \ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
916 \ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
917 \ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
918 \ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
919 \ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
920 \ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
921 \ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
922
923 \ctikzset{tripoles/pigfete/width/.initial=.7}
924 \ctikzset{tripoles/pigfete/gate height/.initial=.35}
925 \ctikzset{tripoles/pigfete/base height/.initial=.5}
926 \ctikzset{tripoles/pigfete/conn height/.initial=.35}
927 \ctikzset{tripoles/pigfete/height/.initial=1.1}
928 \ctikzset{tripoles/pigfete/base width/.initial=.5}
929 \ctikzset{tripoles/pigfete/gate width/.initial=.62}
930 \ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
931 \ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
932 \ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
933 \ctikzset{tripoles/pigfete/curr direction/.initial=-1}
934
935 \ctikzset{tripoles/pigfetd/width/.initial=.7}
936 \ctikzset{tripoles/pigfetd/gate height/.initial=.35}
937 \ctikzset{tripoles/pigfetd/base height/.initial=.5}
938 \ctikzset{tripoles/pigfetd/conn height/.initial=.35}
939 \ctikzset{tripoles/pigfetd/height/.initial=1.1}
940 \ctikzset{tripoles/pigfetd/base width/.initial=.5}
941 \ctikzset{tripoles/pigfetd/gate width/.initial=.62}
942 \ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
943 \ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
944 \ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
945 \ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
946
947 \ctikzset{tripoles/pigfetebulk/width/.initial=.7}
948 \ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
949 \ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
950 \ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
951 \ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
952 \ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
953 \ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
954 \ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
955 \ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
956 \ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
957 \ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
958
959 \ctikzset{tripoles/npn/width/.initial=.6}
960 \ctikzset{tripoles/npn/base height/.initial=.45}
961 \ctikzset{tripoles/npn/base height 2/.initial=.15}
962 \ctikzset{tripoles/npn/base height/.initial=.4}
963 \ctikzset{tripoles/npn/conn height/.initial=0}
964 \ctikzset{tripoles/npn/height/.initial=1.1}
965 \ctikzset{tripoles/npn/base width/.initial=.5}
966 \ctikzset{tripoles/npn/arrow pos/.initial=.5}
967 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
968 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
969 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
970 \ctikzset{tripoles/npn/curr direction/.initial=1}
971
972 \ctikzset{tripoles/pnp/width/.initial=.6}
973 \ctikzset{tripoles/pnp/base height/.initial=.45}
974 \ctikzset{tripoles/pnp/base height 2/.initial=.15}
975 \ctikzset{tripoles/pnp/base height/.initial=.4}
976 \ctikzset{tripoles/pnp/conn height/.initial=0}
977 \ctikzset{tripoles/pnp/height/.initial=1.1}
978 \ctikzset{tripoles/pnp/base width/.initial=.5}
979 \ctikzset{tripoles/pnp/arrow pos/.initial=.5}
980 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
981 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
982 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
983 \ctikzset{tripoles/pnp/curr direction/.initial=-1}
984
985 \ctikzset{tripoles/pigbt/width/.initial=.6}
986 \ctikzset{tripoles/pigbt/gate height/.initial=.45}
987 \ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
988 \ctikzset{tripoles/pigbt/base height/.initial=.4}
989 \ctikzset{tripoles/pigbt/conn height/.initial=0}
990 \ctikzset{tripoles/pigbt/height/.initial=1.1}
991 \ctikzset{tripoles/pigbt/gate width/.initial=.62}
992 \ctikzset{tripoles/pigbt/base width/.initial=.5}
993 \ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
994 \ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
995 \ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
996 \ctikzset{tripoles/pigbt/curr direction/.initial=-1}
997
998 \ctikzset{tripoles/nigbt/width/.initial=.6}
999 \ctikzset{tripoles/nigbt/gate height/.initial=.45}
1000 \ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
1001 \ctikzset{tripoles/nigbt/base height/.initial=.4}
1002 \ctikzset{tripoles/nigbt/conn height/.initial=0}
1003 \ctikzset{tripoles/nigbt/height/.initial=1.1}
1004 \ctikzset{tripoles/nigbt/gate width/.initial=.62}
1005 \ctikzset{tripoles/nigbt/base width/.initial=.5}
1006 \ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
1007 \ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
1008 \ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
1009 \ctikzset{tripoles/nigbt/curr direction/.initial=1}
1010
1011 \ctikzset{tripoles/Lpigbt/width/.initial=.6}
1012 \ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
1013 \ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
1014 \ctikzset{tripoles/Lpigbt/base height/.initial=.4}
1015 \ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
1016 \ctikzset{tripoles/Lpigbt/height/.initial=1.1}
1017 \ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
1018 \ctikzset{tripoles/Lpigbt/base width/.initial=.5}
1019 \ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
1020 \ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
1021 \ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
1022 \ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
1023
1024 \ctikzset{tripoles/Lnigbt/width/.initial=.6}
1025 \ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
1026 \ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
1027 \ctikzset{tripoles/Lnigbt/base height/.initial=.4}
1028 \ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
1029 \ctikzset{tripoles/Lnigbt/height/.initial=1.1}
1030 \ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
1031 \ctikzset{tripoles/Lnigbt/base width/.initial=.5}
1032 \ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
1033 \ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
1034 \ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
1035 \ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
1036
1037 \ctikzset{tripoles/njfet/width/.initial=.7}
1038 \ctikzset{tripoles/njfet/gate height/.initial=.5}
1039 \ctikzset{tripoles/njfet/gate height 2/.initial=.35}
1040 \ctikzset{tripoles/njfet/gate width/.initial=.5}
1041 \ctikzset{tripoles/njfet/conn height/.initial=.35}
1042 \ctikzset{tripoles/njfet/height/.initial=1.1}
1043 \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
1044 \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
1045 \ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
1046 \ctikzset{tripoles/njfet/curr direction/.initial=1}
1047
1048 \ctikzset{tripoles/pjfet/width/.initial=.7}
1049 \ctikzset{tripoles/pjfet/gate height/.initial=.5}
1050 \ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
1051 \ctikzset{tripoles/pjfet/gate width/.initial=.5}
1052 \ctikzset{tripoles/pjfet/conn height/.initial=.35}
1053 \ctikzset{tripoles/pjfet/height/.initial=1.1}
1054 \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
1055 \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
1056 \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
1057 \ctikzset{tripoles/pjfet/curr direction/.initial=-1}
1058
1059 \ctikzset{tripoles/isfet/width/.initial=1}
1060 \ctikzset{tripoles/isfet/gate height/.initial=.35}
1061 \ctikzset{tripoles/isfet/base height/.initial=.5}
1062 \ctikzset{tripoles/isfet/height/.initial=1.1}
1063 \ctikzset{tripoles/isfet/base width/.initial=.3}
1064 \ctikzset{tripoles/isfet/gate width/.initial=.5}
1065 \ctikzset{tripoles/isfet/conn height/.initial=0}
1066 \ctikzset{tripoles/isfet/wave width/.initial=.16}
1067 \ctikzset{tripoles/isfet/wave amp/.initial=.06}
1068 \ctikzset{tripoles/isfet/waves y sep/.initial=.22}
1069 \ctikzset{tripoles/isfet/waves x sep/.initial=.8}
1070 \ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
1071 \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
1072 \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
1073 \ctikzset{tripoles/isfet/curr direction/.initial=1}
1074
1075 \newif\ifpgf@circuit@europeanlogicport
1076 \ctikzset{logic ports/.is choice}
1077 \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
1078 \tikzset{and port/.style={shape=european and port}}
1079 \tikzset{or port/.style={shape=european or port}}
1080 \tikzset{xor port/.style={shape=european xor port}}
1081 \tikzset{not port/.style={shape=european not port}}
1082 \tikzset{nand port/.style={shape=european nand port}}
1083 \tikzset{nor port/.style={shape=european nor port}}
1084 \tikzset{xnor port/.style={shape=european xnor port}}
1085 } }
1086 \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
1087 \tikzset{and port/.style={shape=american and port}}
1088 \tikzset{or port/.style={shape=american or port}}
1089 \tikzset{xor port/.style={shape=american xor port}}
1090 \tikzset{not port/.style={shape=american not port}}
1091 \tikzset{nand port/.style={shape=american nand port}}
1092 \tikzset{nor port/.style={shape=american nor port}}
1093 \tikzset{xnor port/.style={shape=american xnor port}}
1094 } }
1095
1096 \ctikzset{logic ports origin/.is choice}
1097 \ctikzset{logic ports origin/legacy/.code= {
1098 \ctikzset{tripoles/american and port/origin/.initial=0.8}
1099 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
1100 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
1101 \ctikzset{tripoles/american or port/origin/.initial=0.8}
1102 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
1103 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
1104 \ctikzset{tripoles/european and port/origin/.initial=0.8}
1105 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
1106 \ctikzset{tripoles/european or port/origin/.initial=0.8}
1107 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
1108 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
1109 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
1110 \ctikzset{tripoles/european not port/origin/.initial=0.8}
1111 }
1112 }
1113 \ctikzset{logic ports origin/center/.code= {
1114 \ctikzset{tripoles/american and port/origin/.initial=0}
1115 \ctikzset{tripoles/american nand port/origin/.initial=0}
1116 \ctikzset{tripoles/american nor port/origin/.initial=0}
1117 \ctikzset{tripoles/american or port/origin/.initial=0}
1118 \ctikzset{tripoles/american xor port/origin/.initial=0}
1119 \ctikzset{tripoles/american xnor port/origin/.initial=0}
1120 \ctikzset{tripoles/european and port/origin/.initial=0}
1121 \ctikzset{tripoles/european nand port/origin/.initial=0}
1122 \ctikzset{tripoles/european or port/origin/.initial=0}
1123 \ctikzset{tripoles/european nor port/origin/.initial=0}
1124 \ctikzset{tripoles/european xor port/origin/.initial=0}
1125 \ctikzset{tripoles/european xnor port/origin/.initial=0}
1126 \ctikzset{tripoles/european not port/origin/.initial=0}
1127 }
1128 }
1129
1130
1131 \ctikzset{tripoles/american and port/width/.initial=1.1}
1132 \ctikzset{tripoles/american and port/height/.initial=.8}
1133 \ctikzset{tripoles/american and port/port width/.initial=.7}
1134 \ctikzset{tripoles/american and port/input height/.initial=.5}
1135 \ctikzset{tripoles/american nand port/width/.initial=1.1}
1136 \ctikzset{tripoles/american nand port/height/.initial=.8}
1137 \ctikzset{tripoles/american nand port/port width/.initial=.7}
1138 \ctikzset{tripoles/american nand port/circle width/.initial=.15}
1139 \ctikzset{tripoles/american nand port/input height/.initial=.5}
1140 \ctikzset{tripoles/american or port/width/.initial=1.1}
1141 \ctikzset{tripoles/american or port/height/.initial=.8}
1142 \ctikzset{tripoles/american or port/port width/.initial=.7}
1143 \ctikzset{tripoles/american or port/input height/.initial=.5}
1144 \ctikzset{tripoles/american or port/input skip/.initial=.25}
1145 \ctikzset{tripoles/american or port/aaa/.initial=.6}
1146 \ctikzset{tripoles/american or port/bbb/.initial=.4}
1147 \ctikzset{tripoles/american or port/ccc/.initial=.5}
1148 \ctikzset{tripoles/american or port/ddd/.initial=.0}
1149 \ctikzset{tripoles/american nor port/width/.initial=1.1}
1150 \ctikzset{tripoles/american nor port/height/.initial=.8}
1151 \ctikzset{tripoles/american nor port/port width/.initial=.7}
1152 \ctikzset{tripoles/american nor port/input height/.initial=.5}
1153 \ctikzset{tripoles/american nor port/input skip/.initial=.25}
1154 \ctikzset{tripoles/american nor port/circle width/.initial=.15}
1155 \ctikzset{tripoles/american nor port/aaa/.initial=.6}
1156 \ctikzset{tripoles/american nor port/bbb/.initial=.4}
1157 \ctikzset{tripoles/american nor port/ccc/.initial=.5}
1158 \ctikzset{tripoles/american nor port/ddd/.initial=.0}
1159 \ctikzset{tripoles/american xor port/width/.initial=1.1}
1160 \ctikzset{tripoles/american xor port/height/.initial=.8}
1161 \ctikzset{tripoles/american xor port/port width/.initial=.7}
1162 \ctikzset{tripoles/american xor port/input height/.initial=.5}
1163 \ctikzset{tripoles/american xor port/input skip/.initial=.15}
1164 \ctikzset{tripoles/american xor port/distance/.initial=.1}
1165 \ctikzset{tripoles/american xnor port/width/.initial=1.1}
1166 \ctikzset{tripoles/american xnor port/height/.initial=.8}
1167 \ctikzset{tripoles/american xnor port/port width/.initial=.7}
1168 \ctikzset{tripoles/american xnor port/input height/.initial=.5}
1169 \ctikzset{tripoles/american xnor port/input skip/.initial=.15}
1170 \ctikzset{tripoles/american xnor port/distance/.initial=.1}
1171 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
1172 \ctikzset{tripoles/american and port/origin/.initial=0.8}
1173 \ctikzset{tripoles/american and port/inputs/.initial=2}
1174 % variable number of inputs
1175 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
1176 \ctikzset{tripoles/american nand port/inputs/.initial=2}
1177 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
1178 \ctikzset{tripoles/american nor port/inputs/.initial=2}
1179 \ctikzset{tripoles/american nor port/angle/.initial=70}
1180 \ctikzset{tripoles/american nor port/inner/.initial=0.3}
1181 \ctikzset{tripoles/american or port/origin/.initial=0.8}
1182 \ctikzset{tripoles/american or port/inputs/.initial=2}
1183 \ctikzset{tripoles/american or port/angle/.initial=70}
1184 \ctikzset{tripoles/american or port/inner/.initial=0.3}
1185 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
1186 \ctikzset{tripoles/american xor port/inputs/.initial=2}
1187 \ctikzset{tripoles/american xor port/angle/.initial=70}
1188 \ctikzset{tripoles/american xor port/inner/.initial=0.3}
1189 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
1190 \ctikzset{tripoles/american xnor port/inputs/.initial=2}
1191 \ctikzset{tripoles/american xnor port/angle/.initial=70}
1192 \ctikzset{tripoles/american xnor port/inner/.initial=0.3}
1193
1194 \ctikzset{tripoles/european and port/width/.initial=1.4}
1195 \ctikzset{tripoles/european and port/height/.initial=.65}
1196 \ctikzset{tripoles/european and port/reserved/.initial=.6}
1197 \ctikzset{tripoles/european and port/input height/.initial=.6}
1198 \ctikzset{tripoles/european or port/width/.initial=1.4}
1199 \ctikzset{tripoles/european or port/height/.initial=.65}
1200 \ctikzset{tripoles/european or port/reserved/.initial=.6}
1201 \ctikzset{tripoles/european or port/input height/.initial=.6}
1202 \ctikzset{tripoles/european xor port/width/.initial=1.4}
1203 \ctikzset{tripoles/european xor port/height/.initial=.65}
1204 \ctikzset{tripoles/european xor port/reserved/.initial=.6}
1205 \ctikzset{tripoles/european xor port/input height/.initial=.6}
1206 \ctikzset{tripoles/european nand port/width/.initial=1.4}
1207 \ctikzset{tripoles/european nand port/not height/.initial=.3}
1208 \ctikzset{tripoles/european nand port/not width/.initial=.8}
1209 \ctikzset{tripoles/european nand port/height/.initial=.65}
1210 \ctikzset{tripoles/european nand port/reserved/.initial=.6}
1211 \ctikzset{tripoles/european nand port/input height/.initial=.6}
1212 \ctikzset{tripoles/european not port/width/.initial=1.4}
1213 \ctikzset{tripoles/european not port/not height/.initial=.3}
1214 \ctikzset{tripoles/european not port/not width/.initial=.8}
1215 \ctikzset{tripoles/european not port/height/.initial=.65}
1216 \ctikzset{tripoles/european not port/reserved/.initial=.6}
1217 \ctikzset{tripoles/european not port/input height/.initial=0}
1218 \ctikzset{tripoles/european xnor port/width/.initial=1.4}
1219 \ctikzset{tripoles/european xnor port/not height/.initial=.3}
1220 \ctikzset{tripoles/european xnor port/not width/.initial=.8}
1221 \ctikzset{tripoles/european xnor port/height/.initial=.65}
1222 \ctikzset{tripoles/european xnor port/reserved/.initial=.6}
1223 \ctikzset{tripoles/european xnor port/input height/.initial=.6}
1224 \ctikzset{tripoles/european nor port/width/.initial=1.4}
1225 \ctikzset{tripoles/european nor port/not height/.initial=.3}
1226 \ctikzset{tripoles/european nor port/not width/.initial=.8}
1227 \ctikzset{tripoles/european nor port/height/.initial=.65}
1228 \ctikzset{tripoles/european nor port/reserved/.initial=.6}
1229 \ctikzset{tripoles/european nor port/input height/.initial=.6}
1230 % variable number of inputs
1231 \ctikzset{tripoles/european and port/origin/.initial=0.8}
1232 \ctikzset{tripoles/european and port/inputs/.initial=2}
1233 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
1234 \ctikzset{tripoles/european nand port/inputs/.initial=2}
1235 \ctikzset{tripoles/european or port/origin/.initial=0.8}
1236 \ctikzset{tripoles/european or port/inputs/.initial=2}
1237 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
1238 \ctikzset{tripoles/european nor port/inputs/.initial=2}
1239 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
1240 \ctikzset{tripoles/european xor port/inputs/.initial=2}
1241 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
1242 \ctikzset{tripoles/european xnor port/inputs/.initial=2}
1243 \ctikzset{tripoles/european not port/origin/.initial=0.8}
1244 \ctikzset{tripoles/european not port/inputs/.initial=1}%
1245 %%% parameters that are not used anymore after multi-input
1246 %%% gates --- left for compatibility of source code.
1247 \ctikzset{tripoles/american xor port/aaa/.initial=.6}
1248 \ctikzset{tripoles/american xor port/bbb/.initial=.4}
1249 \ctikzset{tripoles/american xor port/ccc/.initial=.5}
1250 \ctikzset{tripoles/american xor port/ddd/.initial=.0}
1251 \ctikzset{tripoles/american xnor port/aaa/.initial=.6}
1252 \ctikzset{tripoles/american xnor port/bbb/.initial=.4}
1253 \ctikzset{tripoles/american xnor port/ccc/.initial=.5}
1254 \ctikzset{tripoles/american xnor port/ddd/.initial=.0}
1255 % switches for logic gates
1256 %
1257 \pgfkeys{/tikz/number inputs/.initial=0}
1258 \pgfkeys{/tikz/number inputs/.default=0}
1259 %
1260 % switches for op amps
1261 % changing input polarity
1262 %
1263 \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
1264 \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1265 \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1266 \pgfkeys{/tikz/input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1267 \ctikzset{input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1268 %
1269 % changing output polarity (for fully diff objects)
1270 %
1271 \newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
1272 \pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1273 \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1274 \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1275 \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1276 %
1277 \ctikzset{tripoles/op amp/width/.initial=1.7}
1278 \ctikzset{tripoles/op amp/port width/.initial=.7}
1279 \ctikzset{tripoles/op amp/height/.initial=1.4}
1280 \ctikzset{tripoles/op amp/input height/.initial=.5}
1281 \ctikzset{tripoles/op amp/up pos/.initial=.45}
1282 \ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath}%absolute font size needed!
1283 \ctikzset{tripoles/en amp/width/.initial=1.7}
1284 \ctikzset{tripoles/en amp/port width/.initial=.7}
1285 \ctikzset{tripoles/en amp/height/.initial=1.6}
1286 \ctikzset{tripoles/en amp/input height/.initial=.3}
1287 \ctikzset{tripoles/en amp/up pos/.initial=.45}
1288 \ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{12}\selectfont}%absolute font size needed!
1289 \ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont}%absolute font size needed!
1290 \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
1291 \tikzset{
1292 en amp text/.code = {
1293 \ctikzsetvalof{tripoles/en amp/text}{#1}
1294 },
1295 en amp text A/.code = {
1296 \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}
1297 },
1298 }
1299 \ctikzset{tripoles/gm amp/width/.initial=1.7}
1300 \ctikzset{tripoles/gm amp/port width/.initial=.7}
1301 \ctikzset{tripoles/gm amp/height/.initial=1.4}
1302 \ctikzset{tripoles/gm amp/input height/.initial=.5}
1303 \ctikzset{tripoles/gm amp/up pos/.initial=.45}
1304 \ctikzset{tripoles/inst amp/width/.initial=1.7} % instrumentation amplifier, simple
1305 \ctikzset{tripoles/inst amp/port width/.initial=.7}
1306 \ctikzset{tripoles/inst amp/height/.initial=1.4}
1307 \ctikzset{tripoles/inst amp/input height/.initial=.5}
1308 \ctikzset{tripoles/inst amp/up pos/.initial=.4}
1309 \ctikzset{tripoles/inst amp/refv pos/.initial=.7}
1310 \ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1311 \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % instrumentation amplifier, diff output
1312 \ctikzset{tripoles/fd inst amp/port width/.initial=.7}
1313 \ctikzset{tripoles/fd inst amp/height/.initial=1.4}
1314 \ctikzset{tripoles/fd inst amp/input height/.initial=.5}
1315 \ctikzset{tripoles/fd inst amp/up pos/.initial=.4}
1316 \ctikzset{tripoles/fd inst amp/refv pos/.initial=.7}
1317 \ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1318 \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % instrumentation amplifier with ra gain resistance added
1319 \ctikzset{tripoles/inst amp ra/port width/.initial=.7}
1320 \ctikzset{tripoles/inst amp ra/height/.initial=2.9}
1321 \ctikzset{tripoles/inst amp ra/input height/.initial=.7}
1322 \ctikzset{tripoles/inst amp ra/up pos/.initial=.4}
1323 \ctikzset{tripoles/inst amp ra/refv pos/.initial=.7}
1324 \ctikzset{tripoles/inst amp ra/ra pos/.initial=.6}
1325 \ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
1326 \ctikzset{tripoles/plain amp/width/.initial=1.7}
1327 \ctikzset{tripoles/plain amp/port width/.initial=.7}
1328 \ctikzset{tripoles/plain amp/height/.initial=1.4}
1329 \ctikzset{tripoles/plain amp/input height/.initial=.5}
1330 \ctikzset{tripoles/plain amp/up pos/.initial=.45}
1331
1332 \ctikzset{tripoles/thyristor/height/.initial=1.10}
1333 \ctikzset{tripoles/thyristor/height 2/.initial=.5}
1334 \ctikzset{tripoles/thyristor/width/.initial=1.0}
1335 \ctikzset{tripoles/thyristor/diode height/.initial=.5}
1336 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
1337 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
1338
1339 \ctikzset{tripoles/triac/height/.initial=1.1}
1340 \ctikzset{tripoles/triac/width/.initial=1}
1341 \ctikzset{tripoles/triac/diode width left/.initial=.3}
1342 \ctikzset{tripoles/triac/diode width right/.initial=.3}
1343
1344 %% Cute switches
1345 \ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
1346 \ctikzset{bipoles/cuteswitch/height/.initial=.6}
1347 \ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
1348 \ctikzset{bipoles/cuteswitch/width/.initial=.50}
1349 \ctikzset{bipoles/cuteswitch/thickness/.initial=1}
1350
1351 \ctikzset{tripoles/spdt/width/.initial=.85}
1352 \ctikzset{tripoles/spdt/height/.initial=.45}
1353 \ctikzset{tripoles/spdt/margin/.initial=.45}
1354
1355 \ctikzset{tripoles/toggleswitch/height/.initial=.8}
1356 \ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
1357 \ctikzset{tripoles/toggleswitch/width/.initial=.80}
1358
1359 \ctikzset{tripoles/mixer/width/.initial=0.7}
1360 \ctikzset{tripoles/adder/width/.initial=0.7}
1361 \ctikzset{tripoles/circulator/width/.initial=.7}
1362 \ctikzset{tripoles/oscillator/width/.initial=.7}
1363
1364
1365 \ctikzset{tripoles/wilkinson/height/.initial=1.3}
1366 \ctikzset{tripoles/wilkinson/width/.initial=1.3}
1367
1368 \ctikzset{quadpoles/transformer/inner/.initial=0.4}
1369 \ctikzset{quadpoles/transformer/width/.initial=1.5}
1370 \ctikzset{quadpoles/transformer/width1/.initial=.4}
1371 \ctikzset{quadpoles/transformer/height/.initial=1.5}
1372 \ctikzset{quadpoles/transformer/height1/.initial=.8}
1373 \ctikzset{quadpoles/transformer core/inner/.initial=0.4}
1374 \ctikzset{quadpoles/transformer core/width/.initial=1.5}
1375 \ctikzset{quadpoles/transformer core/height/.initial=1.5}
1376 \ctikzset{quadpoles/transformer core/core height/.initial=.5}
1377 \ctikzset{quadpoles/transformer core/core width/.initial=.05}
1378 \ctikzset{quadpoles/gyrator/inner/.initial=0.4}
1379 \ctikzset{quadpoles/gyrator/width/.initial=1.5}
1380 \ctikzset{quadpoles/gyrator/height/.initial=1.5}
1381 \ctikzset{quadpoles/fourport/width/.initial=1.3}
1382 \ctikzset{quadpoles/fourport/height/.initial=1.3}
1383 \ctikzset{quadpoles/coupler/width/.initial=1.3}
1384 \ctikzset{quadpoles/coupler/height/.initial=1.3}
1385 \ctikzset{quadpoles/coupler2/width/.initial=1.3}
1386 \ctikzset{quadpoles/coupler2/height/.initial=1.3}
1387
1388 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
1389
1390 \ctikzset{quadpoles style/.is choice}
1391 \ctikzset{quadpoles style/inward/.code={ % default value
1392 \ctikzset{quadpoles/transformer/inner=0.4}
1393 \ctikzset{quadpoles/transformer/width=1.5}
1394 \ctikzset{quadpoles/transformer core/inner=0.4}
1395 \ctikzset{quadpoles/transformer core/width=1.5}
1396 \ctikzset{quadpoles/gyrator/inner=0.4}
1397 \ctikzset{quadpoles/gyrator/width=1.5}
1398 }
1399 }
1400 \ctikzset{quadpoles style/inline/.code={ % now horizontal baffle
1401 \ctikzset{quadpoles/transformer/inner=1}
1402 \ctikzset{quadpoles/transformer/width=0.6}
1403 \ctikzset{quadpoles/transformer core/inner=1}
1404 \ctikzset{quadpoles/transformer core/width=0.6}
1405 \ctikzset{quadpoles/gyrator/inner=1}
1406 \ctikzset{quadpoles/gyrator/width=0.6}
1407 }
1408 }
1409
1410
1411 %
1412 % multipoles
1413 %
1414 \ctikzset{multipoles/thickness/.initial=2}
1415 \ctikzset{multipoles/font/.initial=\tiny}
1416 % DIP (dual in line package) chips
1417 \ctikzset{multipoles/dipchip/width/.initial=1.2}
1418 \ctikzset{multipoles/dipchip/num pins/.initial=8}
1419 \ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
1420 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
1421 % QFP (quad flat package) chips
1422 \ctikzset{multipoles/qfpchip/num pins/.initial=8}
1423 \ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
1424 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
1425 % chip numbers
1426 \newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
1427 \pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1428 \ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1429 \pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1430 \ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1431 \newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
1432 \pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1433 \ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1434 \pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1435 \ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1436 % external chip pins
1437 \ctikzset{multipoles/external pins thickness/.initial=1}
1438 \ctikzset{multipoles/external pins width/.initial=0.2}
1439 \ctikzset{multipoles/external pad fraction/.initial=0}
1440 \pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
1441 \pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
1442 % topmarks
1443 \newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
1444 \pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1445 \ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1446 \pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1447 \ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1448
1449 % rotary switch by Romano
1450 \ctikzset{multipoles/rotary/thickness/.initial=1}
1451 \ctikzset{multipoles/rotary/shape/.initial=ocirc}
1452 \ctikzset{multipoles/rotary/channels/.initial=5}
1453 \ctikzset{multipoles/rotary/angle/.initial=60}
1454 \ctikzset{multipoles/rotary/wiper/.initial=20}
1455 \ctikzset{multipoles/rotary/arrow/.is choice}
1456 \newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
1457 \newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
1458 \newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
1459 \ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
1460 \ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
1461 \ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
1462 \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
1463
1464 \tikzset{%
1465 rotary switch/.style args={#1in#2wiper#3}{
1466 shape=rotaryswitch,
1467 /tikz/circuitikz/multipoles/rotary/channels=#1,
1468 /tikz/circuitikz/multipoles/rotary/angle=#2,
1469 /tikz/circuitikz/multipoles/rotary/wiper=#3,
1470 },
1471 rotary switch -/.style args={#1in#2wiper#3}{
1472 rotary switch=#1 in #2 wiper #3,
1473 /tikz/circuitikz/multipoles/rotary/arrow=none,
1474 },
1475 rotary switch <-/.style args={#1in#2wiper#3}{
1476 rotary switch=#1 in #2 wiper #3,
1477 /tikz/circuitikz/multipoles/rotary/arrow=ccw,
1478 },
1479 rotary switch ->/.style args={#1in#2wiper#3}{
1480 rotary switch=#1 in #2 wiper #3,
1481 /tikz/circuitikz/multipoles/rotary/arrow=cw,
1482 },
1483 rotary switch <->/.style args={#1in#2wiper#3}{
1484 rotary switch=#1 in #2 wiper #3,
1485 /tikz/circuitikz/multipoles/rotary/arrow=both,
1486 },
1487 % Notice that these should be the same as the initial values of the keys
1488 rotary switch/.default={5 in 60 wiper 20 },
1489 rotary switch -/.default={5 in 60 wiper 20 },
1490 rotary switch <-/.default={5 in 60 wiper 20 },
1491 rotary switch ->/.default={5 in 60 wiper 20 },
1492 rotary switch <->/.default={5 in 60 wiper 20 },
1493 }
1494
1495 % %Mechanical section
1496 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
1497 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
1498 \ctikzset{bipoles/spring/height/.initial=.5}
1499 \ctikzset{bipoles/spring/width/.initial=.5}
1500 \ctikzset{bipoles/mass/height/.initial=.55}
1501 \ctikzset{bipoles/mass/box height/.initial=.4}
1502 \ctikzset{bipoles/mass/width/.initial=.5}
1503
1504 \ctikzset{bipoles/damper/height/.initial=.35}
1505 \ctikzset{bipoles/damper/length/.initial=.3}
1506 \ctikzset{bipoles/damper/width/.initial=.4}
1507
1508
1509 \ctikzset{bipole/.is family}
1510 \ctikzset{bipole/kind/.initial = }
1511 \ctikzset{bipole/name/.initial = }
1512 \newif\ifpgf@circuit@bipole@isvoltage
1513 \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
1514 \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
1515 \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
1516 \newif\ifpgf@circuit@bipole@strokedsymbol
1517 \ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
1518 \newif\ifpgf@circuit@bipole@iscurrent
1519 \ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
1520
1521 \ctikzset{bipole/voltage/.is family}
1522 \newif\ifpgf@circuit@bipole@voltage@backward
1523 \ctikzset{bipole/voltage/direction/.is choice}
1524 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
1525 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
1526 \newif\ifpgf@circuit@bipole@voltage@below
1527 \ctikzset{bipole/voltage/position/.is choice}
1528 \ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
1529 \ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
1530
1531 \ctikzset{bipole/voltage/label/unit/.initial=}
1532 \ctikzset{bipole/voltage/label/name/.initial=}
1533
1534 \ctikzset{bipole/current/.is family}
1535 \newif\ifpgf@circuit@bipole@current@backward
1536 \ctikzset{bipole/current/direction/.is choice}
1537 \ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
1538 \ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
1539 \newif\ifpgf@circuit@bipole@current@before
1540 \ctikzset{bipole/current/x position/.is choice}
1541 \ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
1542 \ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
1543 \newif\ifpgf@circuit@bipole@current@below
1544 \ctikzset{bipole/current/y position/.is choice}
1545 \ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
1546 \ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
1547 \ctikzset{bipole/current/label/unit/.initial=}
1548 \ctikzset{bipole/current/label/name/.initial=}
1549
1550 \ctikzset{bipole/flow/.is family}
1551 \newif\ifpgf@circuit@bipole@flow@backward
1552 \ctikzset{bipole/flow/direction/.is choice}
1553 \ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
1554 \ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
1555 \newif\ifpgf@circuit@bipole@flow@before
1556 \ctikzset{bipole/flow/x position/.is choice}
1557 \ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
1558 \ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
1559 \newif\ifpgf@circuit@bipole@flow@below
1560 \ctikzset{bipole/flow/y position/.is choice}
1561 \ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
1562 \ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
1563 \ctikzset{bipole/flow/label/unit/.initial=}
1564 \ctikzset{bipole/flow/label/name/.initial=}
1565 \ctikzset{flow/distance/.initial = .5}
1566 \ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
1567
1568 \ctikzset{bipole/label/.is family}
1569 \ctikzset{bipole/label/position/.initial=90}
1570 \ctikzset{bipole/label/unit/.initial=}
1571 \ctikzset{bipole/label/name/.initial=}
1572 \ctikzset{bipole/annotation/.is family}
1573 \ctikzset{bipole/annotation/position/.initial=-90}
1574 \ctikzset{bipole/annotation/unit/.initial=}
1575 \ctikzset{bipole/annotation/name/.initial=}
1576
1577 \newif\ifpgf@circuit@europeanresistor
1578 \ctikzset{resistor/.is choice}
1579 \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
1580 \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
1581
1582 \ctikzset{inductor/.is choice}
1583 \ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
1584 \ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
1585 \ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
1586
1587 \newif\ifpgf@circuit@strokediode
1588 \newif\ifpgf@circuit@fulldiode
1589 \pgf@circuit@strokediodefalse
1590 \pgf@circuit@fulldiodefalse
1591
1592 \ctikzset{diode/.is choice}
1593 \ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
1594 \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
1595 \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
1596
1597 \tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }}
1598 \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }}
1599 \tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }}
1600
1601 \ctikzset{thickness/.initial=2}
1602 \ctikzset{color/.initial=black}
1603 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
1604
1605 \newif\ifpgf@circ@siunitx
1606 \newif\ifpgf@circ@siunitx@res
1607
1608 \ctikzset{straight/.is choice}
1609 \ctikzset{straightvoltage value/.initial=true}
1610 \ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
1611 \ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
1612 \ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
1613 \newif\ifpgf@circuit@bipole@voltage@straight
1614 \ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
1615
1616
1617 \ctikzset{voltage/.is family}
1618 \ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
1619 \ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
1620 \ctikzset{voltage/bump a/.initial=1.2}
1621 \ctikzset{voltage/bump b/.initial=1.5}
1622 \ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
1623 \ctikzset{voltage shift/.style={voltage/shift=#1}}
1624 \tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
1625 \ctikzset{voltage/european label distance/.initial=1.4}
1626 \ctikzset{voltage/american label distance/.initial=1.1}
1627 % shaping the +/- sign, see pgfcircvoltage.tex
1628 \ctikzset{voltage/american font/.initial={}}
1629 \ctikzset{voltage/american plus/.initial={$+$}}
1630 \ctikzset{voltage/american minus/.initial={$-$}}
1631
1632 % special cases
1633 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
1634 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
1635 \ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
1636 %\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
1637 \ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
1638 \ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
1639 \ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
1640 \ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
1641 \ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
1642 \ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
1643 \ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
1644 \ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
1645 \ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
1646 \ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
1647 \ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
1648 %\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
1649 \ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
1650 \ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
1651 %\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
1652 \ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
1653 \ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
1654 %\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
1655 \ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
1656 \ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
1657 %\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
1658 \ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
1659 \ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
1660 %\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
1661 \ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
1662 %\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
1663 \ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
1664
1665 \ctikzset{current/.is family}
1666 \ctikzset{current/distance/.initial = .5}
1667
1668
1669 \tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
1670 \tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
1671 \tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
1672 \tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
1673 \tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
1674 \tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
1675
1676 \newif\ifpgf@circuit@europeangfsurgearrester
1677 \ctikzset{gas filled surge arrester choice/.is choice}
1678 \ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
1679 \ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
1680
1681 \tikzset{american gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=american } }
1682 \tikzset{european gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=european } }
1683 \tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
1684 \tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
1685 \tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
1686 \tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
1687 \tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
1688 \tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set} }
1689 \tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set} }
1690 \tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
1691
1692 % I should try to make the tree clearer (this voltage conflicts with the options above)
1693
1694 \newif\ifpgf@circuit@europeanvoltage
1695 \ctikzset{voltage/.is choice}
1696 \ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
1697 \ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
1698
1699 \newif\ifpgf@circuit@europeancurrent
1700 \ctikzset{current/.is choice}
1701 \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
1702 \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
1703
1704 % noise sources
1705 \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
1706
1707 \ctikzset{label/align/.is choice}
1708 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
1709 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
1710 \ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
1711
1712 % seven segment displays by RGtti
1713
1714 \newif\ifpgf@circ@sevenseg@dot
1715 \newif\ifpgf@circ@sevenseg@box
1716 \def\pgf@circ@sevenseg@dotstate{empty}
1717 \ctikzset{seven seg/.is family}
1718 \ctikzset{seven seg/dot/.is choice}
1719 % none means no dot, not space for it. Empty means no dot, but space
1720 \ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
1721 \ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
1722 \ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
1723 \ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
1724 %
1725 \ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
1726 \ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
1727 \ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
1728 \ctikzset{seven seg/box sep/.initial=1pt}% external box gap
1729 \ctikzset{seven seg/color on/.initial=red}% color for segment "on"
1730 \ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
1731 \ctikzset{seven seg/box/.is choice}
1732 \ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
1733 \ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
1734
1735 \ctikzset{seven seg/bits/.initial=0000000}
1736
1737 \ctikzset{seven seg/value/.code={
1738 \edef\@@tmp{#1}
1739 \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
1740 \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
1741 \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
1742 \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
1743 \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
1744 \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
1745 \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
1746 \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
1747 \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
1748 \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
1749 \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1750 \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1751 \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1752 \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1753 \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1754 \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1755 \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1756 \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1757 \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1758 \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1759 \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1760 \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1761 \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1762 \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1763 \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1764 \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1765 \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1766 \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1767 \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
1768 }}
1769
1770 \tikzset{%
1771 seven segment val/.style args={#1dot#2box#3}{
1772 shape=bare7seg,
1773 /tikz/circuitikz/seven seg/value=#1,
1774 /tikz/circuitikz/seven seg/dot=#2,
1775 /tikz/circuitikz/seven seg/box=#3,
1776 },
1777 seven segment bits/.style args={#1dot#2box#3}{
1778 shape=bare7seg,
1779 /tikz/circuitikz/seven seg/bits=#1,
1780 /tikz/circuitikz/seven seg/dot=#2,
1781 /tikz/circuitikz/seven seg/box=#3,
1782 },
1783 }
1784
1785
1786 %%%%%%%%%% new
1787 \pgfkeys{\circuitikzbasekey/.search also={/tikz}}
1788
1789 % Electronic tubes: diodetube, triode, tetrode and pentode
1790 \ctikzset{tubes/width/.initial=1} % relative width
1791 \ctikzset{tubes/height/.initial=1.4} % relative height
1792 \ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
1793 \ctikzset{tubes/anode distance/.initial=0.40} % distance from center
1794 \ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
1795 \ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
1796 \ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
1797 \ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
1798 \ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
1799 \ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
1800 \ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
1801 \ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
1802 \ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
1803 \ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
1804 \ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
1805
1806 \newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
1807 \pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1808 \ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1809 \newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
1810 \pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1811 \ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1812 \newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
1813 \pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1814 \ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1815
1816 %%%---------- close: tex/pgfcirc.defines
1817 %%%%%%%%%%% Springe nach tex/pgfcircutils
1818 %%%---------- open: tex/pgfcircutils.tex
1819 % Copyright 2007-2009 by Massimo Redaelli
1820 %
1821 % This file may be distributed and/or modified
1822 %
1823 % 1. under the LaTeX Project Public License and/or
1824 % 2. under the GNU Public License.
1825 %
1826 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1827
1828 %\def\pgf@circ@handleSI#1{%
1829 % \pgf@circ@siunitx@resfalse
1830 %
1831 % \edef\len{\stringlength[e]{#1}}
1832 %\testmatchingchar[e]{#1}{\len}{>}%
1833 %\ifmatchingchar%
1834 % \ifnum\findchars{#1}{<}=0
1835 % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
1836 %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
1837 %\pgf@circ@siunitx@restrue
1838 % \else
1839 % \fi
1840 %\else
1841 %\fi
1842 %}
1843
1844 \def\pgf@circ@handleSI#1{
1845 \noexpandarg
1846 \def\pgf@temp{}
1847 \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
1848 \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
1849
1850 \ifnum\pgf@circ@handleSI@unit@len=0
1851 \pgf@circ@siunitx@resfalse
1852 \else
1853 \IfEndWith{#1}{>}{
1854 \pgf@circ@siunitx@restrue
1855 \noexpandarg
1856 \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
1857 %\typeout{si |#1|}
1858 }{
1859 \pgf@circ@siunitx@resfalse
1860 %\typeout{no si |#1|}
1861 }
1862 \fi
1863 }
1864
1865 \def\pgf@circ@ifkeyempty#1{
1866 \pgfextra{
1867 \ctikzset{#1/.get=\pgf@circ@temp}
1868 \edef\pgf@temp{}
1869 }
1870 \ifx\pgf@circ@temp\pgf@temp
1871 }
1872
1873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1874 %% Math routines
1875
1876 \def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
1877
1878 %%%---------- close: tex/pgfcircutils
1879
1880 %%%%%%%%%%% Springe nach tex/pgfcircshapes
1881 %%%---------- open: tex/pgfcircshapes.tex
1882 % Copyright 2007-2009 by Massimo Redaelli
1883 %
1884 % This file may be distributed and/or modified
1885 %
1886 % 1. under the LaTeX Project Public License and/or
1887 % 2. under the GNU Public License.
1888 %
1889 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1890
1891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1892 %% Other shapes
1893
1894 %% Nothing
1895
1896 \pgfdeclareshape{emptyshape}{
1897 \savedanchor{\northeast}{%
1898 \pgf@x=.5\wd\pgfnodeparttextbox%
1899 \pgf@y=.5\ht\pgfnodeparttextbox%
1900 }
1901 \anchor{north}{\northeast\pgf@x=0cm\relax}
1902 \anchor{east}{\northeast\pgf@y=0cm\relax}
1903 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
1904 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
1905 \anchor{north east}{\northeast}
1906 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
1907 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
1908 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
1909 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
1910 \anchor{center}{
1911 \pgfpointorigin
1912 }
1913 }
1914
1915 %% Full terminal
1916
1917 \pgfdeclareshape{circ}{
1918 \anchor{center}{
1919 \pgfpointorigin
1920 }
1921 \savedanchor\northwest{%
1922 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1923 \pgf@x=-\pgf@y
1924 }
1925 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1926 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1927 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1928 \anchor{west}{ \northwest \pgf@y=0pt }
1929 \anchor{w}{ \northwest \pgf@y=0pt }
1930 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1931 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1932 \anchor{north}{ \northwest \pgf@x=0pt }
1933 \anchor{n}{ \northwest \pgf@x=0pt }
1934 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1935 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1936 \anchor{north west}{ \northwest }
1937 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1938 \anchorborder{
1939 \pgf@circ@res@left=\pgf@x
1940 \pgf@circ@res@up=\pgf@y
1941 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1942 }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
1943 }
1944 \behindforegroundpath{
1945
1946 \pgfscope
1947 \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
1948 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1949 \pgfsetfillopacity{1.0}
1950 \pgfusepath{draw,fill}
1951 \endpgfscope
1952
1953 }
1954 }
1955
1956 %% Empty terminal
1957
1958 \pgfdeclareshape{ocirc}{
1959 \anchor{center}{
1960 \pgfpointorigin
1961 }
1962 \savedanchor\northwest{%
1963 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
1964 \pgf@x=-\pgf@y
1965 }
1966 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1967 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1968 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1969 \anchor{west}{ \northwest \pgf@y=0pt }
1970 \anchor{w}{ \northwest \pgf@y=0pt }
1971 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1972 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1973 \anchor{north}{ \northwest \pgf@x=0pt }
1974 \anchor{n}{ \northwest \pgf@x=0pt }
1975 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1976 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1977 \anchor{north west}{ \northwest }
1978 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1979 \anchorborder{
1980 \pgf@circ@res@left=\pgf@x
1981 \pgf@circ@res@up=\pgf@y
1982 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1983 }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
1984 }
1985
1986 \behindforegroundpath{
1987
1988 \pgfscope
1989 \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
1990 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
1991 \ifx\tikz@fillcolor\pgfutil@empty
1992 \pgfsetfillcolor{white}
1993 \else
1994 \pgfsetfillcolor{\tikz@fillcolor}
1995 \fi
1996 \pgfsetfillopacity{1.0}
1997 \pgfusepath{draw,fill}
1998 \endpgfscope
1999
2000 }
2001 }
2002
2003 %% Diamond terminal
2004
2005 \pgfdeclareshape{diamondpole}{
2006 \anchor{center}{
2007 \pgfpointorigin
2008 }
2009 \savedanchor\northwest{%
2010 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2011 \pgf@x=-\pgf@y
2012 }
2013 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2014 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2015 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2016 \anchor{west}{ \northwest \pgf@y=0pt }
2017 \anchor{w}{ \northwest \pgf@y=0pt }
2018 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2019 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2020 \anchor{north}{ \northwest \pgf@x=0pt }
2021 \anchor{n}{ \northwest \pgf@x=0pt }
2022 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2023 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2024 \anchor{north west}{ \northwest }
2025 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2026 \anchorborder{
2027 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2028 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2029 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2030 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2031 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2032 \pgfextracty{\pgf@circ@res@up}{\northwest}
2033 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2034 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2035 \pgfpointintersectionoflines
2036 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2037 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2038 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2039 \pgf@x=\@@switchx\pgf@x
2040 \pgf@y=\@@switchy\pgf@y
2041 }
2042 \behindforegroundpath{
2043 \pgfscope
2044 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2045 \pgftransformrotate{45}
2046 \pgfpathrectanglecorners
2047 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2048 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2049 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2050 \pgfsetfillopacity{1.0}
2051 \pgfusepath{draw,fill}
2052 \endpgfscope
2053 }
2054 }
2055
2056 %% Diamond terminal, unfilled
2057
2058 \pgfdeclareshape{odiamondpole}{
2059 \anchor{center}{
2060 \pgfpointorigin
2061 }
2062 \savedanchor\northwest{%
2063 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2064 \pgf@x=-\pgf@y
2065 }
2066 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2067 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2068 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2069 \anchor{west}{ \northwest \pgf@y=0pt }
2070 \anchor{w}{ \northwest \pgf@y=0pt }
2071 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2072 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2073 \anchor{north}{ \northwest \pgf@x=0pt }
2074 \anchor{n}{ \northwest \pgf@x=0pt }
2075 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2076 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2077 \anchor{north west}{ \northwest }
2078 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2079 \anchorborder{
2080 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2081 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2082 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2083 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2084 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2085 \pgfextracty{\pgf@circ@res@up}{\northwest}
2086 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2087 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2088 \pgfpointintersectionoflines
2089 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2090 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2091 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2092 \pgf@x=\@@switchx\pgf@x
2093 \pgf@y=\@@switchy\pgf@y
2094 }
2095 \behindforegroundpath{
2096 \pgfscope
2097 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2098 \pgftransformrotate{45}
2099 \pgfpathrectanglecorners
2100 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2101 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2102 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2103 \ifx\tikz@fillcolor\pgfutil@empty
2104 \pgfsetfillcolor{white}
2105 \else
2106 \pgfsetfillcolor{\tikz@fillcolor}
2107 \fi
2108 \pgfsetfillopacity{1.0}
2109 \pgfusepath{draw,fill}
2110 \endpgfscope
2111 }
2112 }
2113
2114 %% square terminal, filled
2115
2116 \pgfdeclareshape{squarepole}{
2117 \anchor{center}{
2118 \pgfpointorigin
2119 }
2120 \savedanchor\northwest{%
2121 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2122 \pgf@x=-\pgf@y
2123 }
2124 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2125 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2126 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2127 \anchor{west}{ \northwest \pgf@y=0pt }
2128 \anchor{w}{ \northwest \pgf@y=0pt }
2129 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2130 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2131 \anchor{north}{ \northwest \pgf@x=0pt }
2132 \anchor{n}{ \northwest \pgf@x=0pt }
2133 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2134 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2135 \anchor{north west}{ \northwest }
2136 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2137 \anchorborder{
2138 \pgf@xa=\pgf@x
2139 \pgf@ya=\pgf@y
2140 \pgfextracty{\pgf@circ@res@up}{\northwest}
2141 \pgfpointborderrectangle
2142 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2143 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2144 }
2145 \behindforegroundpath{
2146 \pgfscope
2147 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2148 \pgfpathrectanglecorners
2149 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2150 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2151 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2152 \pgfsetfillopacity{1.0}
2153 \pgfusepath{draw,fill}
2154 \endpgfscope
2155 }
2156 }
2157 %% square terminal, unfilled
2158
2159 \pgfdeclareshape{osquarepole}{
2160 \anchor{center}{
2161 \pgfpointorigin
2162 }
2163 \savedanchor\northwest{%
2164 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2165 \pgf@x=-\pgf@y
2166 }
2167 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2168 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2169 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2170 \anchor{west}{ \northwest \pgf@y=0pt }
2171 \anchor{w}{ \northwest \pgf@y=0pt }
2172 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2173 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2174 \anchor{north}{ \northwest \pgf@x=0pt }
2175 \anchor{n}{ \northwest \pgf@x=0pt }
2176 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2177 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2178 \anchor{north west}{ \northwest }
2179 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2180 \anchorborder{
2181 \pgf@xa=\pgf@x
2182 \pgf@ya=\pgf@y
2183 \pgfextracty{\pgf@circ@res@up}{\northwest}
2184 \pgfpointborderrectangle
2185 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2186 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2187 }
2188 \behindforegroundpath{
2189 \pgfscope
2190 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2191 \pgfpathrectanglecorners
2192 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2193 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2194 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2195 \ifx\tikz@fillcolor\pgfutil@empty
2196 \pgfsetfillcolor{white}
2197 \else
2198 \pgfsetfillcolor{\tikz@fillcolor}
2199 \fi
2200 \pgfsetfillopacity{1.0}
2201 \pgfusepath{draw,fill}
2202 \endpgfscope
2203 }
2204 }
2205 % BNC connector
2206
2207 \pgfdeclareshape{bnc}{
2208 \anchor{center}{
2209 \pgfpointorigin
2210 }
2211 % BNC size is 2.5 times the size of the internal "ocirc"
2212 \savedanchor\northwest{%
2213 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
2214 \pgf@y=2.5\pgf@y
2215 \pgf@x=-\pgf@y
2216 }
2217 % center is on the opening
2218 \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2219 \anchor{zero}{ \pgfpointorigin }
2220 \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2221 \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2222 % geo-anchors
2223 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2224 \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2225 \anchor{west}{ \northwest \pgf@y=0pt }
2226 \anchor{left}{ \northwest \pgf@y=0pt }
2227 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2228 \anchor{north}{ \northwest \pgf@x=0pt }
2229 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2230 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2231 \anchor{north west}{ \northwest }
2232 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2233 % put the node text above and centered
2234 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2235 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2236 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2237 }
2238 }
2239 \anchorborder{
2240 \pgf@circ@res@left=\pgf@x
2241 \pgf@circ@res@up=\pgf@y
2242 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2243 }{\pgfpoint{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
2244 }
2245 \behindforegroundpath{
2246 \pgfextracty{\pgf@circ@res@other}{\northwest}
2247 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
2248 \pgfscope
2249 \pgfstartlinewidth=\pgflinewidth
2250 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
2251 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2252 % external circle
2253 \pgfscope
2254 % clipping path: first a rectangle bigger then the shape
2255 % to avoid problems with the line thickness
2256 \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
2257 {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
2258 % next the opening to the right
2259 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
2260 {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
2261 % do the difference and clip before drawing
2262 \pgfseteorule
2263 \pgfusepath{clip}
2264 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
2265 \pgfusepath{draw}
2266 \endpgfscope
2267 % internal circle
2268 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
2269 \pgf@circ@draworfill
2270 % and the contact line to the right
2271 \pgfsetlinewidth{\pgfstartlinewidth}
2272 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2273 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
2274 \pgfusepath{draw}
2275 \endpgfscope
2276 }
2277 }
2278
2279 %% Fill for correct rectangular joins
2280
2281 \pgfdeclareshape{rectjoinfill}{
2282 \savedanchor{\northeast}{%
2283 \pgf@x=.5\pgflinewidth%
2284 \pgf@y=.5\pgflinewidth%
2285 }
2286 \anchor{north}{\northeast\pgf@x=0cm\relax}
2287 \anchor{east}{\northeast\pgf@y=0cm\relax}
2288 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2289 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2290 \anchor{north east}{\northeast}
2291 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2292 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2293 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2294 \anchor{center}{
2295 \pgfpointorigin
2296 }
2297 \anchorborder{
2298 \pgf@circ@res@left=\pgf@x
2299 \pgf@circ@res@up=\pgf@y
2300 }
2301 \behindforegroundpath{
2302 \pgfscope
2303 \pgfpathrectanglecorners
2304 {\pgfpoint{0}{.5\pgflinewidth}}
2305 {\pgfpoint{0}{-.5\pgflinewidth}}
2306 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2307 \pgfusepath{draw,fill}
2308 \endpgfscope
2309 }
2310 }
2311
2312
2313 %% Current arrow
2314
2315 \pgfdeclareshape{currarrow}{
2316 \savedanchor{\northeast}{%
2317 \pgf@circ@res@step = \pgf@circ@Rlen
2318 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2319 \pgf@x=.5\pgf@circ@res@step
2320 \pgf@y=\pgf@x%
2321 }
2322 \anchor{north}{\northeast\pgf@x=0cm\relax}
2323 \anchor{east}{\northeast\pgf@y=0cm\relax}
2324 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2325 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2326 \anchor{north east}{\northeast}
2327 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2328 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2329 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2330 \anchor{center}{
2331 \pgfpointorigin
2332 }
2333 \anchor{tip}{
2334 \pgfpointorigin
2335 \pgf@circ@res@step = \pgf@circ@Rlen
2336 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2337 \pgf@x =\pgf@circ@res@step
2338 }
2339 \behindforegroundpath{
2340 \pgfscope
2341 \pgf@circ@res@step = \pgf@circ@Rlen
2342 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2343
2344 \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2345 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2346 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2347 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2348 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2349 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2350 \pgfusepath{draw,fill}
2351
2352 \endpgfscope
2353 }
2354 }
2355
2356 %% Flow arrow
2357
2358 \pgfdeclareshape{flowarrow}{
2359 \savedanchor{\northeast}{%
2360 \pgf@circ@res@step = \pgf@circ@Rlen
2361 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2362 \pgf@y=.5\pgf@circ@res@step
2363 \pgf@circ@res@step = \pgf@circ@Rlen
2364 \divide \pgf@circ@res@step by 4
2365 \pgf@x=\pgf@circ@res@step%
2366 }
2367 \anchor{north}{\northeast\pgf@x=0cm\relax}
2368 \anchor{east}{\northeast\pgf@y=0cm\relax}
2369 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2370 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2371 \anchor{north east}{\northeast}
2372 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2373 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2374 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2375 \anchor{center}{
2376 \pgfpointorigin
2377 }
2378 \anchor{tip}{
2379 \pgfpointorigin
2380 \pgf@circ@res@step = \pgf@circ@Rlen
2381 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2382 \pgf@x =\pgf@circ@res@step
2383 }
2384 \behindforegroundpath{
2385 \pgfscope
2386 \pgf@circ@res@step = \pgf@circ@Rlen
2387 \divide \pgf@circ@res@step by 4
2388 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
2389 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2390 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2391 \pgfusepath{draw}
2392 \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
2393 \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
2394 \endpgfscope
2395 }
2396 }
2397
2398 %% Input arrow
2399
2400 \pgfdeclareshape{inputarrow}{
2401 \savedanchor{\northeast}{% this is really not northeast, really -northwest
2402 \pgf@circ@res@step = \pgf@circ@Rlen
2403 \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
2404 \pgf@y=.5\pgf@circ@res@step
2405 \pgf@x=1.7\pgf@circ@res@step
2406 }
2407 \anchor{north}{\northeast\pgf@x=0cm\relax}
2408 \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
2409 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2410 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2411 \anchor{north east}{\northeast\pgf@x=0cm\relax}
2412 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2413 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
2414 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2415 \savedanchor{\tip}{
2416 \pgfpointorigin
2417 }
2418 \anchor{center}{
2419 \tip
2420 }
2421 \anchor{tip}{
2422 \tip
2423 }
2424 \behindforegroundpath{
2425
2426 \pgfscope
2427 \pgf@circ@res@step = \pgf@circ@Rlen
2428 \divide \pgf@circ@res@step by 16
2429
2430 \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2431 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2432 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
2433 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2434 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2435 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2436 \pgfusepath{fill}
2437
2438 \endpgfscope
2439 }
2440 }
2441
2442
2443 %% box
2444
2445 \pgfdeclareshape{box}{
2446 \anchor{center}{
2447 \pgfpointorigin
2448 }
2449 \behindforegroundpath{
2450
2451 \pgfscope
2452 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
2453 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2454 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2455 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2456 \pgf@circ@draworfill
2457 \endpgfscope
2458 }
2459
2460 }
2461
2462
2463 % full nodes for wire crossing
2464
2465 \pgfdeclareshape{jump crossing}
2466 {
2467 \savedanchor\northwest{%
2468 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2469 \pgf@y=.5\pgf@y
2470 \pgf@x=-\pgf@y
2471 }
2472 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2473 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2474 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2475 \anchor{west}{ \northwest \pgf@y=0pt }
2476 \anchor{w}{ \northwest \pgf@y=0pt }
2477 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2478 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2479 \anchor{north}{ \northwest \pgf@x=0pt }
2480 \anchor{n}{ \northwest \pgf@x=0pt }
2481 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2482 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2483 \anchor{north west}{ \northwest }
2484 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2485 \behindbackgroundpath{
2486 \northwest
2487 \pgf@circ@res@up = \pgf@y
2488 \pgf@circ@res@down = -\pgf@y
2489 \pgf@circ@res@right = -\pgf@x
2490 \pgf@circ@res@left = \pgf@x
2491 % horizontal jumper
2492 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2493 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
2494 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
2495 \pgfsetbeveljoin
2496 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2497 % vertical, broken path
2498 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2499 \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
2500 \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
2501 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2502 \pgfusepath{draw}
2503
2504 }
2505 }
2506 \pgfdeclareshape{plain crossing}
2507 {
2508 \savedanchor\northwest{%
2509 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2510 \pgf@y=.5\pgf@y
2511 \pgf@x=-\pgf@y
2512 }
2513 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2514 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2515 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2516 \anchor{west}{ \northwest \pgf@y=0pt }
2517 \anchor{w}{ \northwest \pgf@y=0pt }
2518 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2519 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2520 \anchor{north}{ \northwest \pgf@x=0pt }
2521 \anchor{n}{ \northwest \pgf@x=0pt }
2522 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2523 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2524 \anchor{north west}{ \northwest }
2525 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2526 \behindbackgroundpath{
2527 \northwest
2528 \pgf@circ@res@up = \pgf@y
2529 \pgf@circ@res@down = -\pgf@y
2530 \pgf@circ@res@right = -\pgf@x
2531 \pgf@circ@res@left = \pgf@x
2532 % horizontal jumper
2533 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2534 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2535 % vertical, broken path
2536 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2537 \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
2538 \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
2539 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2540 \pgfusepath{draw}
2541
2542 }
2543 }
2544
2545 %%%---------- close: tex/pgfcircshapes
2546 %%%%%%%%%%% Springe nach tex/pgfcircmonopoles
2547 %%%---------- open: tex/pgfcircmonopoles.tex
2548 % Copyright 2007-2009 by Massimo Redaelli
2549 %
2550 % This file may be distributed and/or modified
2551 %
2552 % 1. under the LaTeX Project Public License and/or
2553 % 2. under the GNU Public License.
2554 %
2555 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2556
2557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2558 %% Monopoles
2559
2560 %% Ground symbol
2561 % #1 -> name
2562 % #2 -> width
2563 % #3 -> depth
2564 % #4 -> code
2565 \long\def\pgf@circ@declareground#1#2#3#4{
2566 \pgfdeclareshape{#1}{
2567 \savedanchor{\southeast}{
2568 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2569 \pgf@x=#2\pgf@x
2570 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2571 \pgf@y=-#3\pgf@y
2572 }
2573 \anchor{north}{\pgfpointorigin}
2574 \anchor{north east}{\southeast\pgf@y=0pt\relax}
2575 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
2576 \anchor{south east}{\southeast}
2577 \anchor{south}{\southeast\pgf@x=0pt\relax}
2578 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2579 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
2580 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
2581 \anchor{left}{\pgfpointorigin}
2582 \anchor{right}{\pgfpointorigin}
2583 \anchor{center}{\pgfpointorigin}
2584 \behindforegroundpath{
2585 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
2586 \pgfscope
2587 \pgfstartlinewidth=\pgflinewidth
2588 #4
2589 \endpgfscope
2590 }
2591 }
2592 }
2593
2594
2595 \pgf@circ@declareground{ground}{0.6}{1.6}{
2596 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2597 \pgfpathmoveto{\pgfpointorigin}
2598 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2599 \pgfusepath{draw}
2600 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2601 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2602 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2603 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2604 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2605 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2606 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2607 \pgfusepath{draw}
2608 }
2609
2610 \pgf@circ@declareground{tlground}{0.6}{0.4}{
2611 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2612 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2613 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2614 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2615 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2616 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2617 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2618 \pgfusepath{draw}
2619 }
2620
2621
2622 \pgf@circ@declareground{rground}{0.6}{1}{
2623 \pgfpathmoveto{\pgfpointorigin}
2624 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2625 \pgfusepath{draw}
2626
2627 \pgfstartlinewidth=\pgflinewidth
2628 \pgfsetlinewidth{\ctikzvalof{monopoles/rground/thickness}\pgfstartlinewidth}
2629
2630 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2631 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2632 \pgfsetroundcap\pgfusepath{draw}
2633 }
2634
2635 \pgf@circ@declareground{tground}{0.6}{0}{
2636 \pgfpathmoveto{\pgfpointorigin}
2637 \pgfusepath{draw}
2638
2639 \pgfstartlinewidth=\pgflinewidth
2640 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2641
2642 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2643 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2644 \pgfusepath{draw}
2645 }
2646
2647 \pgf@circ@declareground{sground}{0.6}{1.8}{
2648 \pgfpathmoveto{\pgfpointorigin}
2649 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2650 \pgfusepath{draw}
2651
2652 \pgfstartlinewidth=\pgflinewidth
2653 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2654
2655 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2656 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2657 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
2658 \pgfpathclose
2659 \pgf@circ@draworfill
2660 }
2661
2662 % noiseless ground
2663 \pgf@circ@declareground{nground}{0.9}{1.6}{
2664 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2665 \pgfpathmoveto{\pgfpointorigin}
2666 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2667 \pgfusepath{draw}
2668 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2669 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2670 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2671 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2672 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2673 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2674 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2675 \pgfusepath{draw}
2676 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2677 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
2678 \pgfusepath{draw}
2679 }
2680
2681 % protective ground
2682 \pgf@circ@declareground{pground}{0.9}{1.8}{
2683 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2684 \pgfpathmoveto{\pgfpointorigin}
2685 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
2686 \pgfusepath{draw}
2687 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2688 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2689 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2690 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2691 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2692 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2693 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2694 \pgfusepath{draw}
2695 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
2696 \pgfusepath{draw}
2697 }
2698
2699 % chassis ground
2700 \pgf@circ@declareground{cground}{1}{2}{
2701 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2702 \pgfpathmoveto{\pgfpointorigin}
2703 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
2704 \pgfusepath{draw}
2705 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
2706 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2707 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2708 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2709 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2710 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2711 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2712 \pgfusepath{draw}
2713 }
2714
2715 % Contributed by @fotesan https://github.com/fotesan
2716
2717 \pgf@circ@declareground{eground}{1.1}{1.7}{
2718 \pgfpathmoveto{\pgfpointorigin}
2719 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2720 \pgfusepath{draw}
2721
2722 \pgfstartlinewidth=\pgflinewidth
2723 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2724
2725 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2726 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2727 \pgfusepath{draw}
2728
2729 \pgfsetlinewidth{\pgfstartlinewidth}
2730 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2731 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2732 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2733 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2734 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2735 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2736 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2737 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2738 \pgfusepath{draw}
2739 }
2740
2741 \pgf@circ@declareground{eground2}{1.1}{1.7}{
2742 \pgfpathmoveto{\pgfpointorigin}
2743 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2744 \pgfusepath{draw}
2745
2746 \pgfstartlinewidth=\pgflinewidth
2747 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
2748
2749 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2750 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2751 \pgfusepath{draw}
2752
2753 \pgfsetlinewidth{\pgfstartlinewidth}
2754 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2755 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2756 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2757 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2758 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2759 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2760 \pgfusepath{draw}
2761 }
2762
2763 % Contributed by Leonardo Azzinnari
2764 \pgfdeclareshape{tlinestub}{
2765 \savedanchor{\northeast}{%
2766 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2767 \pgf@x=1.625\pgf@circ@res@step
2768 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2769 \pgf@y=.25\pgf@circ@res@step%
2770 }
2771 % the center is on the left side of the shape for facility of usage
2772 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
2773 \anchor{east}{\northeast\pgf@y=0cm\relax}
2774 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
2775 \anchor{west}{\pgfpointorigin}
2776 \anchor{north east}{\northeast}
2777 \anchor{north west}{\northeast\pgf@x=0cm\relax}
2778 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2779 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
2780 \anchor{center}{\pgfpointorigin}
2781 \behindforegroundpath{
2782 \pgfstartlinewidth=\pgflinewidth
2783
2784 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
2785
2786 \pgfscope\begin{pgftransparencygroup}
2787 \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}}
2788 \pgf@circ@maybefill
2789 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2790 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
2791 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
2792 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
2793 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2794 \pgf@circ@draworfill
2795 \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}}
2796 \pgfusepath{draw}
2797 \end{pgftransparencygroup} \endpgfscope
2798 \pgfpathmoveto{\pgfpointorigin}
2799 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
2800 \pgfusepath{draw}
2801 }
2802 }
2803
2804 %% New antennas without tails
2805
2806 % main body
2807 \def\pgf@circ@antennabody{%
2808 \pgfstartlinewidth=\pgflinewidth
2809 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2810 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2811 \pgfscope
2812 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
2813 \pgfpathmoveto{\pgfpointorigin}
2814 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
2815 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
2816 \pgfsetbeveljoin
2817 \pgfpathclose
2818 \pgf@circ@draworfill
2819 \endpgfscope
2820 \pgfsetlinewidth{\pgfstartlinewidth}
2821 \pgfpathmoveto{\pgfpointorigin}
2822 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
2823 \pgfusepath{draw}
2824 }
2825
2826 % Waves for the antennas.
2827 \def\pgf@circ@antennawaves{%
2828 \pgfscope
2829 % define a triangle for clipping the waves
2830 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
2831 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
2832 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2833 \pgfpathclose
2834 \pgfusepath{clip}
2835 % ...and build the waves as clipped circles
2836 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
2837 \pgfmathloop%
2838 \ifnum\pgf@circ@count@a>2
2839 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
2840 \advance\pgf@circ@count@a-1\relax%
2841 \repeatpgfmathloop
2842 \pgfusepath{draw}
2843 \endpgfscope
2844 }
2845
2846
2847 % additional shape with the waves
2848 \pgfdeclareshape{waves}{
2849 \anchor{center}{\pgfpointorigin}
2850 \savedanchor{\northeast}{
2851 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
2852 \pgf@x=\pgf@circ@res@step
2853 \pgf@y=\pgf@circ@res@step
2854 }
2855 \anchor{text}{
2856 \northeast
2857 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2858 }
2859 \anchor{top}{\northeast\pgf@x=0pt}
2860 \anchor{right}{\northeast\pgf@y=0pt}
2861 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
2862 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
2863 \anchor{north}{\northeast\pgf@x=0pt}
2864 \anchor{north east}{\northeast}
2865 \anchor{east}{\northeast\pgf@y=0pt}
2866 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2867 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
2868 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2869 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
2870 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2871 \behindforegroundpath{
2872 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
2873 \pgf@circ@res@step=0.5\pgf@circ@res@step
2874 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
2875 \pgfscope
2876 % define a triangle for clipping the waves
2877 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
2878 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
2879 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
2880 \pgfpathclose
2881 \pgfusepath{clip}
2882 % ...and build the waves as clipped circles
2883 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
2884 \pgfmathloop%
2885 \ifnum\c@pgf@counta>1
2886 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
2887 \advance\c@pgf@counta-1\relax%
2888 \repeatpgfmathloop
2889 \pgfusepath{draw}
2890 \endpgfscope
2891 }
2892 }
2893
2894 % the three types of antennas: simple, TX, RX. Notice that you can flip them...
2895
2896 \pgfdeclareshape{bareantenna}{
2897 \anchor{center}{\pgfpointorigin}
2898 \savedanchor{\northeast}{
2899 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2900 \pgf@x=\pgf@circ@res@step
2901 \pgf@y=2\pgf@circ@res@step
2902 }
2903 \anchor{text}{
2904 \northeast
2905 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2906 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2907 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2908 }
2909 \anchor{top}{\northeast\pgf@x=0pt}
2910 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2911 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2912 \anchor{bottom}{\pgfpointorigin}
2913 \anchor{north}{\northeast\pgf@x=0pt}
2914 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2915 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2916 \anchor{south}{\pgfpointorigin}
2917 \anchor{north east}{\northeast}
2918 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2919 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2920 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2921 \behindforegroundpath{
2922 \pgf@circ@antennabody
2923 }
2924 }
2925
2926 \pgfdeclareshape{bareTXantenna}{
2927 \anchor{center}{\pgfpointorigin}
2928 \savedanchor{\northeast}{
2929 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2930 \pgf@x=\pgf@circ@res@step
2931 \pgf@y=2\pgf@circ@res@step
2932 }
2933 \anchor{text}{
2934 \northeast
2935 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2936 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2937 \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
2938 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2939 }
2940 \anchor{waves}{
2941 \northeast
2942 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2943 \pgf@x=4.2\pgf@circ@res@step
2944 \pgf@y=\pgf@circ@res@step
2945 }
2946 \anchor{top}{\northeast\pgf@x=0pt}
2947 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2948 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2949 \anchor{bottom}{\pgfpointorigin}
2950 \anchor{north}{\northeast\pgf@x=0pt}
2951 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2952 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2953 \anchor{south}{\pgfpointorigin}
2954 \anchor{north east}{\northeast}
2955 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2956 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2957 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2958 \behindforegroundpath{
2959 \pgf@circ@antennabody
2960 \pgf@circ@antennawaves
2961 }
2962 }
2963
2964 \pgfdeclareshape{bareRXantenna}{
2965 \anchor{center}{\pgfpointorigin}
2966 \savedanchor{\northeast}{
2967 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2968 \pgf@x=\pgf@circ@res@step
2969 \pgf@y=2\pgf@circ@res@step
2970 }
2971 \anchor{text}{
2972 \northeast
2973 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
2974 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
2975 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
2976 }
2977 \anchor{waves}{
2978 \northeast
2979 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
2980 \pgf@x=-4.2\pgf@circ@res@step
2981 \pgf@y=\pgf@circ@res@step
2982 }
2983 \anchor{top}{\northeast\pgf@x=0pt}
2984 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
2985 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2986 \anchor{bottom}{\pgfpointorigin}
2987 \anchor{north}{\northeast\pgf@x=0pt}
2988 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
2989 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
2990 \anchor{south}{\pgfpointorigin}
2991 \anchor{north east}{\northeast}
2992 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2993 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2994 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2995 \behindforegroundpath{
2996 \pgf@circ@antennabody
2997 \pgftransformxshift{-5.2\pgf@circ@res@step}
2998 \pgf@circ@antennawaves
2999 }
3000 }
3001
3002 % Microstrip monopoles
3003
3004 \pgfdeclareshape{mslstub}{
3005 \savedanchor{\southeast}{
3006 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
3007 \pgf@x=.5\pgf@x
3008 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
3009 \pgf@y=-.5\pgf@y
3010 }
3011 \savedanchor{\northwest}{
3012 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
3013 \pgf@x=-.5\pgf@x
3014 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
3015 \pgf@y=.5\pgf@y
3016 }
3017 \anchor{north}{\northwest\pgf@x=0pt\relax}
3018 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3019 \anchor{east}{\southeast\pgf@y=0pt\relax}
3020 \anchor{south east}{\southeast}
3021 \anchor{south}{\southeast\pgf@x=0pt\relax}
3022 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3023 \anchor{west}{\northwest\pgf@y=0pt\relax}
3024 \anchor{north west}{\northwest}
3025 %
3026 \anchor{center}{\northwest\pgf@y=0pt\relax}
3027 \anchor{left}{\northwest\pgf@y=0pt\relax}
3028 \anchor{right}{\southeast\pgf@y=0pt\relax}
3029 % put the node text above and centered
3030 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3031 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3032 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3033 }
3034 }
3035 \behindbackgroundpath{
3036 \pgfextracty{\pgf@circ@res@up}{\northwest}
3037 \pgfextractx{\pgf@circ@res@right}{\southeast}
3038 \pgfextractx{\pgf@circ@res@left}{\northwest}
3039 \pgfextracty{\pgf@circ@res@down}{\southeast}
3040 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3041 \pgfstartlinewidth=\pgflinewidth
3042 \pgfscope
3043 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
3044 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3045 \pgf@circ@draworfill
3046 \endpgfscope
3047 }
3048 }
3049
3050 \pgfdeclareshape{msrstub}{
3051 \savedanchor{\southeast}{
3052 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
3053 \pgf@x=.5\pgf@x
3054 \pgf@y=0pt\relax
3055 }
3056 \savedanchor{\northwest}{
3057 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
3058 \pgf@x=-.5\pgf@x
3059 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@Rlen
3060 \pgf@y=.5\pgf@y
3061 }
3062 \anchor{north}{\northwest\pgf@x=0pt\relax}
3063 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3064 \anchor{east}{\southeast\pgf@y=0pt\relax}
3065 \anchor{south east}{\southeast}
3066 \anchor{south}{\southeast\pgf@x=0pt\relax}
3067 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3068 \anchor{west}{\northwest\pgf@y=0pt\relax}
3069 \anchor{north west}{\northwest}
3070 %
3071 \anchor{center}{\pgfpointorigin}
3072 \anchor{left}{\pgfpointorigin}
3073 \anchor{right}{\pgfpointorigin}
3074 % put the node text above and centered
3075 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3076 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3077 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3078 }
3079 }
3080 \behindbackgroundpath{
3081 \pgfextracty{\pgf@circ@res@up}{\northwest}
3082 \pgfextractx{\pgf@circ@res@right}{\southeast}
3083 \pgfextractx{\pgf@circ@res@left}{\northwest}
3084 \pgfextracty{\pgf@circ@res@down}{\southeast}
3085 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3086 \pgfstartlinewidth=\pgflinewidth
3087 \pgfscope
3088 \pgfpathmoveto{\pgfpointorigin}
3089 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3090 \pgfusepath{draw}
3091 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
3092 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
3093 \pgfpatharc{135}{45}{\pgf@circ@res@step}
3094 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
3095 \pgfpatharc{45}{135}{\pgf@circ@res@up}
3096 \pgfclosepath
3097 % \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3098 \pgf@circ@draworfill
3099 \endpgfscope
3100 }
3101 }
3102
3103 \pgfdeclareshape{msport}{
3104 \savedanchor{\southeast}{
3105 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
3106 \pgf@x=.5\pgf@x
3107 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
3108 \pgf@y=-.5\pgf@y
3109 }
3110 \savedanchor{\northwest}{
3111 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
3112 \pgf@x=-.5\pgf@x
3113 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
3114 \pgf@y=.5\pgf@y
3115 }
3116 \anchor{north}{\northwest\pgf@x=0pt\relax}
3117 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3118 \anchor{east}{\southeast\pgf@y=0pt\relax}
3119 \anchor{south east}{\southeast}
3120 \anchor{south}{\southeast\pgf@x=0pt\relax}
3121 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3122 \anchor{west}{\northwest\pgf@y=0pt\relax}
3123 \anchor{north west}{\northwest}
3124 %
3125 \anchor{center}{\northwest\pgf@y=0pt\relax}
3126 \anchor{left}{\northwest\pgf@y=0pt\relax}
3127 \anchor{right}{\southeast\pgf@y=0pt\relax}
3128 % put the node text above and centered
3129 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3130 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3131 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3132 }
3133 }
3134 \behindbackgroundpath{
3135 \pgfextracty{\pgf@circ@res@up}{\northwest}
3136 \pgfextractx{\pgf@circ@res@right}{\southeast}
3137 \pgfextractx{\pgf@circ@res@left}{\northwest}
3138 \pgfextracty{\pgf@circ@res@down}{\southeast}
3139 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
3140 \pgfstartlinewidth=\pgflinewidth
3141 \pgfscope
3142 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
3143 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3144 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
3145 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3146 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3147 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
3148 \pgfpathclose
3149 \pgf@circ@draworfill
3150 \endpgfscope
3151 }
3152 }
3153 % Legacy antennas (with tails)
3154
3155 \def\pgf@circ@shift@antenna@xy#1#2{%
3156 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
3157 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
3158 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
3159 \relax}
3160
3161 \pgfdeclareshape{antenna}{
3162 \anchor{center}{\pgfpointorigin}
3163 \savedanchor{\northeast}{
3164 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
3165 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3166 \pgf@y=4\pgf@circ@res@step
3167 }
3168 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
3169 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
3170 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
3171 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
3172 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{0}{2}}
3173 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3174 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
3175 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
3176 \anchor{text}{
3177 \northeast
3178 \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
3179 \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
3180 }
3181 \behindforegroundpath{
3182 \pgfstartlinewidth=\pgflinewidth
3183 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
3184
3185 \pgftransformxshift{ -4\pgf@circ@res@step }
3186
3187 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3188 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3189
3190 \pgfusepath{draw}
3191
3192 \pgfscope
3193 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3194 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3195 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3196 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3197 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3198 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3199 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3200 \pgfusepath{draw}
3201 \endpgfscope
3202 \pgfsetlinewidth{\pgfstartlinewidth}
3203
3204 }
3205 }
3206
3207
3208 \pgfdeclareshape{txantenna}{
3209 \anchor{center}{\pgfpointorigin}
3210 \savedanchor{\northeast}{
3211 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
3212 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3213 \pgf@y=4\pgf@circ@res@step
3214 }
3215 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3216 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3217 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3218 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3219 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
3220 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3221 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3222 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
3223 \anchor{text}{
3224 \northeast
3225 \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
3226 \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
3227 }
3228 \behindforegroundpath{
3229 \pgfstartlinewidth=\pgflinewidth
3230 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
3231
3232 \pgfpathmoveto{\pgfpointorigin}
3233 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3234 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3235 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3236
3237 \pgfusepath{draw}
3238
3239 \pgfscope
3240 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3241 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3242 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3243 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3244 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3245 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3246 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3247 \pgfusepath{draw}
3248 \endpgfscope
3249 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
3250 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3251 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3252 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
3253 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3254 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
3255 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3256 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
3257 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
3258 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
3259 \pgfusepath{draw}
3260 \pgfsetlinewidth{\pgfstartlinewidth}
3261
3262 }
3263 }
3264
3265
3266 \pgfdeclareshape{rxantenna}{
3267 \anchor{center}{\pgfpointorigin}
3268 \savedanchor{\northeast}{
3269 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
3270 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3271 \pgf@y=4\pgf@circ@res@step
3272 }
3273 \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3274 \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3275 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3276 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3277 \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
3278 \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3279 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3280 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
3281 \anchor{text}{
3282 \northeast
3283 \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
3284 \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
3285 }
3286 \behindforegroundpath{
3287 \pgfstartlinewidth=\pgflinewidth
3288 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
3289
3290 \pgfpathmoveto{\pgfpointorigin}
3291 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3292 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3293 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3294
3295 \pgfusepath{draw}
3296
3297 \pgfscope
3298 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3299 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3300 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3301 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3302 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3303 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3304 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3305 \pgfusepath{draw}
3306 \endpgfscope
3307
3308 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
3309 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3310 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3311 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
3312 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3313 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
3314 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3315 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
3316 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
3317 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
3318 \pgfusepath{draw}
3319 \pgfsetlinewidth{\pgfstartlinewidth}
3320
3321 }
3322 }
3323
3324 % Vcc
3325 \pgfdeclareshape{vcc}{
3326 \savedanchor{\northeast}{%
3327 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3328 \pgf@x=.5\pgf@circ@res@step
3329 \pgf@y=3\pgf@x%
3330 }
3331 \anchor{north}{\northeast\pgf@x=0cm\relax}
3332 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3333 \anchor{south}{\pgfpointorigin}
3334 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3335 \anchor{north east}{\northeast}
3336 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3337 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3338 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3339 \anchor{center}{\pgfpointorigin}
3340 \anchor{text}{
3341 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3342 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3343 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3344 \pgf@x=0pt
3345 \pgf@y=2\pgf@circ@res@step
3346 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
3347 \pgf@x=-.5\wd\pgfnodeparttextbox
3348 }
3349 \behindforegroundpath{
3350 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3351 \pgfscope
3352 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
3353 \ifx\pgf@temp\pgf@circ@temp
3354 \pgfstartlinewidth=\pgflinewidth
3355 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3356
3357 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3358 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
3359 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3360 \pgfusepath{draw}
3361
3362 \pgfsetlinewidth{\pgfstartlinewidth}
3363 \else
3364 \pgfsetarrowsend{\pgf@circ@temp}
3365 \fi
3366 \pgfpathmoveto{\pgfpointorigin}
3367 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
3368 \pgfusepath{draw}
3369 \endpgfscope
3370 }
3371 }
3372
3373 % Vee
3374 \pgfdeclareshape{vee}{
3375 \savedanchor{\northeast}{%
3376 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3377 \pgf@x=.5\pgf@circ@res@step
3378 \pgf@y=-3\pgf@x%
3379 }
3380 \anchor{south}{\northeast\pgf@x=0cm\relax}
3381 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3382 \anchor{north}{\pgfpointorigin}
3383 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3384 \anchor{south east}{\northeast}
3385 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
3386 \anchor{north east}{\northeast\pgf@y=0pt\relax}
3387 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3388 \anchor{center}{\pgfpointorigin}
3389 \anchor{text}{
3390 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3391 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3392 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3393 \pgf@x=0pt
3394 \pgf@y=-2\pgf@circ@res@step
3395 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
3396 \pgf@x=-.5\wd\pgfnodeparttextbox
3397 }
3398
3399 \behindforegroundpath{
3400 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
3401 \pgfscope
3402 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
3403 \ifx\pgf@temp\pgf@circ@temp
3404
3405 \pgfstartlinewidth=\pgflinewidth
3406 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3407
3408 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3409 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
3410 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3411 \pgfusepath{draw}
3412 \pgfsetlinewidth{\pgfstartlinewidth}
3413 \else
3414 \pgfsetarrowsend{\pgf@circ@temp}
3415 \fi
3416 \pgfpathmoveto{\pgfpointorigin}
3417 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3418 \pgfusepath{draw}
3419 \endpgfscope
3420 }
3421 }
3422
3423 % match
3424 \pgfdeclareshape{match}{
3425 \savedanchor{\northeast}{%
3426 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
3427 \pgf@x=2\pgf@circ@res@step
3428 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
3429 \pgf@y=.5\pgf@circ@res@step%
3430 }
3431 % the center is on the left side of the shape for facility of usage
3432 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3433 \anchor{east}{\northeast\pgf@y=0cm\relax}
3434 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
3435 \anchor{west}{\pgfpointorigin}
3436 \anchor{north east}{\northeast}
3437 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3438 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3439 \anchor{south west}{\pgfpointorigin}
3440 \anchor{center}{
3441 \pgfpointorigin
3442 }
3443 \anchor{text}{
3444 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
3445 \pgf@x=1.5\pgf@x
3446 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
3447 \pgf@y=-1.5\ht\pgfnodeparttextbox
3448 }
3449 \behindforegroundpath{
3450 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
3451
3452 \pgfscope
3453 \pgfpathmoveto{\pgfpointorigin}
3454 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
3455 \pgfusepath{draw}
3456
3457 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
3458 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
3459 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
3460 \pgfusepath{fill}
3461
3462 \pgfsetlinewidth{\pgfstartlinewidth}
3463
3464 \endpgfscope
3465 }
3466 }
3467
3468 %%%---------- close: tex/pgfcircmonopoles
3469 %%%%%%%%%%% Springe nach tex/pgfcircbipoles
3470 %%%---------- open: tex/pgfcircbipoles.tex
3471 % Copyright 2007-2009 by Massimo Redaelli
3472 %
3473 % This file may be distributed and/or modified
3474 %
3475 % 1. under the LaTeX Project Public License and/or
3476 % 2. under the GNU Public License.
3477 %
3478 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
3479
3480 %% Generic macro for defining a bipole shape
3481 % #1 - additional anchors
3482 % #2 - lower y-size of the bipole (from the center).
3483 % #3 - #shape is the name of the shape
3484 % #4 - upper y-size of the bipole (from the center)
3485 % #5 - width of the bipole
3486 % #6 - macros drawing the bipole
3487
3488
3489 \long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
3490 \pgfdeclareshape{#3shape}{
3491
3492 \savedanchor{\northeast}{
3493 \pgf@y=#4\pgf@circ@Rlen
3494 \pgf@y=.5\pgf@y
3495 \pgf@x=#5\pgf@circ@Rlen
3496 \pgf@x=.5\pgf@x
3497 }
3498 \savedanchor{\northeastborder}{
3499 \pgf@y=#4\pgf@circ@Rlen
3500 \pgf@y=.5\pgf@y
3501 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3502 \pgf@x=#5\pgf@circ@Rlen
3503 \pgf@x=.5\pgf@x
3504 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3505 }
3506 \savedanchor{\southwestborder}{
3507 \pgf@y=-#2\pgf@circ@Rlen
3508 \pgf@y=.5\pgf@y
3509 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3510 \pgf@x=-#5\pgf@circ@Rlen
3511 \pgf@x=.5\pgf@x
3512 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3513 }
3514 \savedanchor{\southwest}{
3515 \pgf@y=-#2\pgf@circ@Rlen
3516 \pgf@y=.5\pgf@y
3517 \pgf@x=-#5\pgf@circ@Rlen
3518 \pgf@x=.5\pgf@x
3519 }
3520 \savedanchor{\centerpoint}{
3521 \pgf@circ@res@down=-#2\pgf@circ@Rlen
3522 \pgf@circ@res@up=#4\pgf@circ@Rlen
3523 \pgfpointorigin
3524 \pgf@y=\pgf@circ@res@up
3525 \advance\pgf@y by\pgf@circ@res@down
3526 \pgf@y=.5\pgf@y
3527 }
3528 \anchor{center}{\pgfpointorigin}
3529 \anchor{n}{
3530 \northeast
3531 \pgf@x=0cm
3532 }
3533 \anchor{north east}{
3534 \northeast
3535 }
3536 \anchor{north west}{
3537 \northeast
3538 \pgf@x=-\pgf@x
3539 }
3540 \anchor{ne}{
3541 \northeast
3542 }
3543 \anchor{nw}{
3544 \northeast
3545 \pgf@x=-\pgf@x
3546 }
3547 \anchor{e}{
3548 \northeast
3549 \pgf@y=0cm
3550 }
3551 \anchor{s}{
3552 \southwest
3553 \pgf@x=0cm
3554 }
3555 \anchor{south east}{
3556 \southwest
3557 \pgf@x=-\pgf@x
3558 }
3559 \anchor{south west}{
3560 \southwest
3561 }
3562 \anchor{se}{
3563 \southwest
3564 \pgf@x=-\pgf@x
3565 }
3566 \anchor{sw}{
3567 \southwest
3568 }
3569 \anchor{w}{
3570 \southwest
3571 \pgf@y=0cm
3572 }
3573 \anchor{north}{
3574 \northeast
3575 \pgf@x=0cm
3576 }
3577 \anchor{east}{
3578 \northeast
3579 \pgf@y=0cm
3580 }
3581 \anchor{south}{
3582 \southwest
3583 \pgf@x=0cm
3584 }
3585 \anchor{west}{
3586 \southwest
3587 \pgf@y=0cm
3588 }
3589 \anchor{right}{
3590 \northeast
3591 \pgf@y=0cm
3592 }
3593 \anchor{above}{
3594 \northeast
3595 \pgf@x=0cm
3596 }
3597 \anchor{left}{
3598 \southwest
3599 \pgf@y=0cm
3600 }
3601 \anchor{below}{
3602 \southwest
3603 \pgf@x=0cm
3604 }
3605 \anchor{a}{
3606 \northeast
3607 \pgf@y=0cm
3608 }
3609 \anchor{b}{
3610 \southwest
3611 \pgf@y=0cm
3612 }
3613 \savedanchor{\textanchor}{%
3614 \pgf@y=\ht\pgfnodeparttextbox
3615 \pgf@x=-.5\wd\pgfnodeparttextbox
3616 }
3617 \anchor{text}{
3618 \textanchor
3619 }
3620 \anchorborder{%
3621 \ifpgf@circuit@bipole@inverted
3622 \pgf@circ@res@left=-\pgf@x
3623 \pgf@circ@res@right=-\pgf@y
3624 \else
3625 \pgf@circ@res@left=\pgf@x
3626 \pgf@circ@res@right=\pgf@y
3627 \fi
3628 \ifdim\pgf@circ@res@right>0cm
3629 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
3630 \else
3631 \southwestborder
3632 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
3633 \fi
3634 }
3635
3636 #1
3637
3638 \backgroundpath{
3639 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
3640
3641 \northeast
3642 \pgf@circ@res@up = \pgf@y
3643 \pgf@circ@res@zero = 0cm
3644 \pgf@circ@res@left = -\pgf@x
3645 \pgf@circ@res@right = \pgf@x
3646 \southwest
3647 \pgf@circ@res@down = \pgf@y
3648
3649 \pgfstartlinewidth=\pgflinewidth
3650 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
3651 #6
3652
3653 \pgfsetlinewidth{\pgfstartlinewidth}
3654 }
3655 }
3656 }
3657
3658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3659 %% Standard bipole shapes declarations
3660
3661 %% Resistor
3662 \pgfcircdeclarebipole
3663 {}
3664 {\ctikzvalof{bipoles/resistor/height}}
3665 {resistor}
3666 {\ctikzvalof{bipoles/resistor/height}}
3667 {\ctikzvalof{bipoles/resistor/width}}
3668 {
3669 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3670 \pgftransformationadjustments
3671 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
3672 \divide \pgf@circ@res@step by 12
3673
3674 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
3675 \pgf@circ@res@other = \pgf@circ@res@left
3676 \advance\pgf@circ@res@other by \pgf@circ@res@step
3677 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3678 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3679 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3680 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3681 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3682 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3683 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3684 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3685 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
3686 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3687 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
3688 \advance\pgf@circ@res@other by \pgf@circ@res@step
3689 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
3690 \pgfsetbeveljoin
3691 \pgfusepath{draw}
3692 }
3693
3694
3695
3696 %% Variable resistor
3697 \pgfcircdeclarebipole
3698 {}
3699 {\ctikzvalof{bipoles/vresistor/height}}
3700 {vresistor}
3701 {\ctikzvalof{bipoles/vresistor/height}}
3702 {\ctikzvalof{bipoles/vresistor/width}}
3703 {
3704 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3705 \pgftransformationadjustments
3706 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
3707 \divide \pgf@circ@res@step by 12
3708
3709 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
3710
3711 \pgf@circ@res@other = \pgf@circ@res@left
3712 \advance\pgf@circ@res@other by \pgf@circ@res@step
3713 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3714 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3715 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3716 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3717 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3718 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3719 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3720 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3721 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
3722 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
3723 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
3724 \advance\pgf@circ@res@other by \pgf@circ@res@step
3725 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
3726 \pgfsetbeveljoin
3727 \pgfusepath{draw}
3728
3729 \pgfscope
3730 \pgfsetarrowsend{latexslim}
3731 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
3732 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
3733 \pgfusepath{draw}
3734 \endpgfscope
3735 }
3736
3737
3738
3739 %% Capacitor
3740
3741 \pgfcircdeclarebipole
3742 {}
3743 {\ctikzvalof{bipoles/capacitor/height}}
3744 {capacitor}
3745 {\ctikzvalof{bipoles/capacitor/height}}
3746 {\ctikzvalof{bipoles/capacitor/width}}
3747 {
3748 \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
3749 \divide \pgf@circ@res@step by 5
3750
3751 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3752 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3753 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3754
3755 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3756 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3757 \pgfusepath{draw}
3758
3759 }
3760
3761 %% Capacitive sensor
3762 \pgfcircdeclarebipole
3763 {\anchor{label}{%
3764 \southwest
3765 \pgf@x=2.6\pgf@x
3766 \pgf@y=1.4\pgf@y
3767 }%
3768 }
3769 {\ctikzvalof{bipoles/capacitor/height}}
3770 {capacitivesens}
3771 {\ctikzvalof{bipoles/capacitor/height}}
3772 {\ctikzvalof{bipoles/capacitor/width}}
3773 {
3774 \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
3775 \divide \pgf@circ@res@step by 5
3776
3777 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3778 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3779 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3780
3781 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3782 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3783 \pgfusepath{draw}
3784 \pgfscope
3785 \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
3786 \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
3787 \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
3788 \pgfusepath{draw}
3789 \endpgfscope
3790 }
3791
3792 %% Polar Capacitor
3793
3794 \pgfcircdeclarebipole
3795 {}
3796 {\ctikzvalof{bipoles/pcapacitor/height}}
3797 {polarcapacitor}
3798 {\ctikzvalof{bipoles/pcapacitor/height}}
3799 {\ctikzvalof{bipoles/pcapacitor/width}}
3800 {
3801 \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
3802 \divide \pgf@circ@res@step by 5
3803
3804 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3805
3806 \pgfscope
3807 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
3808 \pgftransformrotate{-90}
3809 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
3810 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
3811 \pgfusepath{draw}
3812 \endpgfscope
3813
3814 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3815 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3816 \pgfusepath{draw}
3817
3818 }
3819
3820 %% Electrolytic Capacitor
3821
3822 \pgfcircdeclarebipole
3823 {}
3824 {\ctikzvalof{bipoles/ecapacitor/height}}
3825 {ecapacitor}
3826 {\ctikzvalof{bipoles/ecapacitor/height}}
3827 {\ctikzvalof{bipoles/ecapacitor/width}}
3828 {
3829 \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen
3830 \divide \pgf@circ@res@step by 5
3831 \pgfsetrectcap
3832 % % % Draw plus pole
3833 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3834 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3835 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
3836 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
3837 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3838 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3839 \pgf@circ@draworfill
3840 % % Draw minus pole
3841 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3842 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
3843 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
3844 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3845 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3846 \pgfsetfillcolor{black}
3847 \pgfusepath{draw,fill}
3848 \pgfsetfillcolor{black}
3849 % % plus pole annotation
3850 \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
3851 {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
3852 }
3853
3854 %% Battery
3855
3856 \pgfcircdeclarebipole
3857 {}
3858 {\ctikzvalof{bipoles/battery/height}}
3859 {battery}
3860 {\ctikzvalof{bipoles/battery/height}}
3861 {\ctikzvalof{bipoles/battery/width}}
3862 {
3863 \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
3864 \divide \pgf@circ@res@step by 6
3865
3866 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3867
3868 \ifpgf@circ@fixbatteries
3869 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3870 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3871
3872 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
3873 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
3874
3875 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
3876 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
3877
3878 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3879 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3880 \else
3881 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
3882 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
3883
3884 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
3885 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
3886
3887 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
3888 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
3889
3890 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3891 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3892 \fi
3893 \pgfusepath{draw}
3894 }
3895
3896
3897 %% Battery 1 % poles with equl thickness
3898
3899 \pgfcircdeclarebipole
3900 {}
3901 {\ctikzvalof{bipoles/battery1/height}}
3902 {battery1}
3903 {\ctikzvalof{bipoles/battery1/height}}
3904 {\ctikzvalof{bipoles/battery1/width}}
3905 {
3906 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
3907 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
3908 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
3909 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
3910 \pgfusepath{draw}
3911
3912 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3913 \ifpgf@circ@fixbatteries
3914 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
3915 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
3916
3917 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3918 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3919 \else
3920 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3921 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3922
3923 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
3924 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
3925 \fi
3926 \pgfusepath{draw}
3927 }
3928
3929 %% Battery 2 % negative pole thicker
3930
3931 \pgfcircdeclarebipole
3932 {}
3933 {\ctikzvalof{bipoles/battery2/height}}
3934 {battery2}
3935 {\ctikzvalof{bipoles/battery2/height}}
3936 {\ctikzvalof{bipoles/battery2/width}}
3937 {
3938 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
3939 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
3940 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
3941 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
3942 \pgfusepath{draw}
3943
3944 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3945 \ifpgf@circ@fixbatteries
3946 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
3947 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
3948 \pgfusepath{draw}
3949 \pgfsetlinewidth{3\pgflinewidth}
3950 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
3951 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
3952 \else
3953 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
3954 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
3955 \pgfusepath{draw}
3956 \pgfsetlinewidth{3\pgflinewidth}
3957 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
3958 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
3959 \fi
3960 \pgfusepath{draw}
3961 }
3962
3963
3964 %% cute inductor
3965
3966 \pgfcircdeclarebipole
3967 {}
3968 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
3969 {cuteinductor}
3970 {\ctikzvalof{bipoles/cuteinductor/height}}
3971 {\ctikzvalof{bipoles/cuteinductor/width}}
3972 {
3973 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
3974 \pgftransformationadjustments
3975
3976 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
3977 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
3978
3979
3980 \pgfmathsetlength{\pgf@circ@res@step}
3981 {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
3982
3983 \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
3984 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
3985 {
3986 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3987 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
3988 }
3989 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
3990 \pgfsetbuttcap
3991 \pgfsetbeveljoin
3992 \pgfusepath{stroke}
3993 }
3994
3995 %% cute inductive sensor
3996
3997 \pgfcircdeclarebipole
3998 {%
3999 {% anchor for labelling the type of dependency
4000 \anchor{label}{%
4001 \southwest
4002 \pgf@x=0.8\pgf@x
4003 \pgf@y=2.6\pgf@y
4004 }%
4005 }}
4006 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
4007 {scuteinductor}
4008 {\ctikzvalof{bipoles/cuteinductor/height}}
4009 {\ctikzvalof{bipoles/cuteinductor/width}}
4010 {
4011 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4012 \pgftransformationadjustments
4013
4014 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4015 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
4016
4017
4018 \pgfmathsetlength{\pgf@circ@res@step}
4019 {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
4020
4021 \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
4022 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
4023 {
4024 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4025 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4026 }
4027 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4028 \pgfsetbuttcap
4029 \pgfsetbeveljoin
4030 \pgfusepath{stroke}
4031 \pgfscope
4032 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
4033 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4034 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4035 \pgfusepath{draw}
4036 \endpgfscope
4037 }
4038
4039 %% cute choke
4040
4041 \pgfcircdeclarebipole
4042 {}
4043 {\ctikzvalof{bipoles/cutechoke/lower coil height}}
4044 {cutechoke}
4045 {\ctikzvalof{bipoles/cutechoke/height}}
4046 {\ctikzvalof{bipoles/cutechoke/width}}
4047 {
4048 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4049 \pgftransformationadjustments
4050
4051 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4052 {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
4053
4054
4055 \pgfmathsetlength{\pgf@circ@res@step}
4056 {(\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
4057
4058 \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
4059 \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
4060 {
4061 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4062 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4063 }
4064 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4065 \pgfsetbuttcap
4066 \pgfsetbeveljoin
4067 \pgfusepath{stroke}
4068
4069 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4070 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4071 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
4072 \pgfusepath{stroke}
4073
4074 \ifpgf@circuit@bipole@twolines
4075 \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}}
4076 \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}}
4077 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
4078 \pgfusepath{stroke}
4079 \fi
4080 }
4081
4082 %% variable cute inductor
4083
4084 \pgfcircdeclarebipole
4085 {}
4086 {\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
4087 {vcuteinductor}
4088 {\ctikzvalof{bipoles/vcuteinductor/height}}
4089 {\ctikzvalof{bipoles/vcuteinductor/width}}
4090 {
4091 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4092 \pgftransformationadjustments
4093
4094 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4095 {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
4096
4097
4098 \pgfmathsetlength{\pgf@circ@res@step}
4099 {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
4100
4101 \pgfscope
4102 \pgfsetarrowsend{latexslim}
4103 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4104 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4105 \pgfusepath{draw}
4106 \endpgfscope
4107
4108 \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
4109 \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
4110 {
4111 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
4112 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
4113 }
4114 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
4115 \pgfsetbuttcap
4116 \pgfsetbeveljoin
4117 \pgfusepath{stroke}
4118 }
4119 %% american inductor
4120
4121 \pgfcircdeclarebipole
4122 {}
4123 {\ctikzvalof{bipoles/americaninductor/height 2}}
4124 {americaninductor}
4125 {\ctikzvalof{bipoles/americaninductor/height}}
4126 {\ctikzvalof{bipoles/americaninductor/width}}
4127 {
4128 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
4129 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4130 \pgftransformationadjustments
4131 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4132 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
4133 \divide \pgf@circ@res@step by 2
4134 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
4135
4136 \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
4137 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
4138 {
4139 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4140 }
4141 \pgfsetbuttcap
4142 \pgfsetbeveljoin
4143 \pgfusepath{stroke}
4144 }
4145
4146
4147 %% american inductive sensor
4148
4149 \pgfcircdeclarebipole
4150 {%
4151 {% anchor for labelling the type of dependency
4152 \anchor{label}{%
4153 \southwest
4154 \pgf@x=0.8\pgf@x
4155 \pgf@y=2.6\pgf@y
4156 }%
4157 }}
4158 {\ctikzvalof{bipoles/americaninductor/height 2}}
4159 {samericaninductor}
4160 {\ctikzvalof{bipoles/americaninductor/height}}
4161 {\ctikzvalof{bipoles/americaninductor/width}}
4162 {
4163 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
4164 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4165 \pgftransformationadjustments
4166 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4167 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
4168 \divide \pgf@circ@res@step by 2
4169 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
4170
4171 \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
4172 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
4173 {
4174 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4175 }
4176 \pgfsetbuttcap
4177 \pgfsetbeveljoin
4178 \pgfusepath{stroke}
4179 \pgfscope
4180 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
4181 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4182 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4183 \pgfusepath{draw}
4184 \endpgfscope
4185 }
4186
4187 %% variable american inductor
4188
4189 \pgfcircdeclarebipole
4190 {}
4191 {\ctikzvalof{bipoles/vamericaninductor/height 2}}
4192 {vamericaninductor}
4193 {\ctikzvalof{bipoles/vamericaninductor/height}}
4194 {\ctikzvalof{bipoles/vamericaninductor/width}}
4195 {
4196 \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
4197 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4198 \pgftransformationadjustments
4199 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4200 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
4201 \divide \pgf@circ@res@step by 2
4202 \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
4203
4204 \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
4205 \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
4206 {
4207 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4208 }
4209 \pgfsetbuttcap
4210 \pgfsetbeveljoin
4211 \pgfusepath{stroke}
4212
4213 \pgfscope
4214 \pgfsetarrowsend{latexslim}
4215 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4216 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
4217 \pgfusepath{draw}
4218 \endpgfscope
4219 }
4220
4221
4222 %% Independent voltage source
4223
4224 \pgfcircdeclarebipole
4225 {}
4226 {\ctikzvalof{bipoles/vsource/height}}
4227 {vsource}
4228 {\ctikzvalof{bipoles/vsource/height}}
4229 {\ctikzvalof{bipoles/vsource/width}}
4230 {
4231
4232 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4233
4234 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4235 \pgf@circ@draworfill
4236 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4237 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4238 \pgfusepath{draw}
4239 }
4240
4241
4242 %% Independent voltage source - American style
4243
4244 \pgfcircdeclarebipole
4245 {}
4246 {\ctikzvalof{bipoles/vsourceam/height}}
4247 {vsourceAM}
4248 {\ctikzvalof{bipoles/vsourceam/height}}
4249 {\ctikzvalof{bipoles/vsourceam/width}}
4250 {
4251
4252 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4253 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4254 \pgf@circ@draworfill
4255 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
4256 \ifpgf@circ@oldvoltagedirection
4257 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
4258 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
4259 \else
4260 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
4261 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
4262 \fi
4263 }
4264
4265
4266
4267 %% Independent sinusoidal voltage source
4268
4269 \pgfcircdeclarebipole
4270 {}
4271 {\ctikzvalof{bipoles/vsourcesin/height}}
4272 {vsourcesin}
4273 {\ctikzvalof{bipoles/vsourcesin/height}}
4274 {\ctikzvalof{bipoles/vsourcesin/width}}
4275 {
4276
4277 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4278 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4279 \pgf@circ@draworfill
4280
4281 \pgf@circ@res@up = .5\pgf@circ@res@up
4282 \pgfscope
4283 \pgftransformrotate{90}
4284 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4285 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4286 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4287 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4288 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4289 \pgfusepath{draw}
4290 \endpgfscope
4291 }
4292
4293 % Square Voltage source - contributed by Alistair Kwan
4294 \pgfcircdeclarebipole
4295 {}
4296 {\ctikzvalof{bipoles/vsourcesquare/height}}
4297 {vsourcesquare}
4298 {\ctikzvalof{bipoles/vsourcesquare/height}}
4299 {\ctikzvalof{bipoles/vsourcesquare/width}}
4300 {
4301 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4302 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4303 \pgf@circ@draworfill
4304 \pgf@circ@res@up = .5\pgf@circ@res@up
4305 \pgfscope
4306 \pgftransformrotate{90}
4307 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
4308 \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
4309 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
4310 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
4311 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
4312 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
4313 \pgfusepath{draw}
4314 \endpgfscope
4315 }
4316
4317 % Triangle Voltage source - contributed by Ralf Farkas
4318 \pgfcircdeclarebipole
4319 {}
4320 {\ctikzvalof{bipoles/vsourcetri/height}}
4321 {vsourcetri}
4322 {\ctikzvalof{bipoles/vsourcetri/height}}
4323 {\ctikzvalof{bipoles/vsourcetri/width}}
4324 {
4325
4326 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4327 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4328 \pgf@circ@draworfill
4329
4330 \pgf@circ@res@up = .5\pgf@circ@res@up
4331 \pgfscope
4332 \pgftransformrotate{90}
4333 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
4334 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
4335 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
4336 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
4337 \pgfusepath{draw}
4338 \endpgfscope
4339 }
4340
4341
4342 %% PV Source
4343 \pgfcircdeclarebipole
4344 {}
4345 {\ctikzvalof{bipoles/pvsource/height}}
4346 {pvsource}
4347 {\ctikzvalof{bipoles/pvsource/height}}
4348 {\ctikzvalof{bipoles/pvsource/width}}
4349 {
4350 \pgfpointorigin
4351 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4352 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4353 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4354 \pgf@circ@draworfill
4355
4356 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
4357 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
4358 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
4359 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
4360 \pgfusepath{draw}
4361
4362 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4363 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
4364 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
4365
4366 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
4367 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
4368 \pgfusepath{draw}
4369
4370 %Arrow Part
4371 \pgfscope
4372 \pgfsetarrowsend{latex}
4373 \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
4374 \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
4375 \pgfusepath{draw}
4376 \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
4377 \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
4378 \pgfusepath{draw}
4379 \endpgfscope
4380
4381 }
4382
4383 %% Empty Source
4384 \pgfcircdeclarebipole
4385 {}
4386 {\ctikzvalof{bipoles/esource/height}}
4387 {esource}
4388 {\ctikzvalof{bipoles/esource/height}}
4389 {\ctikzvalof{bipoles/esource/width}}
4390 {
4391 \pgfpointorigin
4392 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4393 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4394 \pgf@circ@draworfill
4395 }
4396
4397 %% DC Current Source with open shape
4398 \pgfcircdeclarebipole
4399 {}
4400 {\ctikzvalof{bipoles/dcisource/height}}
4401 {dcisource}
4402 {\ctikzvalof{bipoles/dcisource/height}}
4403 {\ctikzvalof{bipoles/dcisource/width}}
4404 {
4405 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4406 \pgfpathmoveto{\pgfpointorigin}
4407 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4408 \pgf@circ@maybefill
4409 \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
4410 \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
4411 \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
4412 \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
4413 \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
4414 \pgfusepath{draw}
4415
4416 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4417 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4418 \pgfusepath{draw}
4419 \pgfscope
4420 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4421 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4422 \endpgfscope
4423 }
4424 %% DC-Voltage source
4425 \pgfcircdeclarebipole
4426 {}
4427 {\ctikzvalof{bipoles/dcvsource/height}}
4428 {dcvsource}
4429 {\ctikzvalof{bipoles/dcvsource/height}}
4430 {\ctikzvalof{bipoles/dcvsource/width}}
4431 {
4432 \pgfpointorigin
4433 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4434 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4435 \pgf@circ@draworfill
4436 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
4437 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
4438 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
4439 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
4440 \pgfusepath{draw}
4441 }
4442
4443
4444 %% Independent current source
4445
4446 \pgfcircdeclarebipole
4447 {}
4448 {\ctikzvalof{bipoles/isource/height}}
4449 {isource}
4450 {\ctikzvalof{bipoles/isource/height}}
4451 {\ctikzvalof{bipoles/isource/width}}
4452 {
4453 \pgfpointorigin
4454 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4455 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4456 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4457 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4458 \pgf@circ@draworfill
4459 }
4460
4461 %% Independent double oo source
4462
4463 \pgfcircdeclarebipole
4464 {}
4465 {\ctikzvalof{bipoles/oosource/height}}
4466 {oosource}
4467 {\ctikzvalof{bipoles/oosource/height}}
4468 {\ctikzvalof{bipoles/oosource/width}}
4469 {
4470 \pgfpointorigin
4471 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4472 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
4473 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
4474 \pgf@circ@maybefill
4475 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
4476 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
4477 \pgf@circ@draworfill
4478 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
4479 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
4480 \pgfusepath{draw}
4481 }
4482
4483
4484 %% Independent current source - American
4485
4486 \pgfcircdeclarebipole
4487 {}
4488 {\ctikzvalof{bipoles/isourceam/height}}
4489 {isourceAM}
4490 {\ctikzvalof{bipoles/isourceam/height}}
4491 {\ctikzvalof{bipoles/isourceam/width}}
4492 {
4493 \pgfpointorigin
4494 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4495 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4496 \pgf@circ@draworfill
4497
4498 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4499 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
4500 \pgfusepath{draw}
4501 \pgfscope
4502 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4503 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4504 \endpgfscope
4505 }
4506
4507
4508 %% Independent sinusoidal current source
4509
4510 \pgfcircdeclarebipole
4511 {}
4512 {\ctikzvalof{bipoles/isource/height}}
4513 {isourcesin}
4514 {\ctikzvalof{bipoles/isource/height}}
4515 {\ctikzvalof{bipoles/isource/width}}
4516 {
4517 \pgfpointorigin
4518 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4519 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4520 \pgf@circ@draworfill
4521
4522 \pgf@circ@res@up = .5\pgf@circ@res@up
4523 \pgfscope
4524 \pgftransformrotate{90}
4525 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4526 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4527 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4528 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4529 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4530 \pgfusepath{draw}
4531 \endpgfscope
4532
4533 }
4534
4535
4536 %% Controlled voltage source
4537
4538 \pgfcircdeclarebipole
4539 {}
4540 {\ctikzvalof{bipoles/cvsource/height}}
4541 {cvsource}
4542 {\ctikzvalof{bipoles/cvsource/height}}
4543 {\ctikzvalof{bipoles/cvsource/width}}
4544 {
4545
4546 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4547
4548 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4549 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4550 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4551 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4552 \pgfpathclose
4553 \pgf@circ@draworfill
4554
4555 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4556 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4557 \pgfusepath{draw}
4558 }
4559
4560
4561
4562
4563 %% Controlled voltage source - American
4564 \pgfcircdeclarebipole
4565 {}
4566 {\ctikzvalof{bipoles/cvsourceam/height}}
4567 {cvsourceAM}
4568 {\ctikzvalof{bipoles/cvsourceam/height}}
4569 {\ctikzvalof{bipoles/cvsourceam/width}}
4570 {
4571 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4572 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4573 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4574 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4575 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4576 \pgfpathclose
4577 \pgf@circ@draworfill
4578
4579 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
4580 \ifpgf@circ@oldvoltagedirection
4581 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
4582 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
4583 \else
4584 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
4585 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
4586 \fi
4587 }
4588
4589
4590 %% Controlled sinusoidal voltage source
4591 \pgfcircdeclarebipole
4592 {}
4593 {\ctikzvalof{bipoles/cvsourcesin/height}}
4594 {cvsourcesin}
4595 {\ctikzvalof{bipoles/cvsourcesin/height}}
4596 {\ctikzvalof{bipoles/cvsourcesin/width}}
4597 {
4598
4599 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4600
4601 \pgfscope
4602 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4603 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4604 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4605 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4606 \pgfpathclose
4607 \pgf@circ@draworfill
4608 \endpgfscope
4609
4610 \pgf@circ@res@up = .5\pgf@circ@res@up
4611 \pgfscope
4612 \pgftransformrotate{90}
4613 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4614 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4615 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4616 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4617 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4618 \pgfusepath{draw}
4619 \endpgfscope
4620 }
4621
4622
4623
4624 %% Controlled sinusoidal current source
4625
4626 \pgfcircdeclarebipole
4627 {}
4628 {\ctikzvalof{bipoles/cvsourcesin/height}}
4629 {cisourcesin}
4630 {\ctikzvalof{bipoles/cvsourcesin/height}}
4631 {\ctikzvalof{bipoles/cvsourcesin/width}}
4632 {
4633
4634 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4635
4636 \pgfscope
4637 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4638 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4639 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4640 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4641 \pgfpathclose
4642 \pgf@circ@draworfill
4643 \endpgfscope
4644
4645 \pgf@circ@res@up = .5\pgf@circ@res@up
4646 \pgfscope
4647 \pgftransformrotate{90}
4648 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
4649 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4650 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4651 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
4652 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
4653 \pgfusepath{draw}
4654 \endpgfscope
4655 }
4656
4657 %% Controlled current source
4658
4659 \pgfcircdeclarebipole
4660 {}
4661 {\ctikzvalof{bipoles/cisource/height}}
4662 {cisource}
4663 {\ctikzvalof{bipoles/cisource/height}}
4664 {\ctikzvalof{bipoles/cisource/width}}
4665 {
4666
4667 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4668
4669 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4670 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4671 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4672 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4673 \pgfpathclose
4674 \pgf@circ@draworfill
4675
4676 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4677 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4678 \pgfusepath{draw}
4679 }
4680
4681
4682 %% Controlled current source - American
4683
4684 \pgfcircdeclarebipole
4685 {}
4686 {\ctikzvalof{bipoles/cisourceam/height}}
4687 {cisourceAM}
4688 {\ctikzvalof{bipoles/cisourceam/height}}
4689 {\ctikzvalof{bipoles/cisourceam/width}}
4690 {
4691 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4692
4693 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4694 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4695 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4696 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4697 \pgfpathclose
4698 \pgf@circ@draworfill
4699 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
4700 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
4701 \pgfusepath{draw}
4702 \pgfscope
4703 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
4704 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
4705 \endpgfscope
4706 }
4707
4708 %% Cute Independent voltage source
4709
4710 \pgfcircdeclarebipole
4711 {}
4712 {\ctikzvalof{bipoles/vsource/height}}
4713 {vsourceC}
4714 {\ctikzvalof{bipoles/vsource/height}}
4715 {\ctikzvalof{bipoles/vsource/width}}
4716 {
4717 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4718 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4719 \pgf@circ@draworfill
4720 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4721 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4722 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4723 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4724 \pgfsetroundcap\pgfusepath{draw}
4725 }
4726 %% Cute Independent current source
4727
4728 \pgfcircdeclarebipole
4729 {}
4730 {\ctikzvalof{bipoles/isource/height}}
4731 {isourceC}
4732 {\ctikzvalof{bipoles/isource/height}}
4733 {\ctikzvalof{bipoles/isource/width}}
4734 {
4735 \pgfpointorigin
4736 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4737 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4738 \pgf@circ@draworfill
4739 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4740 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4741 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
4742 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
4743 \pgfsetroundcap\pgfusepath{draw}
4744 }
4745 %% Cute Controlled voltage source
4746
4747 \pgfcircdeclarebipole
4748 {}
4749 {\ctikzvalof{bipoles/cvsource/height}}
4750 {cvsourceC}
4751 {\ctikzvalof{bipoles/cvsource/height}}
4752 {\ctikzvalof{bipoles/cvsource/width}}
4753 {
4754 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4755 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4756 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4757 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4758 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4759 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4760 \pgf@circ@draworfill
4761 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4762 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4763 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4764 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4765 \pgfsetroundcap\pgfusepath{draw}
4766 }
4767
4768 %% Cute Controlled current source
4769
4770 \pgfcircdeclarebipole
4771 {}
4772 {\ctikzvalof{bipoles/cisource/height}}
4773 {cisourceC}
4774 {\ctikzvalof{bipoles/cisource/height}}
4775 {\ctikzvalof{bipoles/cisource/width}}
4776 {
4777 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4778 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4779 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
4780 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
4781 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
4782 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
4783 \pgf@circ@draworfill
4784 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4785 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4786 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
4787 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
4788 \pgfsetroundcap\pgfusepath{draw}
4789 }
4790
4791 %% Noise voltage source
4792
4793 \pgfcircdeclarebipole
4794 {}
4795 {\ctikzvalof{bipoles/vsource/height}}
4796 {vsourceN}
4797 {\ctikzvalof{bipoles/vsource/height}}
4798 {\ctikzvalof{bipoles/vsource/width}}
4799 {
4800 \pgfscope
4801 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4802 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4803 %
4804 \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
4805 \edef\pgf@noise@temp{dashed}
4806 \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
4807 \ifx\pgf@noise@temp\pgf@noise@fill
4808 % fillable in this case
4809 \pgf@circ@draworfillandclip
4810 \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4811 \pgfsetlinewidth{\thinner\pgfstartlinewidth}
4812 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4813 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4814 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4815 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4816 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4817 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4818 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4819 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4820 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4821 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4822 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4823 %
4824 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
4825 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4826 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4827 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4828 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4829 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4830 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4831 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4832 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4833 \pgfusepath{draw}
4834 \else
4835 \pgfsetfillcolor{\pgf@noise@fill}
4836 \pgfusepath{draw,fill}
4837 \fi
4838 \endpgfscope
4839 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4840 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4841 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
4842 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
4843 \pgfsetroundcap\pgfusepath{draw}
4844 }
4845 %% Noise current source
4846
4847 \pgfcircdeclarebipole
4848 {}
4849 {\ctikzvalof{bipoles/isource/height}}
4850 {isourceN}
4851 {\ctikzvalof{bipoles/isource/height}}
4852 {\ctikzvalof{bipoles/isource/width}}
4853 {
4854 \pgfpointorigin
4855 \pgfscope
4856 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4857 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
4858 %
4859 \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
4860 \edef\pgf@noise@temp{dashed}
4861 \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
4862 \ifx\pgf@noise@temp\pgf@noise@fill
4863 % fillable in this case
4864 \pgf@circ@draworfillandclip
4865 \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4866 \pgfsetlinewidth{\thinner\pgfstartlinewidth}
4867 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4868 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4869 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4870 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4871 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4872 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4873 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4874 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4875 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
4876 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4877 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4878 %
4879 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
4880 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4881 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4882 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4883 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4884 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4885 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
4886 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4887 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4888 \pgfusepath{draw}
4889 \else
4890 \pgfsetfillcolor{\pgf@noise@fill}
4891 \pgfusepath{draw,fill}
4892 \fi
4893 \endpgfscope
4894 \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
4895 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
4896 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
4897 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
4898 \pgfsetroundcap\pgfusepath{draw}
4899 }
4900 %% Black generic diode
4901
4902 \pgfcircdeclarebipole
4903 {}
4904 {\ctikzvalof{bipoles/diode/height}}
4905 {fulldiode}
4906 {\ctikzvalof{bipoles/diode/height}}
4907 {\ctikzvalof{bipoles/diode/width}}
4908 {
4909
4910 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4911
4912 \pgfscope
4913 \pgftransformxshift{\pgf@circ@res@left}
4914 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4915 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4916 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4917 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4918 \pgfusepath{draw,fill}
4919 \endpgfscope
4920 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4921 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4922 \pgfusepath{draw}
4923 }
4924
4925 %% Black Zener diode
4926
4927 \pgfcircdeclarebipole
4928 {}
4929 {\ctikzvalof{bipoles/diode/height}}
4930 {fullzdiode}
4931 {\ctikzvalof{bipoles/diode/height}}
4932 {\ctikzvalof{bipoles/diode/width}}
4933 {
4934
4935 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4936
4937 \pgfscope
4938 \pgftransformxshift{\pgf@circ@res@left}
4939 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4940 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4941 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4942 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4943 \pgfusepath{draw,fill}
4944 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4945 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4946 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
4947 \pgfusepath{draw}
4948 \endpgfscope
4949 }
4950
4951 %% Black alternative zigzag Zener diode
4952 \pgfcircdeclarebipole
4953 {}
4954 {\ctikzvalof{bipoles/diode/height}}
4955 {fullzzdiode}
4956 {\ctikzvalof{bipoles/diode/height}}
4957 {\ctikzvalof{bipoles/diode/width}}
4958 {
4959
4960 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4961
4962 \pgfscope
4963 \pgftransformxshift{\pgf@circ@res@left}
4964 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4965 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4966 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4967 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4968 \pgfusepath{draw,fill}
4969 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
4970 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4971 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
4972 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
4973 \pgfusepath{draw}
4974 \endpgfscope
4975 }
4976
4977 %% Black Schottky diode
4978
4979 \pgfcircdeclarebipole
4980 {}
4981 {\ctikzvalof{bipoles/diode/height}}
4982 {fullsdiode}
4983 {\ctikzvalof{bipoles/diode/height}}
4984 {\ctikzvalof{bipoles/diode/width}}
4985 {
4986
4987 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
4988 \pgfscope
4989 \pgftransformxshift{\pgf@circ@res@left}
4990 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4991 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4992 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
4993 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
4994 \pgfusepath{draw,fill}
4995
4996 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
4997 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
4998 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
4999 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5000 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5001 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5002 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
5003 \pgfusepath{draw}
5004 \endpgfscope
5005
5006 }
5007
5008 %% Black tunnel diode
5009
5010 \pgfcircdeclarebipole
5011 {}
5012 {\ctikzvalof{bipoles/diode/height}}
5013 {fulltdiode}
5014 {\ctikzvalof{bipoles/diode/height}}
5015 {\ctikzvalof{bipoles/diode/width}}
5016 {
5017
5018 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5019 \pgfscope
5020 \pgftransformxshift{\pgf@circ@res@left}
5021 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5022 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5023 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5024 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5025 \pgfusepath{draw,fill}
5026
5027 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
5028 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5029 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5030 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5031 \pgfusepath{draw}
5032 \endpgfscope
5033 }
5034
5035 %% Black light emitting diode
5036
5037 \pgfcircdeclarebipole
5038 {}
5039 {\ctikzvalof{bipoles/diode/height}}
5040 {fulllediode}
5041 {\ctikzvalof{bipoles/diode/height}}
5042 {\ctikzvalof{bipoles/diode/width}}
5043 {
5044
5045 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5046 \pgfscope
5047 \pgftransformxshift{\pgf@circ@res@left}
5048 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5049 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5050 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5051 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5052 \pgfusepath{draw,fill}
5053 \endpgfscope
5054 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5055 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5056 \pgfusepath{draw}
5057
5058 \pgfsetlinewidth{\pgfstartlinewidth}
5059 \pgfsetarrowsend{latexslim}
5060 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5061 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5062 \pgfusepath{draw}
5063 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5064 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5065 \pgfusepath{draw}
5066
5067 }
5068
5069 %% Black photodiode
5070
5071 \pgfcircdeclarebipole
5072 {}
5073 {\ctikzvalof{bipoles/diode/height}}
5074 {fullpdiode}
5075 {\ctikzvalof{bipoles/diode/height}}
5076 {\ctikzvalof{bipoles/diode/width}}
5077 {
5078
5079 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5080 \pgfscope
5081 \pgftransformxshift{\pgf@circ@res@left}
5082 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5083 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5084 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5085 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5086 \pgfusepath{draw,fill}
5087 \endpgfscope
5088 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5089 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5090 \pgfusepath{draw}
5091
5092 \pgfsetlinewidth{\pgfstartlinewidth}
5093 \pgfsetarrowsstart{latexslim}
5094 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5095 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5096 \pgfusepath{draw}
5097 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5098 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5099 \pgfusepath{draw}
5100 }
5101
5102 %% Black varcap
5103
5104 \pgfcircdeclarebipole
5105 {}
5106 {\ctikzvalof{bipoles/varcap/height}}
5107 {fullvarcap}
5108 {\ctikzvalof{bipoles/varcap/height}}
5109 {\ctikzvalof{bipoles/varcap/width}}
5110 {
5111 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
5112 \pgfsetlinewidth{\pgf@circ@res@temp}
5113 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5114 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5115 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5116 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5117 \pgfusepath{draw,fill}
5118 %
5119 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
5120 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
5121 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5122 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5123 \pgfusepath{draw}
5124 }
5125
5126 %% Code for the diode triangle
5127 \def\pgf@circ@basicdiodeshape{
5128 % \pgfscope
5129 \pgftransformxshift{\pgf@circ@res@left}
5130 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5131 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5132 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5133 \pgfpathclose
5134 \pgf@circ@draworfill
5135 \pgfscope
5136 % to allow filling, we need to draw explicitily the stroke here.
5137 \pgfsetlinewidth{\pgfstartlinewidth}
5138 \ifpgf@circuit@bipole@strokedsymbol
5139 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5140 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
5141 \pgfusepath{draw}
5142 \fi
5143 \endpgfscope
5144 % \endpgfscope
5145 }
5146
5147
5148 %% Empty generic diode
5149
5150 \pgfcircdeclarebipole
5151 {}
5152 {\ctikzvalof{bipoles/diode/height}}
5153 {emptydiode}
5154 {\ctikzvalof{bipoles/diode/height}}
5155 {\ctikzvalof{bipoles/diode/width}}
5156 {
5157 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5158 \pgfscope
5159 \pgf@circ@basicdiodeshape
5160 \endpgfscope
5161 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5162 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5163 \pgfusepath{draw}
5164 }
5165
5166 %% Empty Zener diode
5167
5168 \pgfcircdeclarebipole
5169 {}
5170 {\ctikzvalof{bipoles/diode/height}}
5171 {emptyzdiode}
5172 {\ctikzvalof{bipoles/diode/height}}
5173 {\ctikzvalof{bipoles/diode/width}}
5174 {
5175
5176 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5177
5178 \pgfscope
5179 \pgf@circ@basicdiodeshape
5180 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5181 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5182 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5183 \pgfusepath{draw}
5184 \endpgfscope
5185 }
5186
5187 %% Empty alternative zigzag Zener diode
5188 \pgfcircdeclarebipole
5189 {}
5190 {\ctikzvalof{bipoles/diode/height}}
5191 {emptyzzdiode}
5192 {\ctikzvalof{bipoles/diode/height}}
5193 {\ctikzvalof{bipoles/diode/width}}
5194 {
5195
5196 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5197
5198 \pgfscope
5199 \pgf@circ@basicdiodeshape
5200 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
5201 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5202 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5203 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
5204 \pgfusepath{draw}
5205 \endpgfscope
5206 }
5207 %% Empty Schottky diode
5208
5209 \pgfcircdeclarebipole
5210 {}
5211 {\ctikzvalof{bipoles/diode/height}}
5212 {emptysdiode}
5213 {\ctikzvalof{bipoles/diode/height}}
5214 {\ctikzvalof{bipoles/diode/width}}
5215 {
5216
5217 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5218 \pgfscope
5219 \pgf@circ@basicdiodeshape
5220 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
5221 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
5222 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5223 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5224 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5225 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5226 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
5227 \pgfusepath{draw}
5228 \endpgfscope
5229
5230 }
5231
5232 %% Empty tunnel diode
5233
5234 \pgfcircdeclarebipole
5235 {}
5236 {\ctikzvalof{bipoles/diode/height}}
5237 {emptytdiode}
5238 {\ctikzvalof{bipoles/diode/height}}
5239 {\ctikzvalof{bipoles/diode/width}}
5240 {
5241
5242 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5243 \pgfscope
5244 \pgf@circ@basicdiodeshape
5245 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
5246 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5247 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5248 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5249 \pgfusepath{draw}
5250 \endpgfscope
5251 }
5252
5253 %% Empty light emitting diode
5254
5255 \pgfcircdeclarebipole
5256 {}
5257 {\ctikzvalof{bipoles/diode/height}}
5258 {emptylediode}
5259 {\ctikzvalof{bipoles/diode/height}}
5260 {\ctikzvalof{bipoles/diode/width}}
5261 {
5262
5263 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5264 \pgfscope
5265 \pgf@circ@basicdiodeshape
5266 \endpgfscope
5267 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5268 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5269 \pgfusepath{draw}
5270
5271 \pgfsetlinewidth{\pgfstartlinewidth}
5272 \pgfsetarrowsend{latexslim}
5273 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5274 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5275 \pgfusepath{draw}
5276 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5277 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5278 \pgfusepath{draw}
5279 }
5280
5281 %% Empty photodiode
5282
5283 \pgfcircdeclarebipole
5284 {}
5285 {\ctikzvalof{bipoles/diode/height}}
5286 {emptypdiode}
5287 {\ctikzvalof{bipoles/diode/height}}
5288 {\ctikzvalof{bipoles/diode/width}}
5289 {
5290
5291 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5292 \pgfscope
5293 \pgf@circ@basicdiodeshape
5294 \endpgfscope
5295 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5296 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5297 \pgfusepath{draw}
5298
5299 \pgfsetlinewidth{\pgfstartlinewidth}
5300 \pgfsetarrowsstart{latexslim}
5301 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5302 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5303 \pgfusepath{draw}
5304 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5305 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5306 \pgfusepath{draw}
5307 }
5308
5309 %% Empty varcap
5310
5311 \pgfcircdeclarebipole
5312 {}
5313 {\ctikzvalof{bipoles/varcap/height}}
5314 {emptyvarcap}
5315 {\ctikzvalof{bipoles/varcap/height}}
5316 {\ctikzvalof{bipoles/varcap/width}}
5317 {
5318 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
5319 \pgfsetlinewidth{\pgf@circ@res@temp}
5320 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5321 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5322 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5323 % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5324 \pgfpathclose
5325 \pgf@circ@draworfill
5326 \pgfscope
5327 % to allow filling, we need to draw explicitily the stroke here.
5328 \pgfsetlinewidth{\pgfstartlinewidth}
5329 \ifpgf@circuit@bipole@strokedsymbol
5330 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5331 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5332 \pgfusepath{draw}
5333 \fi
5334 \endpgfscope
5335 %
5336 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
5337 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
5338 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5339 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5340 \pgfusepath{draw}
5341 }
5342
5343 %% Empty bidirectionaldiode
5344
5345 \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{emptybidirectionaldiode}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{\ctikzvalof{bipoles/bidirectionaldiode/width}}
5346 {
5347
5348 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5349
5350 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
5351 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
5352
5353 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5354 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5355 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5356 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5357
5358 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5359 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5360 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5361 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5362
5363 \pgf@circ@draworfill
5364 % \pgfusepath{draw}
5365
5366 \pgfsetlinewidth{\pgfstartlinewidth}
5367
5368 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5369 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5370
5371 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5372 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5373
5374 \pgfusepath{draw}
5375
5376 }
5377
5378
5379 %% Full bidirectionaldiode
5380
5381 \pgfcircdeclarebipole
5382 {}
5383 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
5384 {fullbidirectionaldiode}
5385 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
5386 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
5387 {
5388
5389 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5390
5391 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
5392 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
5393
5394 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5395 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5396 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5397 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5398
5399 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5400 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
5401 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5402 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
5403
5404 \pgfusepath{draw, fill}
5405
5406 \pgfsetlinewidth{\pgfstartlinewidth}
5407
5408 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
5409 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5410
5411 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
5412 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5413
5414 \pgfusepath{draw}
5415
5416 }
5417
5418 %% (Closing) SPST
5419 \pgfcircdeclarebipole
5420 {}
5421 {\ctikzvalof{bipoles/spst/depth}}
5422 {cspst}
5423 {\ctikzvalof{bipoles/spst/height}}
5424 {\ctikzvalof{bipoles/spst/width}}
5425 {
5426 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5427 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5428 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
5429 \pgfusepath{draw}
5430
5431 \pgfscope
5432 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5433 \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
5434 \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
5435 \pgfsetarrowsend{latexslim}
5436 \pgfsetbeveljoin
5437 \pgfusepath{draw}
5438 \endpgfscope
5439 }
5440
5441 %% Opening SPST
5442 \pgfcircdeclarebipole
5443 {}
5444 {\ctikzvalof{bipoles/spst/depth}}
5445 {ospst}
5446 {\ctikzvalof{bipoles/spst/height}}
5447 {\ctikzvalof{bipoles/spst/width}}
5448 {
5449
5450 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5451 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5452 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
5453 \pgfusepath{draw}
5454
5455 \pgfscope
5456 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5457 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
5458 \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
5459 \pgfsetarrowsend{latexslim}
5460 \pgfsetbeveljoin
5461 \pgfusepath{draw}
5462 \endpgfscope
5463 }
5464
5465 %% Normal open Switch
5466 \pgfcircdeclarebipole
5467 {}
5468 {\ctikzvalof{bipoles/nos/depth}}
5469 {nos}
5470 {\ctikzvalof{bipoles/nos/height}}
5471 {\ctikzvalof{bipoles/nos/width}}
5472 {
5473
5474 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5475 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5476 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
5477 \pgfsetbuttcap
5478 \pgfusepath{draw}
5479 }
5480
5481 %% Normal closed Switch
5482 \pgfcircdeclarebipole
5483 {}
5484 {\ctikzvalof{bipoles/ncs/depth}}
5485 {ncs}
5486 {\ctikzvalof{bipoles/ncs/height}}
5487 {\ctikzvalof{bipoles/ncs/width}}
5488 {
5489 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5490 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5491 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
5492 \pgfusepath{draw}
5493 \pgfsetlinewidth{\pgfstartlinewidth}
5494 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
5495 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
5496 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
5497 \pgfusepath{draw}
5498 }
5499
5500 %% Push Button
5501 \pgfcircdeclarebipole
5502 {}
5503 {\ctikzvalof{bipoles/pushbutton/height 2}}
5504 {pushbutton}
5505 {\ctikzvalof{bipoles/pushbutton/height}}
5506 {\ctikzvalof{bipoles/pushbutton/width}}
5507 {
5508 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5509 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5510 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5511 \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
5512 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
5513 \pgfusepath{draw}
5514
5515 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5516 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5517 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5518 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5519 }
5520
5521 %% Normally closed Push Button
5522 \pgfcircdeclarebipole
5523 {}
5524 {\ctikzvalof{bipoles/pushbutton/height 2}}
5525 {ncpushbutton}
5526 {\ctikzvalof{bipoles/pushbutton/height}}
5527 {\ctikzvalof{bipoles/pushbutton/width}}
5528 {
5529 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5530 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5531 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5532 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
5533 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
5534 \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
5535 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
5536 \pgfusepath{draw}
5537 %
5538 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5539 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5540 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5541 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
5542 }
5543 % cute switch "to" shapes help function
5544 % #1 -> name
5545 % #2 -> barposition
5546 % #3 -> arrowcode
5547 \long\def\pgfcircdeclarecutesw#1#2#3{
5548 \pgfcircdeclarebipole
5549 {
5550 \savedanchor\midlever{
5551 % these values are calculated when we create the definition of the shape.
5552 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
5553 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5554 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
5555 \pgf@circ@res@down = -.5\pgf@y
5556 \pgf@circ@res@up = .5\pgf@y
5557 \pgfextracty{\pgf@circ@res@other}{#2}
5558 \pgf@x=0pt
5559 \pgf@y=.5\pgf@circ@res@other
5560 }
5561 % radius of the connector
5562 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5563 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
5564 % shapename
5565 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
5566 % shape type
5567 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
5568 % mid of the lever, to stack switches
5569 \anchor{mid}{\midlever}
5570 \anchor{cout}{\northeast \pgf@y=0cm}
5571 \anchor{cin}{\southwest\pgf@y=0cm}
5572 \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
5573 \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
5574 }
5575 {\ctikzvalof{bipoles/cuteswitch/height 2}}
5576 {#1}
5577 {\ctikzvalof{bipoles/cuteswitch/height}}
5578 {\ctikzvalof{bipoles/cuteswitch/width}}{
5579 \pgfscope
5580 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
5581 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
5582 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
5583 \pgfsetlinewidth{2\pgf@circ@res@temp}
5584 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5585 \pgfpathlineto{#2}
5586 \pgfsetroundcap\pgfusepath{draw}
5587 \endpgfscope
5588 \pgfscope % arrow
5589 #3
5590 \endpgfscope
5591 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
5592 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
5593 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
5594 \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
5595 }
5596 }
5597
5598 %% closed cute switch
5599 \pgfcircdeclarecutesw{cuteclosedswitch}
5600 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
5601 {}
5602
5603 %% open cute switch
5604 \pgfcircdeclarecutesw{cuteopenswitch}
5605 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5606 {}
5607
5608 %% closing cute switch
5609 \pgfcircdeclarecutesw{cuteclosingswitch}
5610 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5611 {
5612 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5613 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
5614 \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
5615 \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
5616 \pgfsetarrowsend{latexslim}
5617 \pgfusepath{draw}
5618 }
5619
5620 %% opening cute switch
5621 \pgfcircdeclarecutesw{cuteopeningswitch}
5622 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
5623 {
5624 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5625 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
5626 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
5627 \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
5628 \pgfsetarrowsend{latexslim}
5629 \pgfusepath{draw}
5630 }
5631
5632
5633 % % METERINGSHAPE
5634 \long\def\drawmeteringcircle{
5635 \def\pgf@circ@temp{right}
5636 \ifx\tikz@res@label@pos\pgf@circ@temp
5637 \pgf@circ@res@step=-1.2\pgf@circ@res@up
5638 \else
5639 \def\pgf@circ@temp{below}
5640 \ifx\tikz@res@label@pos\pgf@circ@temp
5641 \pgf@circ@res@step=-1.2\pgf@circ@res@up
5642 \else
5643 \pgf@circ@res@step=1.2\pgf@circ@res@up
5644 \fi
5645 \fi
5646 %draw connections to circle
5647 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5648 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
5649 \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
5650 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5651 \pgfusepath{draw}
5652 %draw circle
5653 \pgfscope
5654 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5655 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
5656 \pgf@circ@draworfill
5657 \endpgfscope
5658 %draw arrow
5659 \pgfscope
5660 \pgfsetarrowsend{latex}
5661 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5662 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
5663 \pgfusepath{draw}
5664 \endpgfscope
5665 }
5666 %AMPEREMETER
5667 \pgfcircdeclarebipole
5668 {}
5669 {\ctikzvalof{bipoles/ammeter/height}}
5670 {ammeter}
5671 {\ctikzvalof{bipoles/ammeter/height}}
5672 {\ctikzvalof{bipoles/ammeter/width}}
5673 {
5674 \drawmeteringcircle
5675 \pgfnode{circle}{center}{\textbf{A}}{}{}
5676 }
5677 %OHMMETER
5678 \pgfcircdeclarebipole
5679 {}
5680 {\ctikzvalof{bipoles/ohmmeter/height}}
5681 {ohmmeter}
5682 {\ctikzvalof{bipoles/ohmmeter/height}}
5683 {\ctikzvalof{bipoles/ohmmeter/width}}
5684 {
5685 \drawmeteringcircle
5686 \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
5687 }
5688 %VOLTMETER
5689 \pgfcircdeclarebipole
5690 {}
5691 {\ctikzvalof{bipoles/voltmeter/height}}
5692 {voltmeter}
5693 {\ctikzvalof{bipoles/voltmeter/height}}
5694 {\ctikzvalof{bipoles/voltmeter/width}}
5695 {
5696 \drawmeteringcircle
5697 \pgfnode{circle}{center}{\textbf{V}}{}{}
5698
5699 }
5700
5701 % oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
5702 \pgfcircdeclarebipole
5703 {
5704 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
5705 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
5706 % put the node text above and centered
5707 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
5708 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
5709 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
5710 }
5711 }
5712 }
5713 {\ctikzvalof{bipoles/oscope/height}}
5714 {oscope}
5715 {\ctikzvalof{bipoles/oscope/height}}
5716 {\ctikzvalof{bipoles/oscope/width}}
5717 {
5718 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5719 \pgfextracty{\pgf@circ@res@up}{\northeast}
5720 \pgfextractx{\pgf@circ@res@right}{\northeast}
5721 \pgfextractx{\pgf@circ@res@left}{\southwest}
5722 \pgfextracty{\pgf@circ@res@down}{\southwest}
5723 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
5724 \pgfscope
5725 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
5726 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5727 % this would create a round (analog?) scope...
5728 % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5729 \pgf@circ@draworfill
5730 \endpgfscope
5731 % get the rotation
5732 \pgfgettransformentries\a\b\temp\temp\temp\temp
5733 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
5734 % and unrotate the scope
5735 \pgfscope
5736 \pgftransformrotate{\rot}
5737 % grid
5738 \pgfscope
5739 \pgfsetlinewidth{0.5\pgfstartlinewidth}
5740 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5741 \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
5742 {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
5743 {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
5744 \pgfsetstrokeopacity{0.5}
5745 \pgfusepath{draw}
5746 \endpgfscope
5747 % function displayed, thanks to
5748 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5749 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5750 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
5751 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
5752 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
5753 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
5754 \pgfusepath{draw}
5755 \endpgfscope
5756 }
5757 %% Short circuit
5758
5759 %%% NOTICE that the short is really NOT drawn; we trust the fact that its
5760 %%% natural length is zero.
5761 \pgfcircdeclarebipole
5762 {}
5763 {0}
5764 {short}
5765 {0}
5766 {0}
5767 { }
5768
5769 %% Open circuit
5770
5771 \pgfcircdeclarebipole
5772 {}
5773 {\ctikzvalof{bipoles/open/height}}
5774 {open}
5775 {\ctikzvalof{bipoles/open/height}}
5776 {\ctikzvalof{bipoles/open/width}}
5777 { }
5778
5779 %% Generic bipole - used as resistor by some (bleah)
5780
5781 \pgfcircdeclarebipole
5782 {}
5783 {\ctikzvalof{bipoles/generic/height}}
5784 {generic}
5785 {\ctikzvalof{bipoles/generic/height}}
5786 {\ctikzvalof{bipoles/generic/width}}
5787 {
5788 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5789 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5790 \pgf@circ@draworfill
5791 }
5792
5793
5794 %% fuse
5795
5796 \pgfcircdeclarebipole
5797 {}
5798 {\ctikzvalof{bipoles/fuse/height}}
5799 {fuse}
5800 {\ctikzvalof{bipoles/fuse/height}}
5801 {\ctikzvalof{bipoles/fuse/width}}
5802 {
5803
5804 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
5805 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5806 \pgfusepath{draw}
5807
5808 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5809 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5810
5811 \pgf@circ@draworfill
5812 }
5813
5814
5815
5816 %% Generic bipole, filled - used as inductor by some
5817
5818 \pgfcircdeclarebipole
5819 {}
5820 {\ctikzvalof{bipoles/fullgeneric/height}}
5821 {fullgeneric}
5822 {\ctikzvalof{bipoles/fullgeneric/height}}
5823 {\ctikzvalof{bipoles/fullgeneric/width}}
5824 {
5825 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5826 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5827
5828 \pgfusepath{draw,fill}
5829 }
5830
5831 %% Generic sensor, filled - used as inductive sensor by some
5832
5833 \pgfcircdeclarebipole
5834 {{% anchor for labelling the type of dependency
5835 \anchor{label}{%
5836 \southwest
5837 \pgf@x=0.4\pgf@x
5838 \pgf@y=2\pgf@y
5839 }%
5840 }}
5841 {\ctikzvalof{bipoles/fullgeneric/height}}
5842 {sfullgeneric}
5843 {\ctikzvalof{bipoles/fullgeneric/height}}
5844 {\ctikzvalof{bipoles/fullgeneric/width}}
5845 {
5846
5847 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5848 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5849 \pgfusepath{draw,fill}
5850 %\pgfscope
5851 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
5852 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
5853 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
5854 \pgfusepath{draw}
5855 %\endpgfscope
5856 }
5857
5858
5859 %% Generic asymmetric bipole
5860
5861 \pgfcircdeclarebipole
5862 {}
5863 {\ctikzvalof{bipoles/ageneric/height}}
5864 {ageneric}
5865 {\ctikzvalof{bipoles/ageneric/height}}
5866 {\ctikzvalof{bipoles/ageneric/width}}
5867 {
5868 \pgfscope
5869 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5870 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5871 \pgf@circ@draworfill
5872 \endpgfscope
5873
5874 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5875 \pgfusepath{stroke,fill}
5876 }
5877
5878
5879 %% asymmetric fuse
5880
5881 \pgfcircdeclarebipole
5882 {}
5883 {\ctikzvalof{bipoles/afuse/height}}
5884 {afuse}
5885 {\ctikzvalof{bipoles/afuse/height}}
5886 {\ctikzvalof{bipoles/afuse/width}}
5887 {
5888 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
5889 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5890 \pgfusepath{draw}
5891
5892 \pgfscope
5893 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5894 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5895 \pgf@circ@draworfill
5896 \endpgfscope
5897
5898 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5899 \pgfusepath{stroke,fill}
5900 }
5901
5902
5903
5904
5905 %% Memristor
5906
5907 \pgfcircdeclarebipole
5908 {}
5909 {\ctikzvalof{bipoles/memristor/height}}
5910 {memristor}
5911 {\ctikzvalof{bipoles/memristor/height}}
5912 {\ctikzvalof{bipoles/memristor/width}}
5913 {
5914 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
5915 \divide \pgf@circ@res@step by 14
5916
5917 \pgfscope
5918 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5919 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5920 \pgf@circ@draworfill
5921 \endpgfscope
5922 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
5923 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
5924 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5925 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5926 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5927 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5928 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5929 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
5930 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
5931 \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
5932
5933 \pgfusepath{draw}
5934
5935 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5936 \pgfusepath{stroke,fill}
5937 }
5938
5939
5940
5941
5942 %% Generic empty tunable
5943
5944 \pgfcircdeclarebipole
5945 {}
5946 {\ctikzvalof{bipoles/tgeneric/height}}
5947 {tgeneric}
5948 {\ctikzvalof{bipoles/tgeneric/height}}
5949 {\ctikzvalof{bipoles/tgeneric/width}}
5950 {
5951 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
5952 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5953 \pgf@circ@draworfill
5954 \pgfscope
5955 \pgfsetarrowsend{latexslim}
5956 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
5957 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
5958 \pgfusepath{draw}
5959 \endpgfscope
5960 }
5961
5962 %% Photoresistor
5963
5964 \pgfcircdeclarebipole
5965 {}
5966 {\ctikzvalof{bipoles/photoresistor/height 2}}
5967 {photoresistor}
5968 {\ctikzvalof{bipoles/photoresistor/height}}
5969 {\ctikzvalof{bipoles/photoresistor/width}}
5970 {
5971 \pgfscope
5972 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
5973 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
5974 \pgf@circ@draworfill
5975 \endpgfscope
5976
5977 \pgfscope
5978 \pgfsetarrowsend{latexslim}
5979 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
5980 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
5981 \pgfusepath{draw}
5982 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
5983 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
5984 \pgfusepath{draw}
5985 \endpgfscope
5986 }
5987
5988
5989
5990
5991 %% Thermistor
5992 \pgfcircdeclarebipole
5993 {{% anchor for labelling the type of dependency
5994 \anchor{label}{%
5995 \southwest
5996 \pgf@x=0.4\pgf@x
5997 \pgf@y=1.2\pgf@y
5998 }%
5999 }}
6000 {\ctikzvalof{bipoles/thermistor/height}}
6001 {thermistor}
6002 {\ctikzvalof{bipoles/thermistor/height}}
6003 {\ctikzvalof{bipoles/thermistor/width}}
6004 {
6005 \pgfscope
6006 \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}}
6007 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6008 \pgf@circ@draworfill
6009 \endpgfscope
6010
6011 %\pgfscope
6012 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
6013 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
6014 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
6015 \pgfusepath{draw}
6016 %\endpgfscope
6017 }
6018
6019
6020 %% Thermistor PTC
6021 \pgfcircdeclarebipole
6022 {}
6023 {\ctikzvalof{bipoles/thermistorptc/height 2}}
6024 {thermistorptc}
6025 {\ctikzvalof{bipoles/thermistorptc/height}}
6026 {\ctikzvalof{bipoles/thermistorptc/width}}
6027 {
6028 \pgfscope
6029 \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}}
6030 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6031 \pgf@circ@draworfill
6032 \endpgfscope
6033 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
6034 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
6035 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
6036 \pgfusepath{draw}
6037
6038 \pgfsetlinewidth{\pgfstartlinewidth}
6039 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
6040 \pgfsetarrowsend{latexslim}
6041 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
6042 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
6043 \pgfusepath{draw}
6044 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
6045 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
6046 \pgfusepath{draw}
6047 }
6048
6049 %% Thermistor NTC
6050 \pgfcircdeclarebipole
6051 {}
6052 {\ctikzvalof{bipoles/thermistorntc/height 2}}
6053 {thermistorntc}
6054 {\ctikzvalof{bipoles/thermistorntc/height}}
6055 {\ctikzvalof{bipoles/thermistorntc/width}}
6056 {
6057 \pgfscope
6058 \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}}
6059 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6060 \pgf@circ@draworfill
6061 \endpgfscope
6062
6063 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
6064 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
6065 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
6066 \pgfusepath{draw}
6067
6068 \pgfsetlinewidth{\pgfstartlinewidth}
6069 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
6070 \pgfsetarrowsend{latexslim}
6071 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
6072 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
6073 \pgfusepath{draw}
6074 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
6075 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
6076 \pgfusepath{draw}
6077 }
6078
6079 %% thermocouple
6080 \pgfcircdeclarebipole
6081 {}
6082 {\ctikzvalof{bipoles/thermocouple/height 2}}
6083 {thermocouple}
6084 {\ctikzvalof{bipoles/thermocouple/height}}
6085 {\ctikzvalof{bipoles/thermocouple/width}}
6086 {
6087
6088 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
6089 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
6090 \pgfusepath{draw}
6091 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
6092 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6093 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
6094 \pgfusepath{draw}
6095 \pgfsetlinewidth{\pgfstartlinewidth}
6096 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
6097 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
6098 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
6099 \pgfusepath{draw}
6100 }
6101
6102 %% Varistor
6103 \pgfcircdeclarebipole
6104 {}
6105 {\ctikzvalof{bipoles/varistor/height}}
6106 {varistor}
6107 {\ctikzvalof{bipoles/varistor/height}}
6108 {\ctikzvalof{bipoles/varistor/width}}
6109 {
6110 \pgfscope
6111 \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}}
6112 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6113 \pgf@circ@draworfill
6114 \endpgfscope
6115
6116 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
6117 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
6118 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6119 \pgfusepath{draw}
6120
6121 \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
6122 }
6123
6124
6125
6126 %% Generic full tunable
6127
6128 \pgfcircdeclarebipole
6129 {}
6130 {\ctikzvalof{bipoles/tfullgeneric/height}}
6131 {tfullgeneric}
6132 {\ctikzvalof{bipoles/tfullgeneric/height}}
6133 {\ctikzvalof{bipoles/tfullgeneric/width}}
6134 {
6135 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
6136 \divide \pgf@circ@res@step by 14
6137
6138 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
6139 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6140 \pgfusepath{draw,fill}
6141
6142 \pgfscope
6143 \pgfsetarrowsend{latexslim}
6144 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
6145 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
6146 \pgfusepath{draw}
6147 \endpgfscope
6148 }
6149
6150
6151
6152
6153
6154
6155
6156 %% Variable Capacitor
6157
6158 \pgfcircdeclarebipole
6159 {}
6160 {\ctikzvalof{bipoles/vcapacitor/height}}
6161 {vcapacitor}
6162 {\ctikzvalof{bipoles/vcapacitor/height}}
6163 {\ctikzvalof{bipoles/vcapacitor/width}}
6164 {
6165 %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
6166 \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
6167
6168 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6169 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
6170 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
6171
6172 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
6173 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6174 \pgfusepath{draw}
6175
6176 \pgfscope
6177 \pgfsetarrowsend{latexslim}
6178 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6179 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6180 \pgfusepath{draw}
6181 \endpgfscope
6182
6183 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6184 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
6185 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6186 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6187 \pgfsetlinewidth{\pgfstartlinewidth}
6188 \pgfusepath{draw}
6189 }
6190
6191
6192 %% Piezoelectric Element
6193
6194 \pgfcircdeclarebipole
6195 {}
6196 {\ctikzvalof{bipoles/piezoelectric/height}}
6197 {piezoelectric}
6198 {\ctikzvalof{bipoles/piezoelectric/height}}
6199 {\ctikzvalof{bipoles/piezoelectric/width}}
6200 {
6201 \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
6202 \divide \pgf@circ@res@step by 5
6203
6204 %% Outer markings
6205 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6206 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6207 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6208
6209 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6210 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6211 \pgfusepath{draw}
6212
6213 %% Inner Box
6214 \pgfscope
6215 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6216 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}}
6217 \pgf@circ@draworfill
6218 \endpgfscope
6219 }
6220
6221
6222
6223
6224
6225
6226 %% Lamp
6227
6228 \pgfcircdeclarebipole
6229 {}
6230 {\ctikzvalof{bipoles/lamp/height}}
6231 {lamp}
6232 {\ctikzvalof{bipoles/lamp/height}}
6233 {\ctikzvalof{bipoles/lamp/width}}
6234 {
6235
6236 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6237
6238 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6239 \pgf@circ@draworfill
6240 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
6241 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
6242 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
6243 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
6244 \pgfusepath{draw}
6245 }
6246
6247 %% bulb
6248 \pgfcircdeclarebipole
6249 {}
6250 {\ctikzvalof{bipoles/bulb/height}}
6251 {bulb}
6252 {\ctikzvalof{bipoles/bulb/height}}
6253 {\ctikzvalof{bipoles/bulb/width}}
6254 {%
6255 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6256 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
6257 \pgf@circ@draworfill
6258 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6259 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
6260 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
6261 \pgfsetbeveljoin
6262 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
6263 \pgfusepath{draw}
6264 }
6265
6266
6267 % transmission line
6268
6269 \pgfcircdeclarebipole
6270 {}
6271 {\ctikzvalof{bipoles/tline/height}}
6272 {tline}
6273 {\ctikzvalof{bipoles/tline/height}}
6274 {\ctikzvalof{bipoles/tline/width}}
6275 {
6276 \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
6277 \begin{pgftransparencygroup}
6278 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6279 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
6280 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
6281 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
6282 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
6283 \pgf@circ@draworfill
6284 \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
6285 {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
6286 \pgf@circ@draworfill
6287 \end{pgftransparencygroup}
6288 \pgfsetlinewidth{\pgfstartlinewidth}
6289 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
6290 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6291 \pgfusepath{stroke}
6292 }
6293
6294 % microstrip transmission line
6295
6296 \pgfcircdeclarebipole
6297 {}
6298 {\ctikzvalof{bipoles/mstline/height}}
6299 {mstline}
6300 {\ctikzvalof{bipoles/mstline/height}}
6301 {\ctikzvalof{bipoles/mstline/width}}
6302 {
6303 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6304 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
6305 \pgf@circ@draworfill
6306 }
6307 %% SQUID added by Cor Molenaar 5 March 2010
6308
6309 \pgfcircdeclarebipole
6310 {}
6311 {\ctikzvalof{bipoles/squid/height}}
6312 {squid}
6313 {\ctikzvalof{bipoles/squid/height}}
6314 {\ctikzvalof{bipoles/squid/width}}
6315 {
6316
6317 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6318
6319 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6320 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
6321 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
6322 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
6323 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
6324 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
6325 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
6326 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
6327 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
6328
6329 \pgfusepath{draw}
6330 }
6331
6332
6333
6334 % Generic barrier added by Cor Molenaar 5 March 2010
6335
6336 \pgfcircdeclarebipole
6337 {}
6338 {\ctikzvalof{bipoles/barrier/height}}
6339 {barrier}
6340 {\ctikzvalof{bipoles/barrier/height}}
6341 {\ctikzvalof{bipoles/barrier/width}}
6342 {
6343
6344 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6345
6346 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
6347 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
6348 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
6349 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
6350 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
6351 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
6352
6353 \pgfusepath{draw}
6354 }
6355
6356
6357 % Contributed by Danilo Piazzalunga
6358
6359 \pgfdeclareshape{buffer}
6360 {
6361 \anchor{center}{\pgfpointorigin}
6362 \savedanchor\northwest{%
6363 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@circ@Rlen
6364 \pgf@y=.5\pgf@y
6365 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@circ@Rlen
6366 \pgf@x=.5\pgf@x
6367 }
6368 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
6369 \anchor{west}{ \northwest \pgf@y=0pt }
6370 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
6371 \anchor{north}{ \northwest \pgf@x=0pt }
6372 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
6373 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
6374 \anchor{north west}{ \northwest }
6375 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
6376 \savedanchor\left{%
6377 \pgf@y=0pt
6378 }
6379 \anchor{in}{
6380 \northwest
6381 \pgf@y=0pt
6382 }
6383 \anchor{out}{
6384 \northwest
6385 \pgf@y=0pt
6386 \pgf@x=-\pgf@x
6387 }
6388
6389 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
6390
6391 \backgroundpath{
6392 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
6393
6394
6395 \northwest
6396 \pgf@circ@res@up = \pgf@y
6397 \pgf@circ@res@down = -\pgf@y
6398 \pgf@circ@res@right = -\pgf@x
6399 \pgf@circ@res@left = \pgf@x
6400 \pgfscope
6401 \pgfsetlinewidth{2\pgflinewidth}
6402 \pgftransformxshift{.7\pgf@circ@res@left}
6403 \pgf@circ@res@step=\pgf@circ@res@right
6404 \advance\pgf@circ@res@step by -\pgf@circ@res@left
6405 \pgf@circ@res@step=.7\pgf@circ@res@step
6406
6407 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6408 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6409 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6410 \pgfpathclose
6411 \pgf@circ@draworfill
6412 \endpgfscope
6413
6414
6415 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6416 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
6417
6418 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6419 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6420
6421 \pgfusepath{draw}
6422
6423 }
6424 }
6425
6426
6427
6428
6429
6430 \pgfdeclareshape{plain amp}
6431 {
6432 \anchor{center}{\pgfpointorigin}
6433 \savedanchor\northwest{%
6434 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6435 \pgf@y=.5\pgf@y
6436 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6437 \pgf@x=.5\pgf@x
6438 }
6439 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
6440 \anchor{west}{ \northwest \pgf@y=0pt }
6441 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
6442 \anchor{north}{ \northwest \pgf@x=0pt }
6443 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
6444 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
6445 \anchor{north west}{ \northwest }
6446 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
6447 \savedanchor\left{%
6448 \pgf@y=0pt
6449 }
6450 \savedanchor\inOne{%
6451 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6452 \pgf@y=.5\pgf@y
6453 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
6454 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6455 \pgf@x=.5\pgf@x
6456 }
6457 \anchor{-}{
6458 \inOne
6459 }
6460 \anchor{+}{
6461 \inOne
6462 \pgf@y=-\pgf@y
6463 }
6464 \savedanchor\up{%
6465 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
6466 \pgf@y=.5\pgf@y
6467 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
6468 \pgf@x=.5\pgf@x
6469 \pgf@circ@res@up = \pgf@y
6470 \pgf@circ@res@right = -\pgf@x
6471 \pgf@circ@res@left = \pgf@x
6472 \pgfpointlineattime{
6473 \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
6474 \pgfpoint{
6475 \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6476 {\pgf@circ@res@up}}
6477 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6478 }
6479 \anchor{up}{
6480 \up
6481 }
6482 \anchor{down}{
6483 \up
6484 \pgf@y=-\pgf@y
6485 }
6486 \anchor{out}{
6487 \northwest
6488 \pgf@y=0pt
6489 \pgf@x=-\pgf@x
6490 }
6491
6492 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
6493
6494 \backgroundpath{
6495 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
6496
6497 \northwest
6498 \pgf@circ@res@up = \pgf@y
6499 \pgf@circ@res@down = -\pgf@y
6500 \pgf@circ@res@right = -\pgf@x
6501 \pgf@circ@res@left = \pgf@x
6502
6503 \pgfscope
6504 \pgfsetlinewidth{2\pgflinewidth}
6505 \pgftransformxshift{.7\pgf@circ@res@left}
6506 \pgf@circ@res@step=\pgf@circ@res@right
6507 \advance\pgf@circ@res@step by -\pgf@circ@res@left
6508 \pgf@circ@res@step=.7\pgf@circ@res@step
6509
6510 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6511 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6512 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6513 \pgfpathclose
6514 \pgf@circ@draworfill
6515 \endpgfscope
6516 \pgfpathmoveto{\pgfpoint
6517 {\pgf@circ@res@left}
6518 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
6519 \pgfpathlineto{\pgfpoint
6520 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6521 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
6522
6523
6524 \pgfpathmoveto{\pgfpoint
6525 {\pgf@circ@res@left}
6526 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
6527 \pgfpathlineto{\pgfpoint
6528 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
6529 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
6530
6531 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6532 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
6533
6534 \pgfusepath{draw}
6535
6536
6537
6538
6539
6540 }
6541 }
6542
6543
6544 %% Draw the two-port fillable box
6545 \def\pgf@circ@twoportbox{
6546 \pgfscope
6547 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6548 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6549 \pgf@circ@draworfill
6550 \endpgfscope
6551 }
6552
6553 %% Generic two port box
6554 \pgfcircdeclarebipole
6555 {}
6556 {\ctikzvalof{bipoles/twoport/height}}
6557 {twoport}
6558 {\ctikzvalof{bipoles/twoport/height}}
6559 {\ctikzvalof{bipoles/twoport/width}}
6560 {
6561 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
6562 \divide \pgf@circ@res@step by 2
6563
6564 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6565 \pgf@circ@res@other = \pgf@circ@res@left
6566 \advance\pgf@circ@res@other by \pgf@circ@res@step
6567 \ifpgf@circuit@dashed
6568 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6569 \fi
6570 % draw outer box
6571 \pgf@circ@twoportbox
6572 \ifpgf@circuit@inputarrow
6573 {
6574 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6575 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6576 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6577 }
6578 \fi
6579
6580 % rotate inner symbol
6581 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6582 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6583 \pgftransformrotate{270}
6584 \fi\fi
6585 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
6586 \pgftransformrotate{180}
6587 \fi\fi
6588 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6589 \pgftransformrotate{90}
6590 \fi\fi
6591
6592 % draw inner symbol
6593 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
6594
6595 }
6596
6597 %% voltage controled oscillator
6598 \pgfcircdeclarebipole
6599 {}
6600 {\ctikzvalof{bipoles/vco/width}}
6601 {vco}
6602 {\ctikzvalof{bipoles/twoport/width}}
6603 {\ctikzvalof{bipoles/vco/width}}
6604 {
6605 \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
6606 \divide \pgf@circ@res@step by 2
6607
6608 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6609 \pgf@circ@res@other = \pgf@circ@res@left
6610 \advance\pgf@circ@res@other by \pgf@circ@res@step
6611
6612 \ifpgf@circuit@dashed
6613 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6614 \fi
6615 % draw circle
6616 \pgfscope
6617 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
6618 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
6619 \pgf@circ@draworfill
6620 \endpgfscope
6621 \ifpgf@circuit@inputarrow
6622 {
6623 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6624 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6625 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6626 }
6627 \fi
6628
6629 % rotate inner symbol
6630 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6631 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6632 \pgftransformrotate{270}
6633 \fi\fi
6634 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6635 \pgftransformrotate{180}
6636 \fi\fi
6637 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6638 \pgftransformrotate{90}
6639 \fi\fi
6640
6641 % draw inner sine waves
6642 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6643 \pgfsetlinewidth{\pgfstartlinewidth}
6644 \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
6645 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6646 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6647 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6648 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6649 \pgfusepath{draw}
6650
6651 }
6652
6653 %% bandpass filter
6654 \pgfcircdeclarebipole
6655 {}
6656 {\ctikzvalof{bipoles/bandpass/width}}
6657 {bandpass}
6658 {\ctikzvalof{bipoles/bandpass/width}}
6659 {\ctikzvalof{bipoles/bandpass/width}}
6660 {
6661
6662 \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
6663 \divide \pgf@circ@res@step by 2
6664
6665 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6666 \pgf@circ@res@other = \pgf@circ@res@left
6667 \advance\pgf@circ@res@other by \pgf@circ@res@step
6668
6669 \ifpgf@circuit@dashed
6670 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6671 \fi
6672
6673 % draw outer box
6674 \pgf@circ@twoportbox
6675
6676 \ifpgf@circuit@inputarrow
6677 {
6678 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6679 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6680 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6681 }
6682 \fi
6683
6684 % rotate inner symbol
6685 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6686 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6687 \pgftransformrotate{270}
6688 \fi\fi
6689 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6690 \pgftransformrotate{180}
6691 \fi\fi
6692 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6693 \pgftransformrotate{90}
6694 \fi\fi
6695
6696 % draw inner symbol
6697 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6698 \pgfsetarrows{-} %never draw arrows
6699 \pgfsetlinewidth{\pgfstartlinewidth}
6700 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6701 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6702 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6703 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6704 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6705 \pgfusepath{draw}
6706 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
6707 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
6708 \pgfusepath{draw}
6709
6710 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6711 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6712 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6713 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6714 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6715 \pgfusepath{draw}
6716
6717 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6718 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6719 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6720 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6721 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6722 \pgfusepath{draw}
6723 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
6724 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
6725 \pgfusepath{draw}
6726 }
6727
6728 %% bandstop filter
6729 \pgfcircdeclarebipole
6730 {}
6731 {\ctikzvalof{bipoles/bandstop/width}}
6732 {bandstop}
6733 {\ctikzvalof{bipoles/bandstop/width}}
6734 {\ctikzvalof{bipoles/bandstop/width}}
6735 {
6736 \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@Rlen
6737 \divide \pgf@circ@res@step by 2
6738
6739 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6740 \pgf@circ@res@other = \pgf@circ@res@left
6741 \advance\pgf@circ@res@other by \pgf@circ@res@step
6742
6743 \ifpgf@circuit@dashed
6744 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6745 \fi
6746
6747 % draw outer box
6748 \pgf@circ@twoportbox
6749
6750 \ifpgf@circuit@inputarrow
6751 {
6752 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6753 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6754 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6755 }
6756 \fi
6757
6758 % rotate inner symbol
6759 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6760 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6761 \pgftransformrotate{270}
6762 \fi\fi
6763 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
6764 \pgftransformrotate{180}
6765 \fi\fi
6766 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6767 \pgftransformrotate{90}
6768 \fi\fi
6769
6770 % draw inner symbol
6771 \pgfsetdash{}{0pt}% always draw solid line for inner symbol
6772 \pgfsetarrows{-}%never draw arrows
6773 \pgfsetlinewidth{\pgfstartlinewidth}
6774 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6775 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6776 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6777 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6778 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6779 \pgfusepath{draw}
6780
6781 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6782 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6783 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6784 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6785 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6786 \pgfusepath{draw}
6787 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6788 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6789 \pgfusepath{draw}
6790
6791 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6792 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6793 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6794 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6795 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6796 \pgfusepath{draw}
6797 }
6798
6799 %% highpass filter
6800 \pgfcircdeclarebipole
6801 {}
6802 {\ctikzvalof{bipoles/highpass/width}}
6803 {highpass}
6804 {\ctikzvalof{bipoles/highpass/width}}
6805 {\ctikzvalof{bipoles/highpass/width}}
6806 {
6807 \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
6808 \divide \pgf@circ@res@step by 2
6809
6810 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6811 \pgf@circ@res@other = \pgf@circ@res@left
6812 \advance\pgf@circ@res@other by \pgf@circ@res@step
6813
6814 \ifpgf@circuit@dashed
6815 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6816 \fi
6817
6818 % draw outer box
6819 \pgf@circ@twoportbox
6820
6821 \ifpgf@circuit@inputarrow
6822 {
6823 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6824 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6825 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6826 }
6827 \fi
6828
6829 % rotate inner symbol
6830 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6831 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6832 \pgftransformrotate{270}
6833 \fi\fi
6834 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6835 \pgftransformrotate{180}
6836 \fi\fi
6837 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6838 \pgftransformrotate{90}
6839 \fi\fi
6840
6841 % draw inner symbol
6842 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6843 \pgfsetarrows{-} %never draw arrows
6844 \pgfsetlinewidth{\pgfstartlinewidth}
6845 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6846 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6847 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6848 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6849 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6850 \pgfusepath{draw}
6851
6852 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6853 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6854 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6855 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6856 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6857 \pgfusepath{draw}
6858 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6859 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6860 \pgfusepath{draw}
6861
6862 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6863 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6864 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6865 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6866 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6867 \pgfusepath{draw}
6868 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
6869 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
6870 \pgfusepath{draw}
6871 }
6872
6873 %% lowpass filter
6874 \pgfcircdeclarebipole
6875 {}
6876 {\ctikzvalof{bipoles/lowpass/width}}
6877 {lowpass}
6878 {\ctikzvalof{bipoles/lowpass/width}}
6879 {\ctikzvalof{bipoles/lowpass/width}}
6880 {
6881 \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
6882 \divide \pgf@circ@res@step by 2
6883
6884 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6885 \pgf@circ@res@other = \pgf@circ@res@left
6886 \advance\pgf@circ@res@other by \pgf@circ@res@step
6887
6888 \ifpgf@circuit@dashed
6889 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6890 \fi
6891
6892 % draw outer box
6893 \pgf@circ@twoportbox
6894
6895 \ifpgf@circuit@inputarrow
6896 {
6897 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6898 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6899 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6900 }
6901 \fi
6902
6903 % rotate inner symbol
6904 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6905 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6906 \pgftransformrotate{270}
6907 \fi\fi
6908 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6909 \pgftransformrotate{180}
6910 \fi\fi
6911 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
6912 \pgftransformrotate{90}
6913 \fi\fi
6914
6915 % draw inner symbol
6916 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6917 \pgfsetarrows{-} %never draw arrows
6918 \pgfsetlinewidth{\pgfstartlinewidth}
6919 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
6920 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6921 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6922 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6923 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6924 \pgfusepath{draw}
6925 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
6926 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
6927 \pgfusepath{draw}
6928
6929 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
6930 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6931 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6932 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6933 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6934 \pgfusepath{draw}
6935 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
6936 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
6937 \pgfusepath{draw}
6938
6939 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
6940 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6941 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6942 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
6943 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
6944 \pgfusepath{draw}
6945 }
6946
6947 %% ADC
6948 \pgfcircdeclarebipole
6949 {}
6950 {\ctikzvalof{bipoles/adc/width}}
6951 {adc}
6952 {\ctikzvalof{bipoles/adc/width}}
6953 {\ctikzvalof{bipoles/adc/width}}
6954 {
6955 \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
6956 \divide \pgf@circ@res@step by 2
6957
6958 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6959 \pgf@circ@res@other = \pgf@circ@res@left
6960 \advance\pgf@circ@res@other by \pgf@circ@res@step
6961
6962 \ifpgf@circuit@dashed
6963 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
6964 \fi
6965
6966 % draw outer box
6967 \pgf@circ@twoportbox
6968
6969 \ifpgf@circuit@inputarrow
6970 {
6971 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
6972 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6973 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
6974 }
6975 \fi
6976
6977 % rotate inner symbol
6978 \def\texti{A}
6979 \def\textii{D}
6980 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
6981 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
6982 \def\texti{D}
6983 \def\textii{A}
6984 \pgftransformrotate{270}
6985 \fi\fi
6986 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
6987 \def\texti{D}
6988 \def\textii{A}
6989 \pgftransformrotate{180}
6990 \fi\fi
6991 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
6992 \pgftransformrotate{90}
6993 \def\texti{A}
6994 \def\textii{D}
6995 \fi\fi
6996
6997 % draw inner symbol
6998 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
6999 \pgfsetarrows{-} %never draw arrows
7000 \pgfsetlinewidth{\pgfstartlinewidth}
7001 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7002 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7003 \pgfusepath{draw}
7004
7005 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
7006 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
7007 }
7008
7009 %% DAC
7010 \pgfcircdeclarebipole
7011 {}
7012 {\ctikzvalof{bipoles/dac/width}}
7013 {dac}
7014 {\ctikzvalof{bipoles/dac/width}}
7015 {\ctikzvalof{bipoles/dac/width}}
7016 {
7017 \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
7018 \divide \pgf@circ@res@step by 2
7019
7020 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7021 \pgf@circ@res@other = \pgf@circ@res@left
7022 \advance\pgf@circ@res@other by \pgf@circ@res@step
7023
7024 \ifpgf@circuit@dashed
7025 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7026 \fi
7027
7028 % draw outer box
7029 \pgf@circ@twoportbox
7030
7031 \ifpgf@circuit@inputarrow
7032 {
7033 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7034 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7035 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7036 }
7037 \fi
7038
7039 % rotate inner symbol
7040 \def\texti{D}
7041 \def\textii{A}
7042 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7043 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7044 \def\texti{A}
7045 \def\textii{D}
7046 \pgftransformrotate{270}
7047 \fi\fi
7048 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7049 \def\texti{A}
7050 \def\textii{D}
7051 \pgftransformrotate{180}
7052 \fi\fi
7053 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7054 \pgftransformrotate{90}
7055 \def\texti{D}
7056 \def\textii{A}
7057 \fi\fi
7058
7059 % draw inner symbol
7060 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7061 \pgfsetarrows{-} %never draw arrows
7062 \pgfsetlinewidth{\pgfstartlinewidth}
7063 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7064 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7065 \pgfusepath{draw}
7066
7067 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
7068 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
7069 }
7070
7071 %% DSP
7072 \pgfcircdeclarebipole
7073 {}
7074 {\ctikzvalof{bipoles/dsp/width}}
7075 {dsp}
7076 {\ctikzvalof{bipoles/dsp/width}}
7077 {\ctikzvalof{bipoles/dsp/width}}
7078 {
7079 \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
7080 \divide \pgf@circ@res@step by 2
7081
7082 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7083 \pgf@circ@res@other = \pgf@circ@res@left
7084 \advance\pgf@circ@res@other by \pgf@circ@res@step
7085
7086 \ifpgf@circuit@dashed
7087 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7088 \fi
7089
7090 % draw outer box
7091 \pgf@circ@twoportbox
7092
7093 \ifpgf@circuit@inputarrow
7094 {
7095 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7096 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7097 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7098 }
7099 \fi
7100
7101 % rotate inner symbol
7102 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7103 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7104 \pgftransformrotate{270}
7105 \fi\fi
7106 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7107 \pgftransformrotate{180}
7108 \fi\fi
7109 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7110 \pgftransformrotate{90}
7111 \fi\fi
7112
7113 % draw inner symbol
7114 \pgftext[center,x=0,y=0]{\textsf{DSP}}
7115 }
7116
7117 %% FFT
7118 \pgfcircdeclarebipole
7119 {}
7120 {\ctikzvalof{bipoles/fft/width}}
7121 {fft}
7122 {\ctikzvalof{bipoles/fft/width}}
7123 {\ctikzvalof{bipoles/fft/width}}
7124 {
7125 \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
7126 \divide \pgf@circ@res@step by 2
7127
7128 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7129 \pgf@circ@res@other = \pgf@circ@res@left
7130 \advance\pgf@circ@res@other by \pgf@circ@res@step
7131
7132 \ifpgf@circuit@dashed
7133 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7134 \fi
7135
7136 % draw outer box
7137 \pgf@circ@twoportbox
7138
7139 \ifpgf@circuit@inputarrow
7140 {
7141 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7142 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7143 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7144 }
7145 \fi
7146
7147 % rotate inner symbol
7148 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7149 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7150 \pgftransformrotate{270}
7151 \fi\fi
7152 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7153 \pgftransformrotate{180}
7154 \fi\fi
7155 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7156 \pgftransformrotate{90}
7157 \fi\fi
7158
7159 % draw inner symbol
7160 \pgftext[center,x=0,y=0]{\textsf{FFT}}
7161 }
7162
7163 %% Amplifier
7164 \pgfcircdeclarebipole
7165 {}
7166 {
7167 \ifpgf@circuit@boxed
7168 \ctikzvalof{bipoles/twoport/width}
7169 \else
7170 \ctikzvalof{bipoles/amp/width}
7171 \fi
7172 }
7173 {amp}
7174 {
7175 \ifpgf@circuit@boxed
7176 \ctikzvalof{bipoles/twoport/width}
7177 \else
7178 \ctikzvalof{bipoles/amp/width}
7179 \fi
7180 }
7181 {
7182 \ifpgf@circuit@boxed
7183 \ctikzvalof{bipoles/twoport/width}
7184 \else
7185 \ctikzvalof{bipoles/amp/width}
7186 \fi
7187 }
7188 {
7189 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen
7190
7191 \ifpgf@circuit@dashed
7192 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7193 \fi
7194
7195 % draw outer box
7196 \ifpgf@circuit@boxed
7197 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7198 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
7199 \pgf@circ@draworfill
7200 \fi
7201
7202 % draw input arrow
7203 \ifpgf@circuit@inputarrow
7204 {
7205 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7206 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7207 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7208 }
7209 \fi
7210
7211 \ifpgf@circuit@boxed
7212 \pgfsetlinewidth{\pgfstartlinewidth}
7213 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
7214 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
7215 \else
7216 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7217 \fi
7218
7219 \pgfsetarrows{-} %never draw arrows
7220 \pgfsetlinewidth{\pgfstartlinewidth}
7221
7222 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
7223 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
7224 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
7225
7226 \pgfpathclose
7227 \pgf@circ@draworfill
7228
7229 % draw inner text
7230 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
7231 }
7232
7233
7234 %% variable amplifier
7235 \pgfcircdeclarebipole
7236 {}
7237 {
7238 \ifpgf@circuit@boxed
7239 \ctikzvalof{bipoles/twoport/width}
7240 \else
7241 \ctikzvalof{bipoles/amp/width}
7242 \fi
7243 }
7244 {vamp}
7245 {
7246 \ifpgf@circuit@boxed
7247 \ctikzvalof{bipoles/twoport/width}
7248 \else
7249 \ctikzvalof{bipoles/amp/width}
7250 \fi
7251 }
7252 {
7253 \ifpgf@circuit@boxed
7254 \ctikzvalof{bipoles/twoport/width}
7255 \else
7256 \ctikzvalof{bipoles/amp/width}
7257 \fi
7258 }
7259 {
7260 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen
7261
7262 \ifpgf@circuit@dashed
7263 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7264 \fi
7265
7266 % draw outer box
7267 \ifpgf@circuit@boxed
7268 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
7269 \fi
7270
7271 % draw input arrow
7272 \ifpgf@circuit@inputarrow
7273 {
7274 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7275 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7276 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7277 }
7278 \fi
7279
7280 \ifpgf@circuit@boxed
7281 \pgfsetlinewidth{\pgfstartlinewidth}
7282 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
7283 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
7284 \else
7285 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7286 \fi
7287
7288
7289 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7290 \pgfsetarrows{-} %never draw arrows
7291 \pgfsetlinewidth{\pgfstartlinewidth}
7292
7293 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
7294 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
7295 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
7296
7297 \pgfpathclose
7298 \pgf@circ@draworfill
7299
7300 % draw inner text
7301 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
7302
7303 % draw arrow
7304 \pgfsetlinewidth{\pgfstartlinewidth}
7305 \pgfsetarrowsend{latex}
7306 \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7307 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
7308 \pgfusepath{draw}
7309 }
7310
7311 %% pi attenuator
7312 \pgfcircdeclarebipole
7313 {}
7314 {\ctikzvalof{bipoles/piattenuator/width}}
7315 {piattenuator}
7316 {\ctikzvalof{bipoles/piattenuator/width}}
7317 {\ctikzvalof{bipoles/piattenuator/width}}
7318 {
7319 \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
7320 \divide \pgf@circ@res@step by 2
7321
7322 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7323 \pgf@circ@res@other = \pgf@circ@res@left
7324 \advance\pgf@circ@res@other by \pgf@circ@res@step
7325
7326 \ifpgf@circuit@dashed
7327 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7328 \fi
7329
7330 % draw outer box
7331 \pgf@circ@twoportbox
7332
7333 \ifpgf@circuit@inputarrow
7334 {
7335 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7336 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7337 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7338 }
7339 \fi
7340
7341 % rotate inner symbol
7342 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7343 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7344 \pgftransformrotate{270}
7345 \fi\fi
7346 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7347 \pgftransformrotate{90}
7348 \fi\fi
7349
7350 % draw inner symbol
7351 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7352 \pgfsetarrows{-} %never draw arrows
7353 \pgfsetlinewidth{\pgfstartlinewidth}
7354 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
7355 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7356 \pgfusepath{draw}
7357 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
7358 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7359 \pgfusepath{draw}
7360 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7361 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7362 \pgfusepath{draw}
7363 }
7364
7365 %% variable pi attenuator
7366 \pgfcircdeclarebipole
7367 {}
7368 {\ctikzvalof{bipoles/vpiattenuator/width}}
7369 {vpiattenuator}
7370 {\ctikzvalof{bipoles/vpiattenuator/width}}
7371 {\ctikzvalof{bipoles/vpiattenuator/width}}
7372 {
7373 \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
7374 \divide \pgf@circ@res@step by 2
7375
7376 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7377 \pgf@circ@res@other = \pgf@circ@res@left
7378 \advance\pgf@circ@res@other by \pgf@circ@res@step
7379
7380 \ifpgf@circuit@dashed
7381 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7382 \fi
7383
7384 % draw outer box
7385 \pgf@circ@twoportbox
7386
7387 \ifpgf@circuit@inputarrow
7388 {
7389 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7390 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7391 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7392 }
7393 \fi
7394
7395 % rotate inner symbol
7396 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7397 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7398 \pgftransformrotate{270}
7399 \fi\fi
7400 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7401 \pgftransformrotate{90}
7402 \fi\fi
7403
7404 % draw inner symbol
7405 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7406 \pgfsetarrows{-} %never draw arrows
7407 \pgfsetlinewidth{\pgfstartlinewidth}
7408 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
7409 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7410 \pgfusepath{draw}
7411 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
7412 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7413 \pgfusepath{draw}
7414 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7415 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7416 \pgfusepath{draw}
7417
7418 \pgfsetarrowsend{latex}
7419 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7420 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
7421 \pgfusepath{draw}
7422 }
7423
7424 %% T attenuator
7425 \pgfcircdeclarebipole
7426 {}
7427 {\ctikzvalof{bipoles/tattenuator/width}}
7428 {tattenuator}
7429 {\ctikzvalof{bipoles/tattenuator/width}}
7430 {\ctikzvalof{bipoles/tattenuator/width}}
7431 {
7432 \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
7433 \divide \pgf@circ@res@step by 2
7434
7435 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7436 \pgf@circ@res@other = \pgf@circ@res@left
7437 \advance\pgf@circ@res@other by \pgf@circ@res@step
7438
7439 \ifpgf@circuit@dashed
7440 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7441 \fi
7442
7443 % draw outer box
7444 \pgf@circ@twoportbox
7445
7446 \ifpgf@circuit@inputarrow
7447 {
7448 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7449 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7450 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7451 }
7452 \fi
7453
7454 % rotate inner symbol
7455 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7456 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7457 \pgftransformrotate{270}
7458 \fi\fi
7459 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7460 \pgftransformrotate{90}
7461 \fi\fi
7462
7463 % draw inner symbol
7464 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7465 \pgfsetarrows{-} %never draw arrows
7466 \pgfsetlinewidth{\pgfstartlinewidth}
7467 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
7468 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
7469 \pgfusepath{draw}
7470 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7471 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7472 \pgfusepath{draw}
7473 }
7474
7475 %% variable T attenuator
7476 \pgfcircdeclarebipole
7477 {}
7478 {\ctikzvalof{bipoles/vtattenuator/width}}
7479 {vtattenuator}
7480 {\ctikzvalof{bipoles/vtattenuator/width}}
7481 {\ctikzvalof{bipoles/vtattenuator/width}}
7482 {
7483 \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
7484 \divide \pgf@circ@res@step by 2
7485
7486 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7487 \pgf@circ@res@other = \pgf@circ@res@left
7488 \advance\pgf@circ@res@other by \pgf@circ@res@step
7489
7490 \ifpgf@circuit@dashed
7491 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7492 \fi
7493
7494 % draw outer box
7495 \pgf@circ@twoportbox
7496
7497 \ifpgf@circuit@inputarrow
7498 {
7499 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7500 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7501 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7502 }
7503 \fi
7504
7505 % rotate inner symbol
7506 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7507 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7508 \pgftransformrotate{270}
7509 \fi\fi
7510 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7511 \pgftransformrotate{90}
7512 \fi\fi
7513
7514 % draw inner symbol
7515 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7516 \pgfsetarrows{-} %never draw arrows
7517 \pgfsetlinewidth{\pgfstartlinewidth}
7518 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
7519 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
7520 \pgfusepath{draw}
7521 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7522 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7523 \pgfusepath{draw}
7524
7525 \pgfsetarrowsend{latex}
7526 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7527 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
7528 \pgfusepath{draw}
7529 }
7530
7531 %% phase shifter
7532 \pgfcircdeclarebipole
7533 {}
7534 {\ctikzvalof{bipoles/phaseshifter/width}}
7535 {phaseshifter}
7536 {\ctikzvalof{bipoles/phaseshifter/width}}
7537 {\ctikzvalof{bipoles/phaseshifter/width}}
7538 {
7539 \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
7540 \divide \pgf@circ@res@step by 2
7541
7542 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7543 \pgf@circ@res@other = \pgf@circ@res@left
7544 \advance\pgf@circ@res@other by \pgf@circ@res@step
7545
7546 \ifpgf@circuit@dashed
7547 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7548 \fi
7549
7550 % draw outer box
7551 \pgf@circ@twoportbox
7552
7553 \ifpgf@circuit@inputarrow
7554 {
7555 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7556 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7557 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7558 }
7559 \fi
7560
7561 % rotate inner symbol
7562 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7563 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7564 \pgftransformrotate{270}
7565 \fi\fi
7566 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7567 \pgftransformrotate{180}
7568 \fi\fi
7569 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7570 \pgftransformrotate{90}
7571 \fi\fi
7572
7573 % inner symbol
7574 \pgftext[center,x=0,y=0]{\Large$\varphi$}
7575 }
7576
7577 %% variable phase shifter
7578 \pgfcircdeclarebipole
7579 {}
7580 {\ctikzvalof{bipoles/phaseshifter/width}}
7581 {vphaseshifter}
7582 {\ctikzvalof{bipoles/vphaseshifter/width}}
7583 {\ctikzvalof{bipoles/vphaseshifter/width}}
7584 {
7585 \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
7586 \divide \pgf@circ@res@step by 2
7587
7588 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7589 \pgf@circ@res@other = \pgf@circ@res@left
7590 \advance\pgf@circ@res@other by \pgf@circ@res@step
7591
7592 \ifpgf@circuit@dashed
7593 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7594 \fi
7595
7596 % draw outer box
7597 \pgf@circ@twoportbox
7598
7599 \ifpgf@circuit@inputarrow
7600 {
7601 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7602 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7603 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7604 }
7605 \fi
7606
7607 % rotate inner symbol
7608 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7609 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7610 \pgftransformrotate{270}
7611 \fi\fi
7612 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7613 \pgftransformrotate{180}
7614 \fi\fi
7615 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7616 \pgftransformrotate{90}
7617 \fi\fi
7618
7619 % inner symbol
7620 \pgftext[center,x=0,y=0]{\Large$\varphi$}
7621
7622 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7623 \pgfsetlinewidth{\pgfstartlinewidth}
7624 \pgfsetarrowsend{latex}
7625 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
7626 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
7627 \pgfusepath{draw}
7628 }
7629
7630 %% detector
7631 \pgfcircdeclarebipole
7632 {}
7633 {\ctikzvalof{bipoles/detector/width}}
7634 {detector}
7635 {\ctikzvalof{bipoles/detector/width}}
7636 {\ctikzvalof{bipoles/detector/width}}
7637 {
7638 \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
7639 \divide \pgf@circ@res@step by 2
7640
7641 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7642 \pgf@circ@res@other = \pgf@circ@res@left
7643 \advance\pgf@circ@res@other by \pgf@circ@res@step
7644
7645 \ifpgf@circuit@dashed
7646 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7647 \fi
7648
7649 % draw outer box
7650 \pgf@circ@twoportbox
7651
7652 \ifpgf@circuit@inputarrow
7653 {
7654 \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
7655 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7656 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7657 }
7658 \fi
7659
7660 % draw inner stuff
7661 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7662 \pgfsetarrows{-} %never draw arrows
7663 \pgfsetlinewidth{0.8\pgfstartlinewidth}
7664 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
7665 \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
7666 \pgfusepath{draw}
7667
7668 \ifpgf@circuit@fulldiode
7669 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width}}
7670 \pgftransformscale{\pgfmathresult}
7671 \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
7672 \else
7673 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
7674 \pgftransformscale{\pgfmathresult}
7675 \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
7676 \fi
7677
7678 }
7679
7680
7681
7682
7683 %% european gas filled surge arrester
7684
7685 \pgfcircdeclarebipole
7686 {}
7687 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
7688 {european gas filled surge arrester}
7689 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
7690 {\ctikzvalof{bipoles/european gas filled surge arrester/width}}
7691 {
7692
7693 %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
7694 %\divide \pgf@circ@res@step by 14
7695
7696 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7697 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7698
7699 \pgf@circ@draworfill
7700
7701 \pgfscope
7702 \pgfsetarrowsend{latexslim}
7703 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7704 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
7705 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7706 \pgfusepath{draw}
7707
7708 \endpgfscope
7709 }
7710
7711
7712
7713
7714 %% american gas filled surge arrester
7715
7716 \pgfcircdeclarebipole
7717 {}
7718 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
7719 {american gas filled surge arrester}
7720 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
7721 {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
7722
7723 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7724 \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
7725 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7726 \pgfusepath{draw}
7727
7728 \pgfscope
7729 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7730 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
7731 \pgf@circ@draworfill
7732 \endpgfscope
7733
7734 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
7735 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7736 \pgfusepath{draw}
7737
7738 \pgfscope
7739 \pgfsetarrowsend{latex}
7740
7741 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7742 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
7743 \pgfusepath{draw}
7744
7745 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7746 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
7747 \pgfusepath{draw}
7748 \endpgfscope{}
7749
7750 \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}
7751 \pgfusepath{fill}
7752 }
7753
7754 % % MECHANICAL SYMBOLS
7755
7756 %% mechanical capacitance - stiffness/spring
7757
7758 \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spring/height}}{spring}{\ctikzvalof{bipoles/spring/height}}{\ctikzvalof{bipoles/spring/width}}{
7759 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7760 \pgftransformationadjustments
7761
7762 \pgfmathsetlength{\pgf@circ@res@step}
7763 {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
7764
7765 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
7766 \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
7767 \pgf@circ@res@other = \pgf@circ@res@left
7768 \advance\pgf@circ@res@other by \pgf@circ@res@step
7769 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7770 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7771 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7772 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7773 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7774 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7775 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7776 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7777 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7778 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7779 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7780 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7781 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
7782 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7783 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
7784 \advance\pgf@circ@res@other by \pgf@circ@res@step
7785 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7786 \pgfsetbuttcap
7787 \pgfsetbeveljoin
7788 \pgfusepath{stroke}
7789 }
7790
7791 %% mechanical inductance - mass
7792 \pgfcircdeclarebipole
7793 {}
7794 {\ctikzvalof{bipoles/mass/box height}}
7795 {mass}
7796 {\ctikzvalof{bipoles/mass/height}}
7797 {\ctikzvalof{bipoles/mass/width}}
7798 {
7799 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7800 \pgftransformationadjustments
7801 \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7802 {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
7803 \pgf@circ@draworfill
7804
7805 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7806 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7807 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7808 \pgfsetrectcap
7809 \pgfsetmiterjoin
7810 \pgfusepath{stroke}
7811 }
7812
7813 %% mechanical resistor - damper
7814 \pgfcircdeclarebipole
7815 {}
7816 {\ctikzvalof{bipoles/damper/height}}
7817 {damper}
7818 {\ctikzvalof{bipoles/damper/height}}
7819 {\ctikzvalof{bipoles/damper/width}}
7820 {
7821 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7822 \pgf@circ@maybefill
7823
7824 % line into the damper
7825 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7826 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7827 {\pgf@circ@res@zero}}
7828 \pgfusepath{stroke}
7829
7830 % damper box
7831 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7832 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7833 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7834 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7835 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7836
7837 \pgfsetrectcap
7838 \pgfsetmiterjoin
7839 \pgfusepath{stroke}
7840
7841 % damper vertical element
7842 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7843 {.8\pgf@circ@res@down}}
7844 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7845 {.8\pgf@circ@res@up}}
7846 \pgfsetbuttcap
7847 \pgfusepath{stroke}
7848
7849 }
7850 %% mechanical viscoelastic element, suggested by @alex
7851 %% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
7852 \pgfcircdeclarebipole
7853 {} % extra anchors
7854 {\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
7855 {viscoe} % name
7856 {\ctikzvalof{bipoles/damper/height}} % height (above the path line)
7857 {\ctikzvalof{bipoles/damper/width}} % width
7858 { % draw the bipole
7859 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7860 \pgf@circ@maybefill
7861
7862 % spring into the damper
7863 \pgfscope
7864 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7865 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7866 \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
7867 \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
7868 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
7869 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
7870 \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
7871 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
7872 \pgfusepath{stroke}
7873 \endpgfscope
7874 % damper box
7875 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7876 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7877 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7878 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7879 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7880
7881 \pgfsetrectcap
7882 \pgfsetmiterjoin
7883 \pgfusepath{stroke}
7884
7885 % damper vertical element
7886 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7887 {.8\pgf@circ@res@down}}
7888 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
7889 {.8\pgf@circ@res@up}}
7890 \pgfsetbuttcap
7891 \pgfusepath{stroke}
7892
7893 }
7894
7895
7896 \pgfcircdeclarebipole
7897 {% anchor for labelling the type of dependency
7898 \anchor{label}{%
7899 \southwest
7900 \pgf@x=0.4\pgf@x
7901 }%
7902 }
7903 {\ctikzvalof{bipoles/resistivesens/height}}
7904 {resistivesens}
7905 {\ctikzvalof{bipoles/resistivesens/height}}
7906 {\ctikzvalof{bipoles/resistivesens/width}}
7907 {%
7908 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
7909 \pgftransformationadjustments
7910 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
7911 \divide \pgf@circ@res@step by 12
7912
7913 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
7914
7915 \pgf@circ@res@other = \pgf@circ@res@left
7916 \advance\pgf@circ@res@other by \pgf@circ@res@step
7917 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7918 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7919 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7920 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7921 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7922 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7923 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7924 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7925 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
7926 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
7927 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
7928 \advance\pgf@circ@res@other by \pgf@circ@res@step
7929 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
7930 \pgfsetbeveljoin
7931 \pgfusepath{draw}
7932
7933 \pgfscope
7934 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
7935 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
7936 \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
7937 \pgfusepath{draw}
7938 \endpgfscope
7939 }
7940
7941 %% crossing bipole (but see also nodes)
7942 \pgfcircdeclarebipole
7943 {}
7944 {\ctikzvalof{bipoles/crossing/size}}
7945 {crossing}
7946 {\ctikzvalof{bipoles/crossing/size}}
7947 {\ctikzvalof{bipoles/crossing/size}}{
7948 \pgfscope
7949 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7950 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
7951 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
7952 \pgfsetbeveljoin
7953 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7954 \pgfusepath{draw}
7955 \endpgfscope
7956 }
7957
7958 %% loudspeaker and microphone
7959
7960 \pgfcircdeclarebipole
7961 {}
7962 {\ctikzvalof{bipoles/loudspeaker/depth}}
7963 {loudspeaker}
7964 {\ctikzvalof{bipoles/loudspeaker/height}}
7965 {\ctikzvalof{bipoles/loudspeaker/width}}{
7966
7967 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
7968 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7969 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
7970 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
7971 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
7972 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
7973 \pgfpathclose
7974 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
7975 \pgf@circ@draworfill
7976 }
7977
7978 \pgfcircdeclarebipole
7979 {}
7980 {\ctikzvalof{bipoles/mic/depth}}
7981 {mic}
7982 {\ctikzvalof{bipoles/mic/height}}
7983 {\ctikzvalof{bipoles/mic/width}}{
7984
7985 \pgfscope
7986 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
7987 \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
7988 \pgf@circ@draworfill
7989 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
7990 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
7991 \pgfusepath{draw}
7992 \endpgfscope
7993 \pgfscope
7994 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7995 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
7996 % 0.25358 is 0.6-0.4*cos(30)
7997 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
7998 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
7999 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
8000 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8001 \pgfusepath{draw}
8002
8003 \pgfusepath{draw}
8004 \endpgfscope
8005 }
8006
8007 % generic round meter with always horizontal text, no arrow
8008 \pgfcircdeclarebipole
8009 {}
8010 {\ctikzvalof{bipoles/esource/height}}
8011 {rmeter}
8012 {\ctikzvalof{bipoles/esource/height}}
8013 {\ctikzvalof{bipoles/esource/width}}
8014 {
8015 \pgfpointorigin
8016 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
8017 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
8018 \pgf@circ@draworfill
8019 % draw the text label
8020 % get the rotation
8021 \pgfgettransformentries\a\b\temp\temp\temp\temp
8022 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
8023 % and unrotate the scope
8024 \pgfscope
8025 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8026 \pgftransformrotate{\rot}
8027 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
8028 \endpgfscope
8029 }
8030
8031 % generic round meter with always horizontal text, with arrow
8032 \pgfcircdeclarebipole
8033 {}
8034 {\ctikzvalof{bipoles/esource/height}}
8035 {rmeterwa}
8036 {\ctikzvalof{bipoles/esource/height}}
8037 {\ctikzvalof{bipoles/esource/width}}
8038 {
8039 \pgfpointorigin
8040 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
8041 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
8042 \pgf@circ@draworfill
8043 % draw the text label
8044 % get the rotation
8045 \pgfgettransformentries\a\b\temp\temp\temp\temp
8046 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
8047 % and unrotate the scope
8048 \pgfscope
8049 \pgftransformrotate{\rot}
8050 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8051 \pgfsetlinewidth{\pgfstartlinewidth}
8052 % arrow: create a center hole to have better visual
8053 \pgfscope
8054 % clipping path: first a rectangle bigger then the shape
8055 % to avoid problems with the line thickness
8056 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
8057 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
8058 % next open a circle into it
8059 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
8060 % do the difference and clip before drawing
8061 \pgfseteorule
8062 \pgfusepath{clip}
8063 \pgfsetarrowsend{latexslim}
8064 % the arrow is better if it has a bit of breath and it's not 45º
8065 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
8066 \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
8067 \pgfusepath{draw}
8068 \endpgfscope
8069 \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
8070 \endpgfscope
8071 }
8072
8073 % generic square meter with always horizontal text
8074 \pgfcircdeclarebipole
8075 {
8076 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
8077 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
8078 % put the node text above and centered
8079 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
8080 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
8081 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
8082 }
8083 }
8084 }
8085 {\ctikzvalof{bipoles/smeter/height}}
8086 {smeter}
8087 {\ctikzvalof{bipoles/smeter/height}}
8088 {\ctikzvalof{bipoles/smeter/width}}
8089 {
8090 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
8091 \pgfextracty{\pgf@circ@res@up}{\northeast}
8092 \pgfextractx{\pgf@circ@res@right}{\northeast}
8093 \pgfextractx{\pgf@circ@res@left}{\southwest}
8094 \pgfextracty{\pgf@circ@res@down}{\southwest}
8095 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
8096 \pgfscope
8097 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
8098 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8099 \pgf@circ@draworfill
8100 \endpgfscope
8101 % get the rotation
8102 \pgfgettransformentries\a\b\temp\temp\temp\temp
8103 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
8104 % and unrotate the scope
8105 \pgfscope
8106 \pgftransformrotate{\rot}
8107 % the metering window
8108 \pgfscope
8109 \def\@starta{105}\def\@stopa{75}
8110 \pgfsetlinewidth{\pgfstartlinewidth}
8111 \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
8112 \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
8113 \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
8114 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
8115 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
8116 \pgfclosepath
8117 \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
8118 \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
8119 \pgfusepath{draw}
8120 \endpgfscope
8121 \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
8122 \endpgfscope
8123 }
8124
8125 % probles qucs style:
8126 % #1 : name
8127 % #2 : extra code
8128 \long\def\pgfcirc@qucsprobe#1#2{
8129 \pgfcircdeclarebipole
8130 {
8131 \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
8132 \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
8133 % put the node text above and centered
8134 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
8135 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
8136 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
8137 }
8138 }
8139 }
8140 {\ctikzvalof{bipoles/qmeter/depth}}
8141 {#1}
8142 {\ctikzvalof{bipoles/qmeter/height}}
8143 {\ctikzvalof{bipoles/qmeter/width}}
8144 {
8145 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
8146 \pgfextracty{\pgf@circ@res@up}{\northeast}
8147 \pgfextractx{\pgf@circ@res@right}{\northeast}
8148 \pgfextractx{\pgf@circ@res@left}{\southwest}
8149 \pgfextracty{\pgf@circ@res@down}{\southwest}
8150 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
8151 \pgfscope
8152 \pgfscope
8153 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
8154 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8155 \pgf@circ@draworfill
8156 \endpgfscope
8157 \def\@starta{103}\def\@stopa{77}
8158 \pgfsetlinewidth{\pgfstartlinewidth}
8159 \pgfscope
8160 \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
8161 \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
8162 \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
8163 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
8164 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
8165 \pgfclosepath
8166 \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
8167 \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
8168 \pgfusepath{draw}
8169 \pgf@circ@draworfill
8170 \endpgfscope
8171 #2
8172 \endpgfscope
8173 }
8174 }
8175
8176 \pgfcirc@qucsprobe{qiprobe}{
8177 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8178 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8179 \pgfusepath{draw}
8180 \pgfnode{currarrow}{center}{}{}{}
8181 }
8182
8183 \pgfcirc@qucsprobe{qvprobe}{
8184 \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
8185 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8186 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
8187 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
8188 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
8189 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8190 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
8191 \pgfusepath{draw}
8192 \pgfscope
8193 % "+" and "-", drawn so that they scale correctly
8194 \pgfsetlinewidth{2\pgfstartlinewidth}
8195 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
8196 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
8197 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
8198 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
8199 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
8200 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
8201 \pgfusepath{draw}
8202 \endpgfscope
8203 }
8204
8205 \pgfcirc@qucsprobe{qpprobe}{
8206 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8207 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8208 \pgfusepath{draw}
8209 \pgfnode{currarrow}{center}{}{}{}
8210 \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
8211 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
8212 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
8213 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
8214 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
8215 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
8216 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
8217 \pgfusepath{draw}
8218 \pgfscope
8219 % "+" and "-", drawn so that they scale correctly
8220 \pgfsetlinewidth{2\pgfstartlinewidth}
8221 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
8222 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
8223 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
8224 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
8225 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
8226 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
8227 \pgfusepath{draw}
8228 \endpgfscope
8229 }
8230
8231
8232 % current loop for oscope and similar: stylized
8233
8234 \pgfcircdeclarebipole
8235 {
8236 \anchor{i}{\northeast\pgf@x=0pt\relax}
8237 \anchor{text}{
8238 \pgfextracty{\pgf@circ@res@up}{\northeast}
8239 \pgfextractx{\pgf@circ@res@left}{\northeast}
8240 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
8241 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
8242 }
8243 }
8244 }
8245 {\ctikzvalof{bipoles/iloop/height}}
8246 {iloop}
8247 {\ctikzvalof{bipoles/iloop/height}}
8248 {\ctikzvalof{bipoles/iloop/width}}
8249 {
8250 \pgfextracty{\pgf@circ@res@up}{\northeast}
8251 \pgfextractx{\pgf@circ@res@right}{\northeast}
8252 \pgf@circ@res@down=-\pgf@circ@res@up
8253 \pgf@circ@res@left=-\pgf@circ@res@right
8254 \pgfscope
8255 \pgfstartlinewidth=\pgflinewidth
8256 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8257 % external ellipse
8258 \pgfscope
8259 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
8260 % clipping path: first a rectangle bigger then the shape
8261 % to avoid problems with the line thickness
8262 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
8263 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
8264 % next the opening to the left
8265 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
8266 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
8267 % do the difference and clip before drawing
8268 \pgfseteorule
8269 \pgfusepath{clip}
8270 \pgfpathellipse{\pgfpointorigin}{
8271 \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
8272 \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
8273 \pgfusepath{draw}
8274 \endpgfscope
8275 % internal wire
8276 \pgfsetlinewidth{\pgfstartlinewidth}
8277 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8278 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
8279 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
8280 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8281 % and the contact line up
8282 \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
8283 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
8284 \pgfusepath{draw}
8285 \endpgfscope
8286 }
8287
8288
8289 % current loop for oscope and similar: real (double connection)
8290
8291 \pgfcircdeclarebipole
8292 {
8293 \anchor{i+}{
8294 \pgfextracty{\pgf@circ@res@up}{\northeast}
8295 \pgfextractx{\pgf@circ@res@right}{\northeast}
8296 \pgf@circ@res@step=0.4\pgf@circ@res@right
8297 \pgf@circ@res@other=0.8\pgf@circ@res@up
8298 \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
8299 \pgf@y=\pgf@circ@res@up
8300 }
8301 \anchor{i-}{
8302 \pgfextracty{\pgf@circ@res@up}{\northeast}
8303 \pgfextractx{\pgf@circ@res@right}{\northeast}
8304 \pgf@circ@res@step=0.4\pgf@circ@res@right
8305 \pgf@circ@res@other=0.8\pgf@circ@res@up
8306 \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
8307 \pgf@y=\pgf@circ@res@up
8308 }
8309 \anchor{text}{
8310 \pgfextracty{\pgf@circ@res@up}{\northeast}
8311 \pgfextractx{\pgf@circ@res@left}{\northeast}
8312 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
8313 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
8314 }
8315 }
8316 }
8317 {\ctikzvalof{bipoles/iloop/height}}
8318 {iloop2}
8319 {\ctikzvalof{bipoles/iloop/height}}
8320 {\ctikzvalof{bipoles/iloop/width}}
8321 {
8322 \pgfextracty{\pgf@circ@res@up}{\northeast}
8323 \pgfextractx{\pgf@circ@res@right}{\northeast}
8324 \pgf@circ@res@down=-\pgf@circ@res@up
8325 \pgf@circ@res@left=-\pgf@circ@res@right
8326 % must be the same than internal i+ and i- anchors definition
8327 \pgf@circ@res@step=0.4\pgf@circ@res@right
8328 \pgf@circ@res@other=0.8\pgf@circ@res@up
8329 \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
8330 \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
8331 \pgfscope
8332 \pgfstartlinewidth=\pgflinewidth
8333 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8334 % external ellipse
8335 \pgfscope
8336 \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
8337 % clipping path: first a rectangle bigger then the shape
8338 % to avoid problems with the line thickness
8339 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
8340 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
8341 % next the opening to the left
8342 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
8343 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
8344 % do the difference and clip before drawing
8345 \pgfseteorule
8346 \pgfusepath{clip}
8347 \pgfpathmoveto{\@plus}
8348 \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
8349 \pgfusepath{draw}
8350 \endpgfscope
8351 % internal wire
8352 \pgfsetlinewidth{\pgfstartlinewidth}
8353 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8354 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
8355 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
8356 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8357 % and the contact line up
8358 % I use ...left and ---right as temporal lengths here to avoid defining more
8359 \pgfextractx{\pgf@circ@res@left}{\@plus}
8360 \pgfextractx{\pgf@circ@res@right}{\@minus}
8361 \pgfpathmoveto{\@plus}
8362 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8363 \pgfpathmoveto{\@minus}
8364 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8365 \pgfusepath{draw}
8366 \endpgfscope
8367 }
8368
8369
8370 % end of pgfcircbipoles.tex
8371 %%%---------- close: tex/pgfcircbipoles
8372 %%%%%%%%%%% Springe nach tex/pgfcirctripoles
8373 %%%---------- open: tex/pgfcirctripoles.tex
8374 % Copyright 2007-2009 by Massimo Redaelli
8375 %
8376 % This file may be distributed and/or modified
8377 %
8378 % 1. under the LaTeX Project Public License and/or
8379 % 2. under the GNU Public License.
8380 %
8381 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
8382
8383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8384 %% Tripoles
8385
8386 \pgfdeclareshape{spdt}{
8387 \savedanchor\northwest{%
8388 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@circ@Rlen
8389 \pgf@y=.5\pgf@y
8390 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
8391 \pgf@x=.5\pgf@x
8392 }
8393 \anchor{left}{%
8394 \northwest
8395 \pgf@y=0pt
8396 }
8397 \anchor{in}{
8398 \northwest
8399 \pgf@y=0pt
8400 }
8401 \anchor{out 1}{
8402 \northwest
8403 \pgf@x=-\pgf@x
8404 }
8405 \anchor{out 2}{
8406 \northwest
8407 \pgf@x=-\pgf@x
8408 \pgf@y=-\pgf@y
8409 }
8410 \anchor{center}{
8411 \pgf@y=0pt
8412 \pgf@x=0pt
8413 }
8414 \anchor{east}{
8415 \northwest
8416 \pgf@y=0pt
8417 \pgf@x=-\pgf@x
8418 }
8419 \anchor{west}{
8420 \northwest
8421 \pgf@y=0pt
8422 }
8423 \anchor{south}{
8424 \northwest
8425 \pgf@x=0pt
8426 \pgf@y=-\pgf@y
8427 }
8428 \anchor{north}{
8429 \northwest
8430 \pgf@x=0pt
8431 }
8432 \anchor{south west}{
8433 \northwest
8434 \pgf@y=-\pgf@y
8435 }
8436 \anchor{north east}{
8437 \northwest
8438 \pgf@x=-\pgf@x
8439 }
8440 \anchor{north west}{
8441 \northwest
8442 }
8443 \anchor{south east}{
8444 \northwest
8445 \pgf@x=-\pgf@x
8446 \pgf@y=-\pgf@y
8447 }
8448 \backgroundpath{
8449 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8450
8451
8452 \northwest
8453 \pgf@circ@res@up = \pgf@y
8454 \pgf@circ@res@down = -\pgf@y
8455 \pgf@circ@res@right = -\pgf@x
8456 \pgf@circ@res@left = \pgf@x
8457 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
8458
8459
8460 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8461 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8462 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8463 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8464
8465 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8466 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8467
8468 \pgfusepath{draw}
8469
8470 \pgfscope
8471 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8472 \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
8473 \endpgfscope
8474 \pgfscope
8475 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8476 \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
8477 \endpgfscope
8478 \pgfscope
8479 \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
8480 \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
8481 \endpgfscope
8482
8483
8484 \pgfscope
8485 \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
8486 \pgfpathlineto{
8487 \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
8488 {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
8489 }
8490 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8491 \pgfusepath{draw}
8492 \endpgfscope
8493 }
8494 }
8495
8496
8497 % cute switch "node" shapes, matching with cute "to" shapes
8498 % #1 -> name
8499 % #2 -> barposition
8500 % #3 -> arrowcode
8501 \long\def\pgfcircdeclarecutespdt#1#2#3{
8502 \pgfdeclareshape{#1}
8503 {
8504 \savedanchor\northwest{%
8505 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
8506 \pgf@y=.5\pgf@y
8507 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
8508 \pgf@x=.25\pgf@x
8509 }
8510 \savedanchor\midlever{
8511 % these values are calculated when we create the definition of the shape.
8512 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
8513 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
8514 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8515 \pgf@circ@res@down = -.5\pgf@y
8516 \pgf@circ@res@up = .5\pgf@y
8517 \pgfextracty{\pgf@circ@res@other}{#2}
8518 \pgf@x=0pt
8519 \pgf@y=.5\pgf@circ@res@other
8520 }
8521 % radius of the connector
8522 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8523 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
8524 % shapename
8525 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
8526 % shape type
8527 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
8528 % mid of the lever, to stack switches
8529 \anchor{mid}{\midlever}
8530 % center anchors
8531 \anchor{cin}{ \northwest \pgf@y=0pt}
8532 \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
8533 \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8534 % horizontal angles
8535 \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
8536 \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
8537 \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
8538
8539 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
8540 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
8541 \anchor{west}{ \northwest \pgf@y=0pt }
8542 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
8543 \anchor{north}{ \northwest \pgf@x=0pt }
8544 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
8545 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
8546 \anchor{north west}{ \northwest }
8547 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8548
8549 \backgroundpath{
8550 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8551 \northwest
8552 \pgf@circ@res@up = \pgf@y
8553 \pgf@circ@res@down = -\pgf@y
8554 \pgf@circ@res@right = -\pgf@x
8555 \pgf@circ@res@left = \pgf@x
8556
8557 \pgfscope
8558 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8559 \pgf@circ@res@temp=\radius\relax
8560 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8561 \pgfsetlinewidth{2\pgf@circ@res@temp}
8562 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8563 \pgfpathlineto{#2}
8564 \pgfsetroundcap\pgfusepath{draw}
8565 \endpgfscope
8566 \pgfscope % arrow
8567 #3
8568 \endpgfscope
8569 % terminals
8570 \pgfscope
8571 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8572 \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
8573 \endpgfscope
8574 \pgfscope
8575 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8576 \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
8577 \endpgfscope
8578 \pgfscope
8579 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8580 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
8581 \endpgfscope
8582
8583 }
8584 }
8585 }
8586
8587 \pgfcircdeclarecutespdt{cute spdt up}
8588 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8589 {}
8590
8591 \pgfcircdeclarecutespdt{cute spdt mid}
8592 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8593 {}
8594
8595 \pgfcircdeclarecutespdt{cute spdt down}
8596 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
8597 {}
8598
8599 \pgfcircdeclarecutespdt{cute spdt up arrow}
8600 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8601 {
8602 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8603 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8604 \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
8605 \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
8606 \pgfsetarrowsend{latexslim}
8607 \pgfusepath{draw}
8608 }
8609
8610 \pgfcircdeclarecutespdt{cute spdt mid arrow}
8611 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8612 {
8613 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8614 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8615 \pgfsetarrowsstart{latexslim}
8616 \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
8617 \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
8618 \pgfsetarrowsend{latexslim}
8619 \pgfusepath{draw}
8620 }
8621
8622 \pgfcircdeclarecutespdt{cute spdt down arrow}
8623 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
8624 {
8625 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
8626 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8627 \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
8628 \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
8629 \pgfsetarrowsend{latexslim}
8630 \pgfusepath{draw}
8631 }
8632
8633 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8635 %%
8636 %% Logic ports
8637 %%
8638 %% Code from John Kormylo at tex.stackexchange.com
8639 %% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
8640 %% Integration and fixes from Romano Giannetti and TheTeXnician <[email protected]>
8641 %%
8642
8643 \newcount\pgf@circ@res@count% reserve global register
8644
8645 \def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
8646 {%
8647 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8648 \step
8649 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8650 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8651 }%
8652
8653 % #1 = \pgfmathcounter #2=type #3 specificic port
8654 % type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
8655 \def\pgf@circ@logicport@baseinput#1#2#3%
8656 {%
8657 % and and nand
8658 \ifnum #2=1\relax
8659 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8660 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8661 \step
8662 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8663 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8664 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@left
8665 \fi
8666 % or and nor
8667 \ifnum #2=2\relax
8668 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8669 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8670 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8671 \step
8672 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8673 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8674 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/angle}}%
8675 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
8676 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8677 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8678 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
8679 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8680 \pgf@circ@res@temp=\pgf@y
8681 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8682 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8683 \pgf@x=\pgf@circ@res@other
8684 \fi
8685 % xor and xnor
8686 \ifnum #2=3\relax
8687 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8688 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8689 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8690 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
8691 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
8692 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8693 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
8694 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
8695 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8696 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/distance}\pgf@circ@res@right
8697 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
8698 % this compensates for the effect of the line width on the gap between the arcs
8699 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
8700 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
8701
8702 \step
8703 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8704 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8705 \pgf@circ@res@temp=\pgf@y
8706 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
8707 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8708 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
8709 \pgf@x=\pgf@circ@res@other
8710 \fi
8711 % european
8712 \ifnum #2=4\relax
8713 \pgfextracty{\pgf@circ@res@up}{\northeast}%
8714 \pgfextractx{\pgf@circ@res@other}{\left}%
8715 \step
8716 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
8717 \advance\pgf@y by -#1\pgf@circ@res@step\relax
8718 \pgf@x=\pgf@circ@res@other
8719 \fi
8720 }%
8721
8722 %%% american
8723 \long\def\pgfcircdeclarelogicport#1#2#3{%
8724 \pgfdeclareshape{american #1 port}%
8725 {%
8726 \savedmacro\resize{% automatic
8727 \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
8728 \pgf@circ@res@up = .5\pgf@circ@res@up
8729 \pgf@circ@res@down = -\pgf@circ@res@up
8730 \pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@circ@Rlen
8731 \pgf@circ@res@right = .5\pgf@circ@res@right
8732 \pgf@circ@res@left = -\pgf@circ@res@right
8733 }%
8734 \savedmacro\inputs{% get number of inputs
8735 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
8736 \ifnum\pgf@circ@res@count=0
8737 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/inputs}\relax%
8738 \fi
8739 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
8740 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
8741 \def\inputs{\the\pgf@circ@res@count}%
8742 }%
8743 \savedanchor\step{% 1/2 gap at edges
8744 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
8745 \divide\pgf@circ@res@step by \pgf@circ@res@count
8746 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
8747 }%
8748 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8749 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8750 \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
8751 \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
8752 \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
8753
8754 \anchor{center}{\origin}% for backwards compatibility
8755 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
8756
8757 % create input anchors
8758 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
8759 \pgfmathloop%
8760 \ifnum\pgfmathcounter>\pgf@circ@res@count%
8761 \else%
8762 %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
8763 \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
8764 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
8765 }%
8766 \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
8767 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
8768 }%
8769 %}{}%
8770 \repeatpgfmathloop%
8771 }
8772
8773 \anchor{out}{\northeast\pgf@y=0pt}
8774 \anchor{bout}{\right\pgf@y=0pt}
8775
8776
8777 \anchor{left}{\left}% edges of component mius leads
8778 \anchor{right}{\right}
8779
8780 \anchor{north east}{\northeast}% see \Compass macro
8781 \anchor{south west}{\southwest}
8782 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
8783 \pgfpoint{0cm}{\pgf@circ@res@up}}
8784 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
8785 \pgfextractx{\pgf@circ@res@left}{\southwest}%
8786 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8787 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
8788 \pgfpoint{\pgf@circ@res@left}{0cm}}
8789 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
8790 \pgfpoint{0cm}{\pgf@circ@res@down}}
8791 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
8792 \pgfextractx{\pgf@circ@res@right}{\northeast}%
8793 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8794 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
8795 \pgfpoint{\pgf@circ@res@right}{0cm}}
8796
8797 \backgroundpath{
8798 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
8799 #3
8800 }
8801 }
8802 }
8803 %%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8804 \pgfcircdeclarelogicport{and}{1}{
8805 \pgfextracty{\pgf@circ@res@temp}{\step}%
8806 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8807 \pgf@circ@res@count = \inputs\relax
8808 \loop\ifnum\pgf@circ@res@count>0
8809 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8810 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8811 \pgfpathlineto{\pgfpoint
8812 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
8813 {\pgf@circ@res@temp}}
8814 \advance\pgf@circ@res@count by -1
8815 \repeat
8816
8817 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8818 \pgfpathlineto{\pgfpoint
8819 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
8820 {0pt}}
8821
8822 \pgfusepath{draw}
8823
8824 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8825 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left
8826
8827 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8828 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8829 \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
8830 \pgfpathclose
8831 \pgf@circ@draworfill
8832 }
8833 %%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8834 \pgfcircdeclarelogicport{nand}{1}{
8835 \pgfextracty{\pgf@circ@res@temp}{\step}%
8836 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8837 \pgf@circ@res@count = \inputs\relax
8838 \loop\ifnum\pgf@circ@res@count>0
8839 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8840 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8841 \pgfpathlineto{\pgfpoint
8842 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
8843 {\pgf@circ@res@temp}}
8844 \advance\pgf@circ@res@count by -1
8845 \repeat
8846
8847 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8848 \pgfpathlineto{\pgfpoint
8849 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
8850
8851 \pgfusepath{draw}
8852
8853 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8854 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
8855 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
8856 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
8857
8858 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8859 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8860 \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
8861 \pgfpathclose
8862
8863 \pgfpathellipse
8864 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@step}{0pt}}
8865 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
8866 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
8867
8868 \pgf@circ@draworfill
8869 }
8870 %%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8871 \pgfcircdeclarelogicport{nor}{2}{
8872 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
8873 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/inner}\pgf@circ@res@right
8874 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8875 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8876 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
8877 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8878
8879 \pgfextracty{\pgf@circ@res@temp}{\step}%
8880 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8881 \pgf@circ@res@count = \inputs\relax
8882 \loop\ifnum\pgf@circ@res@count>0
8883 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8884 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8885 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8886 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8887 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8888 \advance\pgf@circ@res@count by -1
8889 \repeat
8890
8891 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
8892 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8893 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8894
8895 \pgfusepath{draw}
8896
8897 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8898
8899 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
8900 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/circle width}\pgf@circ@res@right
8901 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
8902 \advance\pgf@circ@res@other by -\pgf@circ@res@step
8903
8904 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8905 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8906 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8907 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
8908 \pgfpathclose
8909
8910 \pgfpathellipse
8911 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
8912 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
8913 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
8914
8915 \pgf@circ@draworfill
8916 }
8917 %%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8918 \pgfcircdeclarelogicport{or}{2}{
8919 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
8920 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/inner}\pgf@circ@res@right
8921 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8922 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
8923 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
8924 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8925
8926 \pgfextracty{\pgf@circ@res@temp}{\step}%
8927 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8928 \pgf@circ@res@count = \inputs\relax
8929 \loop\ifnum\pgf@circ@res@count>0
8930 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8931 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8932 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
8933 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8934 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8935 \advance\pgf@circ@res@count by -1
8936 \repeat
8937
8938 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
8939 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8940 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8941
8942 \pgfusepath{draw}
8943
8944 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8945
8946 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
8947
8948 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8949 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8950 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8951 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8952 \pgfpathclose
8953
8954 \pgf@circ@draworfill
8955 }
8956 %%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8957 \pgfcircdeclarelogicport{xor}{3}{
8958 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
8959 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/inner}\pgf@circ@res@right
8960 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
8961 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
8962 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
8963 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
8964 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
8965 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
8966 % this compensates for the effect of the line width on the gap between the arcs
8967 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
8968 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
8969
8970 \pgfextracty{\pgf@circ@res@temp}{\step}%
8971 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
8972 \pgf@circ@res@count = \inputs\relax
8973 \loop\ifnum\pgf@circ@res@count>0
8974 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
8975 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
8976 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
8977 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
8978 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
8979 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
8980 \advance\pgf@circ@res@count by -1
8981 \repeat
8982
8983 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
8984 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8985 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8986
8987 \pgfusepath{draw}
8988
8989 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
8990
8991 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/angle}}%
8992
8993 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
8994 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8995 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
8996 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
8997 \pgfpathclose
8998 \pgf@circ@draworfill
8999
9000 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9001
9002 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9003 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9004
9005 \pgfusepath{draw}
9006 }
9007 %%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9008 \pgfcircdeclarelogicport{xnor}{3}{
9009 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
9010 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/inner}\pgf@circ@res@right
9011 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9012 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9013 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
9014 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9015 \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
9016 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9017 % this compensates for the effect of the line width on the gap between the arcs
9018 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9019 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9020
9021 \pgfextracty{\pgf@circ@res@temp}{\step}%
9022 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9023 \pgf@circ@res@count = \inputs\relax
9024 \loop\ifnum\pgf@circ@res@count>0
9025 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9026 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9027 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9028 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9029 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9030 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9031 \advance\pgf@circ@res@count by -1
9032 \repeat
9033
9034 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
9035 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9036 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9037
9038 \pgfusepath{draw}
9039
9040 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9041
9042 \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/angle}}%
9043 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
9044 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9045 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9046
9047 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9048 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9049 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9050 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9051 \pgfpathclose
9052
9053 \pgfpathellipse
9054 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9055 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9056 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9057 \pgf@circ@draworfill
9058
9059 \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@left
9060 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9061
9062 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9063 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9064
9065 \pgfusepath{draw}
9066 }
9067
9068 %%% Original one-input ports
9069
9070 \pgfdeclareshape{american not port}{
9071 \anchor{center}{\pgfpointorigin}
9072 \savedanchor\northwest{%
9073 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
9074 \pgf@y=.5\pgf@y
9075 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
9076 \pgf@x=.5\pgf@x
9077 }
9078 \savedanchor\left{%
9079 \pgf@y=0pt
9080 }
9081 \anchor{in}{
9082 \northwest
9083 \pgf@y=0pt
9084 }
9085 \anchor{out}{
9086 \northwest
9087 \pgf@y=0pt
9088 \pgf@x=-\pgf@x
9089 }
9090 \anchor{center}{
9091 \pgfpointorigin
9092 }
9093 \anchor{east}{
9094 \left
9095 \pgf@x=-.8\pgf@x
9096 }
9097 \anchor{west}{
9098 \left
9099 }
9100 \anchor{south}{
9101 \northwest
9102 \pgf@x=0pt
9103 \pgf@y=-\pgf@y
9104 }
9105 \anchor{north}{
9106 \northwest
9107 \pgf@x=0pt
9108 }
9109 \anchor{south west}{
9110 \northwest
9111 \pgf@y=-\pgf@y
9112 }
9113 \anchor{north east}{
9114 \northwest
9115 \pgf@x=-\pgf@x
9116 }
9117 \anchor{north west}{
9118 \northwest
9119 }
9120 \anchor{south east}{
9121 \northwest
9122 \pgf@x=-\pgf@x
9123 \pgf@y=-\pgf@y
9124 }
9125 \backgroundpath{
9126 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9127
9128
9129 \northwest
9130 \pgf@circ@res@up = \pgf@y
9131 \pgf@circ@res@down = -\pgf@y
9132 \pgf@circ@res@right = -\pgf@x
9133 \pgf@circ@res@left = \pgf@x
9134
9135 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
9136
9137 \pgfscope
9138 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9139 \pgftransformxshift{.7\pgf@circ@res@left}
9140 \pgf@circ@res@step=\pgf@circ@res@right
9141 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9142 \pgf@circ@res@step=.7\pgf@circ@res@step
9143
9144 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9145 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9146 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9147 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9148 \pgf@circ@draworfill
9149 \pgfpathellipse
9150 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
9151 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
9152 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
9153 \pgf@circ@draworfill
9154 \endpgfscope
9155
9156 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9157 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9158
9159 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9160 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9161
9162 \pgfusepath{draw}
9163
9164 }
9165 }
9166
9167 \pgfdeclareshape{invschmitt}{
9168 \anchor{center}{\pgfpointorigin}
9169 \savedanchor\northwest{%
9170 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
9171 \pgf@y=.5\pgf@y
9172 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
9173 \pgf@x=.5\pgf@x
9174 }
9175 \savedanchor\left{%
9176 \pgf@y=0pt
9177 }
9178 \anchor{in}{
9179 \northwest
9180 \pgf@y=0pt
9181 }
9182 \anchor{out}{
9183 \northwest
9184 \pgf@y=0pt
9185 \pgf@x=-\pgf@x
9186 }
9187 \anchor{center}{
9188 \pgfpointorigin
9189 }
9190 \anchor{east}{
9191 \left
9192 \pgf@x=-.8\pgf@x
9193 }
9194 \anchor{west}{
9195 \left
9196 }
9197 \anchor{south}{
9198 \northwest
9199 \pgf@x=0pt
9200 \pgf@y=-\pgf@y
9201 }
9202 \anchor{north}{
9203 \northwest
9204 \pgf@x=0pt
9205 }
9206 \anchor{south west}{
9207 \northwest
9208 \pgf@y=-\pgf@y
9209 }
9210 \anchor{north east}{
9211 \northwest
9212 \pgf@x=-\pgf@x
9213 }
9214 \anchor{north west}{
9215 \northwest
9216 }
9217 \anchor{south east}{
9218 \northwest
9219 \pgf@x=-\pgf@x
9220 \pgf@y=-\pgf@y
9221 }
9222 \backgroundpath{
9223 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9224
9225 \northwest
9226 \pgf@circ@res@up = \pgf@y
9227 \pgf@circ@res@down = -\pgf@y
9228 \pgf@circ@res@right = -\pgf@x
9229 \pgf@circ@res@left = \pgf@x
9230
9231 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
9232
9233 \pgfscope
9234 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9235 \pgftransformxshift{.7\pgf@circ@res@left}
9236 \pgf@circ@res@step=\pgf@circ@res@right
9237 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9238 \pgf@circ@res@step=.7\pgf@circ@res@step
9239
9240 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9241 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9242 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9243 \pgfpathclose
9244 \pgf@circ@draworfill
9245 \pgfpathellipse
9246 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
9247 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
9248 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
9249 \pgf@circ@draworfill
9250 \endpgfscope
9251
9252 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9253 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9254
9255 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9256 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9257 \pgfusepath{draw}
9258 %draw inner shape
9259
9260 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9261
9262 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9263 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9264 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9265 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9266 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9267 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9268 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9269 \pgfusepath{draw}
9270
9271 }
9272 }
9273
9274 \pgfdeclareshape{schmitt}{
9275 \anchor{center}{\pgfpointorigin}
9276 \savedanchor\northwest{%
9277 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
9278 \pgf@y=.5\pgf@y
9279 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
9280 \pgf@x=.5\pgf@x
9281 }
9282 \savedanchor\left{%
9283 \pgf@y=0pt
9284 }
9285 \anchor{in}{
9286 \northwest
9287 \pgf@y=0pt
9288 }
9289 \anchor{out}{
9290 \northwest
9291 \pgf@y=0pt
9292 \pgf@x=-\pgf@x
9293 }
9294 \anchor{center}{
9295 \pgfpointorigin
9296 }
9297 \anchor{east}{
9298 \left
9299 \pgf@x=-.8\pgf@x
9300 }
9301 \anchor{west}{
9302 \left
9303 }
9304 \anchor{south}{
9305 \northwest
9306 \pgf@x=0pt
9307 \pgf@y=-\pgf@y
9308 }
9309 \anchor{north}{
9310 \northwest
9311 \pgf@x=0pt
9312 }
9313 \anchor{south west}{
9314 \northwest
9315 \pgf@y=-\pgf@y
9316 }
9317 \anchor{north east}{
9318 \northwest
9319 \pgf@x=-\pgf@x
9320 }
9321 \anchor{north west}{
9322 \northwest
9323 }
9324 \anchor{south east}{
9325 \northwest
9326 \pgf@x=-\pgf@x
9327 \pgf@y=-\pgf@y
9328 }
9329 \backgroundpath{
9330 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9331
9332
9333 \northwest
9334 \pgf@circ@res@up = \pgf@y
9335 \pgf@circ@res@down = -\pgf@y
9336 \pgf@circ@res@right = -\pgf@x
9337 \pgf@circ@res@left = \pgf@x
9338
9339 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
9340
9341 \pgfscope
9342 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9343 \pgftransformxshift{.7\pgf@circ@res@left}
9344 \pgf@circ@res@step=\pgf@circ@res@right
9345 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9346 \pgf@circ@res@step=.7\pgf@circ@res@step
9347
9348 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9349 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9350 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9351 \pgfpathclose
9352 \pgf@circ@draworfill
9353 \endpgfscope
9354
9355 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9356 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9357
9358 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9359 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
9360 \pgfusepath{draw}
9361 %draw inner shape
9362
9363 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9364
9365 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9366 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9367 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9368 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9369 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9370 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9371 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9372 \pgfusepath{draw}
9373
9374 }
9375 }
9376
9377
9378 %%% start european logic ports, from John Kormylo
9379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9380 %%
9381
9382 % #1 - name
9383 % #2 - text inside
9384 % #3 - number of inputs
9385 % #4 = is it a not?
9386
9387 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
9388 \pgfdeclareshape{european #1 port}
9389 {
9390 \savedmacro\resize{% automatic
9391 \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
9392 \pgf@circ@res@up = .5\pgf@circ@res@up
9393 \pgf@circ@res@down = -\pgf@circ@res@up
9394 \pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@circ@Rlen
9395 \pgf@circ@res@right = .5\pgf@circ@res@right
9396 \pgf@circ@res@left = -\pgf@circ@res@right
9397 }%
9398 \savedmacro\inputs{% get number of inputs
9399 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9400 \ifnum\pgf@circ@res@count=0
9401 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/inputs}\relax%
9402 \fi
9403 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9404 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9405 \def\inputs{\the\pgf@circ@res@count}%
9406 }%
9407 \savedanchor\step{% 1/2 gap at edges
9408 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
9409 \divide\pgf@circ@res@step by #3
9410 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9411 }%
9412 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
9413 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
9414 \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
9415 \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
9416 \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
9417
9418 \anchor{center}{\origin}% for backwards compatibility
9419 % the text anchor overlaps the logic symbol
9420 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
9421 % create input anchors
9422 \ifnum#3=1\relax
9423 \anchor{in}{\pgfpoint{\pgf@circ@res@left}{0pt}}% or \step
9424 \else
9425 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
9426 \pgfmathloop%
9427 \ifnum\pgfmathcounter>#3%
9428 \else%
9429 %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
9430 \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
9431 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9432 }%
9433 \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
9434 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
9435 }%
9436 %}{}%
9437 \repeatpgfmathloop%
9438 }
9439 \fi
9440 \anchor{out}{\northeast\pgf@y=0pt}
9441 \anchor{bout}{\right\pgf@y=0pt}
9442
9443 \anchor{left}{\left}% edges of component minus leads
9444 \anchor{right}{\right}
9445
9446 \anchor{north east}{\northeast}% see \Compass macro
9447 \anchor{south west}{\southwest}
9448 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9449 \pgfpoint{0cm}{\pgf@circ@res@up}}
9450 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9451 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9452 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9453 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9454 \pgfpoint{\pgf@circ@res@left}{0cm}}
9455 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9456 \pgfpoint{0cm}{\pgf@circ@res@down}}
9457 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9458 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9459 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9460 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
9461 \pgfpoint{\pgf@circ@res@right}{0cm}}
9462
9463 \backgroundpath{
9464 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9465 \pgfscope
9466 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9467 \pgfpathrectanglecorners
9468 {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
9469 {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
9470 \pgf@circ@draworfill
9471 \endpgfscope
9472 \ifnum#3=1\relax
9473 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
9474 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
9475 \else
9476 \pgfextracty{\pgf@circ@res@temp}{\step}%
9477 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9478 %\pgf@circ@res@count = #3\relax% redundant
9479 \loop\ifnum\pgf@circ@res@count>0
9480 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9481 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9482 \pgfpathlineto{\pgfpoint
9483 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
9484 {\pgf@circ@res@temp}}
9485 \advance\pgf@circ@res@count by -1
9486 \repeat
9487 \fi
9488 %
9489 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9490 \pgfpathlineto{%
9491 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
9492 %
9493 \edef\pgf@temp{not}
9494 \edef\pgf@circ@temp{#4}
9495 \ifx\pgf@temp\pgf@circ@temp % is a not
9496 \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
9497 \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}%
9498 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
9499 \fi
9500 %
9501 \pgfusepath{draw}
9502 %
9503 \pgfpathmoveto{\pgfpointorigin}
9504 \pgftext{#2}
9505 %
9506 %
9507 %
9508 }
9509 }
9510 }
9511 \pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
9512 \pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
9513 \pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
9514 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
9515 \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
9516 \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
9517 \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
9518
9519 %% end european logic ports
9520
9521 \long\def\pgfcircdeclaretransistor#1#2#3{
9522 \pgfdeclareshape{#1}
9523 {
9524 \anchor{center}{
9525 \pgfpointorigin
9526 }
9527 \savedanchor\northeast{% upper right
9528 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@circ@Rlen
9529 \pgf@y=.5\pgf@y
9530 \pgf@x=0pt
9531 }
9532 \savedanchor\left{%center left
9533 \pgf@y=0pt
9534 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@circ@Rlen
9535 }
9536 \anchor{text}{
9537 \northeast
9538 \pgf@y=.7\pgf@y
9539 \pgf@x= \pgf@circ@Rlen
9540 \pgf@x=0.1\pgf@x
9541 }
9542 \anchor{pathstart}{ % south
9543 \northeast
9544 \pgf@y=-\pgf@y
9545 }
9546 \anchor{pathend}{
9547 \northeast
9548 }
9549 \anchor{north}{
9550 \northeast
9551 \pgf@circ@res@step=\pgf@y
9552 \left
9553 \pgf@y=\pgf@circ@res@step
9554 \pgf@x=.5\pgf@x
9555 }
9556 \anchor{west}{
9557 \left
9558 }
9559 \anchor{east}{
9560 \northeast
9561 \pgf@y=0pt
9562 }
9563 \anchor{south}{
9564 \northeast
9565 \pgf@circ@res@step=\pgf@y
9566 \left
9567 \pgf@y=-\pgf@circ@res@step
9568 \pgf@x=.5\pgf@x
9569 }
9570 \anchor{south west}{
9571 \northeast
9572 \pgf@circ@res@step=\pgf@y
9573 \left
9574 \pgf@y=-\pgf@circ@res@step
9575 }
9576 \anchor{north east}{
9577 \northeast
9578 }
9579 \anchor{north west}{
9580 \northeast
9581 \pgf@circ@res@step=\pgf@y
9582 \left
9583 \pgf@y=\pgf@circ@res@step
9584 }
9585 \anchor{south east}{
9586 \northeast
9587 \pgf@y=-\pgf@y
9588 }
9589 \anchor{B}{
9590 \northeast
9591 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9592 \left
9593 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9594 }
9595 \anchor{base}{
9596 \northeast
9597 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9598 \left
9599 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9600 }
9601 \anchor{G}{
9602 \northeast
9603 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9604 \left
9605 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9606 }
9607 \anchor{gate}{
9608 \northeast
9609 \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
9610 \left
9611 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
9612 }
9613 \anchor{nobase}{
9614 \left
9615 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
9616 }
9617 \anchor{nogate}{
9618 \left
9619 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x
9620 }
9621 \anchor{E}{
9622 \northeast
9623 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9624 }
9625 \anchor{emitter}{
9626 \northeast
9627 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9628 }
9629 \anchor{C}{
9630 \northeast
9631 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9632 }
9633 \anchor{collector}{
9634 \northeast
9635 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9636 }
9637 \anchor{S}{
9638 \northeast
9639 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9640 }
9641 \anchor{source}{
9642 \northeast
9643 \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9644 }
9645 \anchor{D}{
9646 \northeast
9647 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9648 }
9649 \anchor{drain}{
9650 \northeast
9651 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
9652 }
9653 #2
9654 \backgroundpath{
9655 \pgftransformationadjustments
9656 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
9657 %
9658 \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
9659 \pgf@circuit@trans@ntypetrue
9660 \else
9661 \pgf@circuit@trans@ntypefalse
9662 \fi
9663 \northeast
9664 \pgf@circ@res@up = \pgf@y
9665 \pgf@circ@res@down = -\pgf@y
9666 \pgf@circ@res@right = \pgf@x
9667 \left
9668 \pgf@circ@res@left = \pgf@x
9669 %
9670 #3
9671 % BODY DIODE
9672 \ifpgf@circuit@fet@bodydiode
9673 \drawbodydiode{#1}
9674 \fi
9675 %
9676 }
9677 }
9678 }
9679
9680 \long\def\drawbodydiode#1{
9681 \pgfscope
9682 \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
9683 \pgftransformrotate{90}
9684 \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
9685 \ifpgf@circuit@fulldiode
9686 \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
9687 \else
9688 \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
9689 \fi
9690 \endpgfscope
9691 % Draw stroke line
9692 \ifpgf@circuit@strokediode
9693 \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
9694 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
9695 \pgfusepath{stroke}
9696 \fi
9697 %Draw upper connection to body diode
9698 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
9699 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9700 \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}
9701 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9702 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
9703 \pgfusepath{draw}
9704 \pgfscope
9705 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
9706 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
9707 \pgftransformscale{0.5}
9708 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
9709 \endpgfscope{}
9710 %Draw lower connection to body diode
9711 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
9712 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9713 \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9714 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
9715 \pgfusepath{draw}
9716 \pgfscope
9717 \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
9718 \pgftransformscale{0.5}
9719 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
9720 \endpgfscope
9721 }
9722
9723 \long\def\declarebpt#1{
9724 \pgfcircdeclaretransistor{#1}{}{
9725 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9726 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9727 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
9728 \pgfpathlineto{\pgfpoint
9729 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9730 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}}
9731 \pgfusepath{draw}
9732
9733 \pgfscope
9734 \pgfpathmoveto{\pgfpoint
9735 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9736 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
9737 \pgfpathlineto{\pgfpoint
9738 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9739 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9740 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9741 \pgfusepath{draw}
9742 \endpgfscope
9743
9744 \pgfpathmoveto{\pgfpoint
9745 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9746 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}}
9747 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9748 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
9749 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9750 \pgfusepath{draw}
9751 %draw arrow depending on type of transistor
9752 \pgfscope
9753 \pgfslopedattimetrue
9754 \pgfallowupsidedownattimetrue
9755 \pgfresetnontranslationattimefalse
9756 \ifpgf@circuit@trans@ntype
9757 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
9758 \pgfpoint%
9759 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9760 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}%
9761 }{%
9762 \pgfpoint{\pgf@circ@res@right}%
9763 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}%
9764 }
9765 \else
9766 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
9767 \pgfpoint{\pgf@circ@res@right}%
9768 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}%
9769 }{%
9770 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9771 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}%
9772 }
9773 \fi
9774 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9775 \endpgfscope
9776
9777 \ifpgf@circuit@bpt@drawphoto
9778 \pgfscope
9779 \pgfsetarrowsstart{latexslim}
9780 \pgfpathmoveto{\pgfpointadd{\pgfpoint
9781 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9782 {\pgf@circ@res@up+\pgf@circ@res@down}}
9783 {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
9784 \pgfpathlineto{\pgfpointadd{\pgfpoint
9785 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9786 {\pgf@circ@res@up+\pgf@circ@res@down}}
9787 {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
9788 \pgfusepath{draw}
9789 \pgfpathmoveto{\pgfpointadd{\pgfpoint
9790 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9791 {\pgf@circ@res@up+\pgf@circ@res@down}}
9792 {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
9793 \pgfpathlineto{\pgfpointadd{\pgfpoint
9794 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9795 {\pgf@circ@res@up+\pgf@circ@res@down}}
9796 {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
9797 \pgfusepath{draw}
9798 \endpgfscope
9799 \else
9800 \ifpgf@circuit@bpt@drawbase
9801 \pgfpathmoveto{\pgfpoint
9802 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9803 {\pgf@circ@res@up+\pgf@circ@res@down}}
9804 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9805 \pgfusepath{draw}
9806 \fi
9807 \fi
9808 }
9809 }
9810
9811 \declarebpt{npn}
9812 \declarebpt{pnp}
9813
9814 \long\def\declareigbt#1{
9815 \pgfcircdeclaretransistor{#1}{}
9816 {
9817 %draw upper connection
9818 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9819 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9820 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
9821 \pgfpathlineto{\pgfpoint
9822 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9823 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}}
9824 \pgfusepath{draw}
9825
9826 %draw thicker gate lines
9827 \pgfscope
9828 \pgfpathmoveto{\pgfpoint
9829 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9830 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9831 \pgfpathlineto{\pgfpoint
9832 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9833 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9834 \pgfpathmoveto{\pgfpoint
9835 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9836 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9837 \pgfpathlineto{\pgfpoint
9838 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9839 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
9840 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9841 \pgfusepath{draw}
9842 \endpgfscope
9843 %draw lower connection
9844 \pgfpathmoveto{\pgfpoint
9845 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
9846 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}}
9847 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9848 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
9849 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9850 \pgfusepath{draw}
9851 %draw arrow depending on type of transiytor
9852 \pgfscope
9853 \pgfslopedattimetrue
9854 \pgfallowupsidedownattimetrue
9855 \pgfresetnontranslationattimefalse
9856 \ifpgf@circuit@trans@ntype
9857 \pgftransformlineattime{.5}{%
9858 \pgfpoint%
9859 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9860 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}%
9861 }{%
9862 \pgfpoint{\pgf@circ@res@right}%
9863 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}%
9864 }
9865 \else
9866 \pgftransformlineattime{.5}{%
9867 \pgfpoint{\pgf@circ@res@right}%
9868 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}%
9869 }{%
9870 \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
9871 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}%
9872 }
9873 \fi
9874 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9875 \endpgfscope
9876 %draw gate
9877 \ifpgf@circuit@trans@ntype
9878 \pgfpathmoveto{\pgfpoint
9879 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9880 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9881 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
9882 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
9883 \else
9884 \pgfpathmoveto{\pgfpoint
9885 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
9886 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
9887 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
9888 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
9889 \fi
9890 \pgfusepath{draw}
9891 }
9892 }
9893
9894 \declareigbt{pigbt}
9895 \declareigbt{nigbt}
9896 \declareigbt{Lnigbt}
9897 \declareigbt{Lpigbt}
9898
9899
9900 \pgfcircdeclaretransistor{nmos}{}{%
9901 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9902 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9903 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9904 \pgfpathlineto{\pgfpoint
9905 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9906 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9907
9908 \pgfpathmoveto{\pgfpoint
9909 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9910 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9911 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9912 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9913 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9914 \pgfusepath{draw}
9915
9916 \pgfscope
9917 \pgfpathmoveto{\pgfpoint
9918 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9919 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
9920 \pgfpathlineto{\pgfpoint
9921 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
9922 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
9923 \pgfpathmoveto{\pgfpoint
9924 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9925 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
9926 \pgfpathlineto{\pgfpoint
9927 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9928 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
9929 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
9930 \pgfusepath{draw}
9931 \endpgfscope
9932 \ifpgf@circuit@mos@arrows
9933 \pgfscope
9934 \pgfslopedattimetrue
9935 \pgfallowupsidedownattimetrue
9936 \pgfresetnontranslationattimefalse
9937 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/arrow pos}}{%
9938 \pgfpoint%
9939 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
9940 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
9941 }{%
9942 \pgfpoint
9943 {\pgf@circ@res@right}%
9944 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
9945 }
9946 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9947 \endpgfscope
9948 \fi
9949
9950 \ifpgf@circuit@bpt@drawgate
9951 \pgfpathmoveto{\pgfpoint
9952 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
9953 {\pgf@circ@res@up+\pgf@circ@res@down}}
9954 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
9955 \pgfusepath{draw}
9956 \fi
9957 }
9958
9959
9960 \pgfcircdeclaretransistor{pmos}{}{%
9961 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
9962 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
9963 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9964 \pgfpathlineto{\pgfpoint
9965 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9966 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9967 \pgfusepath{draw}
9968
9969 \ifpgf@circuit@mos@arrows
9970 \pgfscope
9971 \pgfslopedattimetrue
9972 \pgfallowupsidedownattimetrue
9973 \pgfresetnontranslationattimefalse
9974 \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/arrow pos}}{%
9975 \pgfpoint%
9976 {\pgf@circ@res@right}%
9977 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
9978 }{%
9979 \pgfpoint
9980 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
9981 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
9982 }
9983 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
9984 \endpgfscope
9985 \fi
9986
9987 \pgfscope
9988 \pgfpathmoveto{\pgfpoint
9989 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9990 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
9991 \pgfpathlineto{\pgfpoint
9992 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
9993 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
9994 \pgfpathmoveto{\pgfpoint
9995 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
9996 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
9997 \pgfpathlineto{\pgfpoint
9998 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
9999 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
10000 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10001 \pgfusepath{draw}
10002 \endpgfscope
10003
10004 \pgfpathmoveto{\pgfpoint
10005 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
10006 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
10007 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10008 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
10009 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10010
10011
10012 \pgfusepath{draw}
10013 \ifpgf@circuit@bpt@drawgate
10014 \pgfpathmoveto{\pgfpoint
10015 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
10016 {\pgf@circ@res@up+\pgf@circ@res@down}}
10017 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10018 \pgfusepath{draw}
10019 \fi
10020 \ifpgf@circuit@pmos@nocircle\else
10021 \pgfpathcircle{\pgfpoint
10022 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
10023 {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
10024 \ifpgf@circuit@pmos@emptycircle
10025 \pgfsetfillcolor{white}
10026 \fi
10027 \pgfusepath{draw,fill}
10028 \fi
10029 }
10030
10031 %% HEMT FET Transistor
10032 \pgfcircdeclaretransistor{hemt}{}{%
10033 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10034 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10035 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
10036 \pgfpathlineto{\pgfpoint
10037 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
10038 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
10039
10040 \pgfpathmoveto{\pgfpoint
10041 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
10042 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@down}}
10043 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10044 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@down}}
10045 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10046 \pgfusepath{draw}
10047
10048 \pgfscope
10049 \pgfpathmoveto{\pgfpoint
10050 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
10051 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@up}}
10052 \pgfpathlineto{\pgfpoint
10053 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
10054 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@down}}
10055 \pgfsetlinewidth{2\pgflinewidth}
10056 \pgfusepath{draw}
10057 \endpgfscope
10058
10059 \pgfpathmoveto{\pgfpoint
10060 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
10061 {\pgf@circ@res@up+\pgf@circ@res@down}}
10062 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10063 \pgfusepath{draw}
10064 }
10065
10066 \long\def\drawfetcore#1{
10067 \pgftransformationadjustments
10068 %top connection
10069 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10070 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10071 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
10072 \pgfpathlineto{\pgfpoint
10073 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10074 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
10075 \pgfusepath{draw}
10076 \pgfscope
10077 \pgfpathmoveto{\pgfpoint
10078 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10079 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
10080 \ifpgf@circuit@trans@depletiontype
10081 \pgfpathlineto{\pgfpoint
10082 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10083 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
10084 \else
10085
10086 \pgfpathlineto{\pgfpoint
10087 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10088 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.45}}
10089 \pgfpathmoveto{\pgfpoint
10090 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10091 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.25}}
10092 \pgfpathlineto{\pgfpoint
10093 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10094 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down*0.25}}
10095 \pgfpathmoveto{\pgfpoint
10096 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10097 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
10098 \pgfpathlineto{\pgfpoint
10099 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10100 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
10101 \fi
10102 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10103 \pgfusepath{draw}
10104 \endpgfscope
10105 %Bulk connection line
10106 \pgfpathmoveto{\pgfpoint
10107 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10108 {\pgf@circ@res@up+\pgf@circ@res@down}}
10109 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10110 {\pgf@circ@res@up+\pgf@circ@res@down}}
10111
10112 %bottom connection
10113 \pgfpathmoveto{\pgfpoint
10114 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
10115 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
10116 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10117 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
10118 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10119 \pgfusepath{draw}
10120
10121 %draw thick gate line
10122 \pgfscope
10123 \pgfpathmoveto{\pgfpoint
10124 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
10125 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10126 \pgfpathlineto{\pgfpoint
10127 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
10128 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10129 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10130 \pgfusepath{draw}
10131 \endpgfscope
10132
10133 \pgfscope
10134 \pgfslopedattimetrue
10135 \pgfallowupsidedownattimetrue
10136 \pgfresetnontranslationattimefalse
10137
10138 \pgftransformlineattime{.6}{%
10139 \pgfpoint
10140 {\pgf@circ@res@right}%
10141 {\pgf@circ@res@up+\pgf@circ@res@down}%
10142 }{%
10143 \pgfpoint%
10144 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
10145 {\pgf@circ@res@up+\pgf@circ@res@down}%
10146 }
10147 \ifpgf@circuit@trans@ntype
10148 \else
10149 \pgftransformrotate{180}
10150 \fi
10151 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10152 \endpgfscope
10153
10154 % GATE CONNECTION
10155 \ifpgf@circuit@bpt@drawgate
10156 \ifpgf@circuit@trans@ntype
10157 \pgfpathmoveto{\pgfpoint
10158 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
10159 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
10160 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
10161 \else
10162 \pgfpathmoveto{\pgfpoint
10163 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
10164 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
10165 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
10166 \fi
10167 \pgfusepath{draw}
10168 \fi
10169
10170 }
10171
10172 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
10173 {\pgfcircdeclaretransistor{#1}{
10174 \anchor{bulk}{\left\pgf@x=0pt}
10175 \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
10176 #2
10177 }
10178 {#3}
10179 }
10180
10181
10182 \pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
10183 \pgf@circuit@trans@depletiontypefalse
10184 \drawfetcore{nfet}
10185 }
10186
10187
10188 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
10189 \pgf@circuit@trans@depletiontypefalse
10190 \drawfetcore{pfet}
10191 }
10192
10193 % N-CHANNEL IGFET ENHANCEMENT TYPE
10194 \pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
10195 \pgf@circuit@trans@depletiontypefalse
10196 \drawfetcore{nigfete}
10197
10198 % SOURCE CONNECTION
10199 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10200 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
10201 \pgfusepath{draw}
10202
10203 % SOLDER DOT at source-bulk connection
10204 \ifpgf@circuit@fet@solderdot
10205 \pgfscope
10206 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10207 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
10208 \pgfnode{circ}{center}{}{}{}
10209 \endpgfscope{}
10210 \fi
10211 }
10212
10213
10214
10215
10216 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
10217 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
10218 \pgf@circuit@trans@depletiontypefalse
10219 \drawfetcore{nigfetebulk}
10220 % SOLDER DOT at source-bulk connection
10221 \ifpgf@circuit@fet@solderdot
10222 \pgfscope
10223 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10224 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
10225 \pgfnode{circ}{center}{}{}{}
10226 \endpgfscope{}
10227 \fi
10228 }
10229
10230
10231
10232 % N-CHANNEL IGFET DEPLETION TYPE
10233 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
10234 \pgf@circuit@trans@depletiontypetrue
10235 \drawfetcore{nigfetd}
10236
10237 % SOURCE CONNECTION
10238 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10239 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
10240 \pgfusepath{draw}
10241
10242 % SOLDER DOT at source-bulk connection
10243 \ifpgf@circuit@fet@solderdot
10244 \pgfscope
10245 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10246 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
10247 \pgfnode{circ}{center}{}{}{}
10248 \endpgfscope{}
10249 \fi
10250 }
10251
10252 % P-CHANNEL IGFET ENHANCEMENT TYPE
10253 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
10254 \pgf@circuit@trans@depletiontypefalse
10255 \drawfetcore{pigfete}
10256 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
10257
10258 % SOURCE CONNECTION
10259 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10260 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
10261 \pgfusepath{draw}
10262
10263
10264 % SOLDER DOT at source-bulk connection
10265 \ifpgf@circuit@fet@solderdot
10266 \pgfscope
10267 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10268 \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
10269 \pgfnode{circ}{center}{}{}{}
10270 \endpgfscope
10271 \fi
10272 }
10273
10274 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
10275 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
10276 \pgf@circuit@trans@depletiontypefalse
10277 \drawfetcore{pigfetebulk}
10278 }
10279
10280
10281 % P-CHANNEL IGFET DEPLETION TYPE
10282 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
10283 \pgf@circuit@trans@depletiontypetrue
10284 \drawfetcore{pigfetd}
10285
10286 % SOURCE CONNECTION
10287 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10288 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
10289 \pgfusepath{draw}
10290
10291
10292 % SOLDER DOT at source-bulk connection
10293 \ifpgf@circuit@fet@solderdot
10294 \pgfscope
10295 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10296 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
10297 \pgfnode{circ}{center}{}{}{}
10298 \endpgfscope{}
10299 \fi
10300 }
10301
10302 \pgfcircdeclaretransistor{njfet}{}{%
10303 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10304 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10305 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
10306 \pgfpathlineto{\pgfpoint
10307 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10308 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
10309
10310 \pgfpathmoveto{\pgfpoint
10311 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10312 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10313 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10314 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10315 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10316 \pgfusepath{draw}
10317
10318 \pgfscope
10319 \pgfpathmoveto{\pgfpoint
10320 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10321 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
10322 \pgfpathlineto{\pgfpoint
10323 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10324 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
10325 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10326 \pgfusepath{draw}
10327 \endpgfscope
10328
10329 \pgfscope
10330 \pgfslopedattimetrue
10331 \pgfallowupsidedownattimetrue
10332 \pgfresetnontranslationattimefalse
10333 \pgftransformlineattime{.6}{%
10334 \pgfpoint{\pgf@circ@res@left}%
10335 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
10336 }{%
10337 \pgfpoint
10338 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
10339 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
10340 }
10341 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10342 \endpgfscope
10343
10344 \pgfpathmoveto{\pgfpoint
10345 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
10346 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10347 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10348 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
10349 \pgfusepath{draw}
10350 }
10351
10352
10353 \pgfcircdeclaretransistor{pjfet}{}{%
10354 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10355 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10356 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10357 \pgfpathlineto{\pgfpoint
10358 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10359 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10360
10361 \pgfpathmoveto{\pgfpoint
10362 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10363 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
10364 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10365 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
10366 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10367 \pgfusepath{draw}
10368
10369 \pgfscope
10370 \pgfpathmoveto{\pgfpoint
10371 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10372 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
10373 \pgfpathlineto{\pgfpoint
10374 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10375 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
10376 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10377 \pgfusepath{draw}
10378 \endpgfscope
10379
10380 \pgfscope
10381 \pgfslopedattimetrue
10382 \pgfallowupsidedownattimetrue
10383 \pgfresetnontranslationattimefalse
10384 \pgftransformlineattime{.4}{%
10385 \pgfpoint%
10386 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
10387 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
10388 }{%
10389 \pgfpoint{\pgf@circ@res@left}%
10390 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
10391 }
10392 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10393 \endpgfscope
10394
10395
10396 \pgfpathmoveto{\pgfpoint
10397 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
10398 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10399 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10400 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
10401 \pgfusepath{draw}
10402 }
10403
10404
10405 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
10406 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10407 % DRAIN CONNECTION
10408 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10409 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
10410 % DRAIN
10411 \pgfpathlineto{\pgfpoint
10412 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10413 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
10414 \pgfusepath{draw}
10415
10416 % GATE, DEPLETION TYPE
10417 \pgfscope %% added
10418 \pgfpathmoveto{\pgfpoint
10419 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10420 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
10421 \pgfpathlineto{\pgfpoint
10422 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10423 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
10424 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth} %% added
10425 \pgfusepath{draw} %% added
10426 \endpgfscope %% added
10427
10428 % BULK
10429 \pgfpathmoveto{\pgfpoint
10430 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10431 {\pgf@circ@res@up+\pgf@circ@res@down}}
10432 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
10433 {\pgf@circ@res@up+\pgf@circ@res@down}}
10434
10435 % SOURCE
10436 \pgfpathmoveto{\pgfpoint
10437 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
10438 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
10439 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10440 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
10441 % SOURCE CONNECTION
10442 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10443 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10444 \pgfusepath{draw}
10445
10446
10447 % SOLDER DOT at source-bulk connection
10448 \ifpgf@circuit@fet@solderdot
10449 \pgfscope
10450 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
10451 \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
10452 \pgfnode{circ}{center}{}{}{}
10453 \endpgfscope{}
10454 \fi
10455 % ARROW
10456 \pgfscope
10457 \pgfslopedattimetrue
10458 \pgfallowupsidedownattimetrue
10459 \pgfresetnontranslationattimefalse
10460 \pgftransformlineattime{.6}{%
10461 \pgfpoint
10462 {\pgf@circ@res@right}%
10463 {\pgf@circ@res@up+\pgf@circ@res@down}%
10464 }{%
10465 \pgfpoint%
10466 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
10467 {\pgf@circ@res@up+\pgf@circ@res@down}%
10468 }
10469 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10470 \endpgfscope
10471 \pgfusepath{draw}
10472
10473 % Wavy lines
10474 \pgfscope
10475 \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}}
10476 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10477 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10478 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10479 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10480 \pgfusepath{draw}
10481
10482 \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
10483 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10484 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10485 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10486 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10487 \pgfusepath{draw}
10488
10489 \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}}
10490 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10491 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10492 \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10493 \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
10494 \pgfusepath{draw}
10495 \endpgfscope
10496
10497 }
10498
10499
10500 %% Black thyristor
10501
10502 \pgfcircdeclarebipole{
10503 \anchor{gate}{
10504 \northeast
10505 }
10506 \anchor{anode}{
10507 \southwest
10508 \pgf@y=0cm
10509 }
10510 \anchor{G}{
10511 \northeast
10512 }
10513 \anchor{cathode}{
10514 \northeast
10515 \pgf@y=0cm
10516 }
10517 }
10518 {\ctikzvalof{tripoles/thyristor/height 2}}
10519 {fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}
10520 {\ctikzvalof{tripoles/thyristor/width}}
10521 {
10522
10523 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10524
10525 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
10526 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
10527
10528 \pgfscope
10529 \pgftransformxshift{\pgf@circ@res@other}
10530 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10531
10532 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
10533 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10534 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10535 \pgfusepath{draw,fill}
10536
10537 \pgfsetlinewidth{\pgfstartlinewidth}
10538
10539 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10540 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
10541 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
10542 \pgfusepath{draw}
10543 \endpgfscope
10544
10545 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
10546 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
10547
10548 \pgfusepath{draw}
10549
10550 \pgfsetlinewidth{\pgfstartlinewidth}
10551
10552 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10553 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10554
10555 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10556 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10557
10558 \pgfusepath{draw}
10559
10560 }
10561
10562 %% Empty thyristor
10563
10564 \pgfcircdeclarebipole{
10565 \anchor{gate}{
10566 \northeast
10567 }
10568 \anchor{anode}{
10569 \southwest
10570 \pgf@y=0cm
10571 }
10572 \anchor{G}{
10573 \northeast
10574 }
10575 \anchor{cathode}{
10576 \northeast
10577 \pgf@y=0cm
10578 }
10579 }
10580 {\ctikzvalof{tripoles/thyristor/height 2}}
10581 {emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}
10582 {\ctikzvalof{tripoles/thyristor/width}}
10583 {
10584
10585 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10586
10587 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
10588 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
10589
10590 \pgfscope
10591 \pgftransformxshift{\pgf@circ@res@other}
10592 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10593
10594 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
10595 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10596 \pgfpathclose
10597 \pgf@circ@draworfill
10598 \pgfscope
10599 % to allow filling, we need to draw explicitily the stroke here.
10600 \pgfsetlinewidth{\pgfstartlinewidth}
10601 \ifpgf@circuit@bipole@strokedsymbol
10602 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10603 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
10604 \pgfusepath{draw}
10605 \fi
10606 \endpgfscope
10607
10608 \pgfsetlinewidth{\pgfstartlinewidth}
10609
10610 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10611 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
10612 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
10613 \pgfusepath{draw}
10614 \endpgfscope
10615
10616 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
10617 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
10618
10619 \pgfusepath{draw}
10620
10621 \pgfsetlinewidth{\pgfstartlinewidth}
10622
10623 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10624 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10625
10626 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10627 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10628
10629 \pgfusepath{draw}
10630
10631 }
10632
10633 %% Empty triac
10634
10635 \pgfcircdeclarebipole{
10636 \anchor{gate}{
10637 \northeast
10638 }
10639 \anchor{G}{
10640 \northeast
10641 }
10642 \anchor{anode}{
10643 \southwest
10644 \pgf@y=0cm
10645 }
10646 \anchor{cathode}{
10647 \northeast
10648 \pgf@y=0cm
10649 }
10650 }
10651 {\ctikzvalof{tripoles/triac/height}}
10652 {emptytriac}
10653 {\ctikzvalof{tripoles/triac/height}}
10654 {\ctikzvalof{tripoles/triac/width}}
10655 {
10656
10657 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10658
10659 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
10660 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
10661
10662 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10663 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10664 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10665 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10666
10667 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10668 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10669 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10670 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10671
10672 \pgf@circ@draworfill
10673
10674 \pgfsetlinewidth{\pgfstartlinewidth}
10675
10676 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10677 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10678 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
10679
10680 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10681 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10682
10683 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10684 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10685
10686 \pgfusepath{draw}
10687
10688 }
10689
10690 %% Full triac
10691
10692 \pgfcircdeclarebipole{
10693 \anchor{gate}{
10694 \northeast
10695 }
10696 \anchor{G}{
10697 \northeast
10698 }
10699 \anchor{anode}{
10700 \southwest
10701 \pgf@y=0cm
10702 }
10703 \anchor{cathode}{
10704 \northeast
10705 \pgf@y=0cm
10706 }
10707 }
10708 {\ctikzvalof{tripoles/triac/height}}
10709 {fulltriac}
10710 {\ctikzvalof{tripoles/triac/height}}
10711 {\ctikzvalof{tripoles/triac/width}}
10712 {
10713 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10714
10715 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
10716 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
10717
10718 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10719 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10720 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10721 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10722
10723 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10724 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10725 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10726 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
10727
10728 \pgfusepath{draw,fill}
10729
10730 \pgfsetlinewidth{\pgfstartlinewidth}
10731
10732 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10733 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
10734 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
10735
10736 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10737 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10738
10739 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10740 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10741
10742 \pgfusepath{draw}
10743
10744 }
10745
10746 \pgfcircdeclarebipole{
10747 \anchor{out 1}{
10748 \northeast
10749 \pgf@y=0cm
10750 }
10751 \anchor{out 2}{
10752 \northeast
10753 \pgf@y=.8\pgf@y
10754 }
10755 }
10756 {\ctikzvalof{tripoles/toggleswitch/height 2}}
10757 {toggleswitch}
10758 {\ctikzvalof{tripoles/toggleswitch/height}}
10759 {\ctikzvalof{tripoles/toggleswitch/width}}
10760 {
10761
10762 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10763 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
10764 \pgfusepath{draw}
10765 \pgfscope
10766 \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
10767 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
10768 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
10769 \pgfusepath{draw}
10770 \endpgfscope
10771
10772 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10773 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
10774
10775 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
10776 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
10777 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
10778 \pgfusepath{draw}
10779
10780
10781 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
10782 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
10783 \pgfusepath{draw}
10784
10785 \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}
10786 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
10787 \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
10788 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
10789 \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
10790 \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
10791 \pgfusepath{draw}
10792 \pgfsetdash{}{0cm}
10793 }
10794
10795 %% operational and instrumentation amplifiers
10796
10797 \pgfdeclareshape{op amp}
10798 {
10799 \anchor{center}{\pgfpointorigin}
10800 \savedanchor\northwest{%
10801 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10802 \pgf@y=.5\pgf@y
10803 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10804 \pgf@x=.5\pgf@x
10805 }
10806 \anchor{south}{
10807 \northwest
10808 \pgf@y=-\pgf@y
10809 \pgf@x=0pt
10810 }
10811 \anchor{north}{
10812 \northwest
10813 \pgf@x=0pt
10814 }
10815 \savedanchor\left{%
10816 \pgf@y=0pt
10817 }
10818 \anchor{leftedge}
10819 {\left
10820 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
10821 }
10822 \savedanchor\inOneFixed{%
10823 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10824 \pgf@y=.5\pgf@y
10825 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10826 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10827 \pgf@x=.5\pgf@x
10828 }
10829 \anchor{in up}{
10830 \inOneFixed
10831 }
10832 \anchor{in down}{
10833 \inOneFixed
10834 \pgf@y=-\pgf@y
10835 }
10836
10837 \savedanchor\inOne{%
10838 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10839 \pgf@y=.5\pgf@y
10840 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
10841 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10842 \pgf@x=.5\pgf@x
10843 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10844 }
10845 \anchor{-}{
10846 \inOne
10847 }
10848 \anchor{+}{
10849 \inOne
10850 \pgf@y=-\pgf@y
10851 }
10852 \savedanchor\up{%
10853 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
10854 \pgf@y=.5\pgf@y
10855 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
10856 \pgf@x=.5\pgf@x
10857 \pgf@circ@res@up = \pgf@y
10858 \pgf@circ@res@right = -\pgf@x
10859 \pgf@circ@res@left = \pgf@x
10860 \pgfpointlineattime{
10861 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
10862 \pgfpoint{
10863 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10864 {\pgf@circ@res@up}}
10865 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10866 }
10867 \anchor{up}{
10868 \up
10869 }
10870 \anchor{down}{
10871 \up
10872 \pgf@y=-\pgf@y
10873 }
10874 \anchor{out}{
10875 \northwest
10876 \pgf@y=0pt
10877 \pgf@x=-\pgf@x
10878 }
10879 \anchor{west}{
10880 \left
10881 }
10882 \anchor{east}{
10883 \left
10884 \pgf@x=-\pgf@x
10885 }
10886
10887 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
10888 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
10889 \anchor{north west}{ \northwest }
10890 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
10891
10892 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
10893
10894 \backgroundpath{
10895 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
10896
10897
10898 \northwest
10899 \pgf@circ@res@up = \pgf@y
10900 \pgf@circ@res@down = -\pgf@y
10901 \pgf@circ@res@right = -\pgf@x
10902 \pgf@circ@res@left = \pgf@x
10903
10904 \pgfscope
10905 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
10906 \pgftransformxshift{.7\pgf@circ@res@left}
10907 \pgf@circ@res@step=\pgf@circ@res@right
10908 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10909 \pgf@circ@res@step=.7\pgf@circ@res@step
10910
10911 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10912 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10913 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10914 \pgfpathclose
10915 \pgf@circ@draworfill
10916 \endpgfscope
10917
10918 \pgfpathmoveto{\pgfpoint
10919 {\pgf@circ@res@left}
10920 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
10921 \pgfpathlineto{\pgfpoint
10922 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10923 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
10924 \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}
10925
10926
10927 \pgfpathmoveto{\pgfpoint
10928 {\pgf@circ@res@left}
10929 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
10930 \pgfpathlineto{\pgfpoint
10931 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
10932 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
10933 \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}
10934
10935 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10936 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10937 \pgfsetrectcap
10938 \pgfusepath{draw}
10939
10940
10941 }
10942 }
10943
10944 %op amp shape as in european standard en 60617
10945 \pgfdeclareshape{en amp}
10946 {
10947 \anchor{center}{\pgfpointorigin}
10948 \savedanchor\northwest{%
10949 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
10950 \pgf@y=.5\pgf@y
10951 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@Rlen
10952 \pgf@x=.5\pgf@x
10953 }
10954 \anchor{south}{
10955 \northwest
10956 \pgf@y=-\pgf@y
10957 \pgf@x=0pt
10958 }
10959 \anchor{north}{
10960 \northwest
10961 \pgf@x=0pt
10962 }
10963 \savedanchor\left{%
10964 \pgf@y=0pt
10965 }
10966 \anchor{leftedge}
10967 {
10968 \left
10969 \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
10970 }
10971 \savedanchor\inOneFixed{%
10972 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@Rlen
10973 \pgf@y=.5\pgf@y
10974 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
10975 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@Rlen
10976 \pgf@x=.5\pgf@x
10977 }
10978 \anchor{in up}{
10979 \inOneFixed
10980 }
10981 \anchor{in down}{
10982 \inOneFixed
10983 \pgf@y=-\pgf@y
10984 }
10985 \savedanchor\inOne{%
10986 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
10987 \pgf@y=.5\pgf@y
10988 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
10989 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@Rlen
10990 \pgf@x=.5\pgf@x
10991 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
10992 }
10993 \anchor{-}{
10994 \inOne
10995 }
10996 \anchor{+}{
10997 \inOne
10998 \pgf@y=-\pgf@y
10999 }
11000 \anchor{up}{
11001 \northwest
11002 \pgf@x=0pt
11003 }
11004 \anchor{down}{
11005 \northwest
11006 \pgf@x=0pt
11007 \pgf@y=-\pgf@y
11008 }
11009 \anchor{out}{
11010 \northwest
11011 \pgf@y=0pt
11012 \pgf@x=-\pgf@x
11013 }
11014 \anchor{west}{
11015 \left
11016 }
11017 \anchor{east}{
11018 \left
11019 \pgf@x=-\pgf@x
11020 }
11021 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11022 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11023 \anchor{north west}{ \northwest }
11024 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11025 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11026
11027 \backgroundpath{
11028 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11029 \northwest
11030 \pgf@circ@res@up = \pgf@y
11031 \pgf@circ@res@down = -\pgf@y
11032 \pgf@circ@res@right = -\pgf@x
11033 \pgf@circ@res@left = \pgf@x
11034
11035 \pgfscope
11036 \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
11037 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
11038 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
11039 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
11040 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
11041 \pgfpathclose
11042 \pgf@circ@draworfill
11043 \endpgfscope
11044
11045 \pgfpathmoveto{\pgfpoint
11046 {\pgf@circ@res@left}
11047 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
11048 \pgfpathlineto{\pgfpoint
11049 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
11050 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
11051 \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}
11052
11053 \pgfpathmoveto{\pgfpoint
11054 {\pgf@circ@res@left}
11055 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
11056 \pgfpathlineto{\pgfpoint
11057 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
11058 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
11059 \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}
11060
11061 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11062 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
11063 \pgfsetrectcap
11064 \pgfusepath{draw}
11065
11066
11067 \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
11068 % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
11069 }
11070 }
11071
11072 %%Transkonduktanzverstärker
11073 \pgfdeclareshape{gm amp}
11074 {
11075 \anchor{center}{\pgfpointorigin}
11076 \savedanchor\northwest{%
11077 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
11078 \pgf@y=.5\pgf@y
11079 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
11080 \pgf@x=.5\pgf@x
11081 }
11082 \anchor{south}{
11083 \northwest
11084 \pgf@y=-\pgf@y
11085 }
11086 \anchor{north}{
11087 \northwest
11088 }
11089 \savedanchor\left{%
11090 \pgf@y=0pt
11091 }
11092 \anchor{leftedge}
11093 {\left
11094 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
11095 }
11096 \savedanchor\inOneFixed{%
11097 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11098 \pgf@y=.5\pgf@y
11099 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11100 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11101 \pgf@x=.5\pgf@x
11102 }
11103 \anchor{in up}{
11104 \inOneFixed
11105 }
11106 \anchor{in down}{
11107 \inOneFixed
11108 \pgf@y=-\pgf@y
11109 }
11110 \savedanchor\inOne{%
11111 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
11112 \pgf@y=.5\pgf@y
11113 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y
11114 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
11115 \pgf@x=.5\pgf@x
11116 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11117 }
11118 \anchor{-}{
11119 \inOne
11120 }
11121 \anchor{+}{
11122 \inOne
11123 \pgf@y=-\pgf@y
11124 }
11125 \savedanchor\up{%
11126 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
11127 \pgf@y=.5\pgf@y
11128 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
11129 \pgf@x=.5\pgf@x
11130 \pgf@circ@res@up = \pgf@y
11131 \pgf@circ@res@right = -\pgf@x
11132 \pgf@circ@res@left = \pgf@x
11133 \pgfpointlineattime{
11134 \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
11135 \pgfpoint{
11136 \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
11137 {\pgf@circ@res@up}}
11138 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
11139 }
11140 \anchor{up}{
11141 \up
11142 }
11143 \anchor{down}{
11144 \up
11145 \pgf@y=-\pgf@y
11146 }
11147 \anchor{out}{
11148 \northwest
11149 \pgf@y=0pt
11150 \pgf@x=-\pgf@x
11151 }
11152 \anchor{west}{
11153 \left
11154 }
11155 \anchor{east}{
11156 \left
11157 \pgf@x=-\pgf@x
11158 }
11159 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11160 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11161 \anchor{north west}{ \northwest }
11162 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11163
11164 \anchor{text}{\northwest
11165 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
11166 \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf@x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11167
11168 \backgroundpath{
11169 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11170
11171 \northwest
11172 \pgf@circ@res@up = \pgf@y
11173 \pgf@circ@res@down = -\pgf@y
11174 \pgf@circ@res@right = -\pgf@x
11175 \pgf@circ@res@left = \pgf@x
11176
11177 \pgfscope
11178 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11179 \pgftransformxshift{.7\pgf@circ@res@left}
11180 \pgf@circ@res@step=\pgf@circ@res@right
11181 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11182 \pgf@circ@res@step=.7\pgf@circ@res@step
11183 %Umrandung:
11184 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich
11185 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}%vom Ausgang nach oben
11186 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
11187 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
11188 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}%ecke links unten nach rechts unten
11189 \pgfpathclose
11190 \pgf@circ@draworfill
11191 \endpgfscope
11192
11193 \pgfpathmoveto{\pgfpoint
11194 {\pgf@circ@res@left}
11195 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
11196 \pgfpathlineto{\pgfpoint
11197 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
11198 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
11199 \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}
11200
11201
11202 \pgfpathmoveto{\pgfpoint
11203 {\pgf@circ@res@left}
11204 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
11205 \pgfpathlineto{\pgfpoint
11206 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
11207 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
11208 \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}
11209
11210 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11211 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
11212 \pgfsetrectcap
11213 \pgfusepath{draw}
11214
11215 }
11216 }
11217
11218 %% instrumentation amplifier
11219
11220 \pgfdeclareshape{inst amp}
11221 {
11222 % when tikz calls the anchor it wants the relative position in the lengths
11223 % \pgf@x \pgf@y
11224 % \pgfpoint* functions set that variables
11225 % anchors are visible outside and run on use
11226 \anchor{center}{\pgfpointorigin}
11227 % savedanchors are internals and run on node creation (not use)
11228 % bounding-box top left
11229 \savedanchor\northwest{%
11230 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
11231 \pgf@y=.5\pgf@y
11232 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
11233 \pgf@x=.5\pgf@x
11234 }
11235 \anchor{nw}{
11236 \northwest
11237 }
11238 \anchor{south}{
11239 \northwest
11240 \pgf@y=-\pgf@y
11241 }
11242 \anchor{north}{
11243 \northwest
11244 }
11245 \savedanchor\left{%
11246 \pgf@y=0pt
11247 }
11248 \anchor{leftedge}
11249 {\left
11250 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
11251 }
11252 \savedanchor\inOneFixed{%
11253 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11254 \pgf@y=.5\pgf@y
11255 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11256 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11257 \pgf@x=.5\pgf@x
11258 }
11259 \anchor{in up}{
11260 \inOneFixed
11261 }
11262 \anchor{in down}{
11263 \inOneFixed
11264 \pgf@y=-\pgf@y
11265 }
11266 \savedanchor\inOne{%
11267 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
11268 \pgf@y=.5\pgf@y
11269 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@y
11270 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
11271 \pgf@x=.5\pgf@x
11272 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11273 }
11274 \anchor{-}{
11275 \inOne
11276 }
11277 \anchor{+}{
11278 \inOne
11279 \pgf@y=-\pgf@y
11280 }
11281 \savedanchor\up{%
11282 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
11283 \pgf@y=.5\pgf@y
11284 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
11285 \pgf@x=.5\pgf@x
11286 \pgf@circ@res@up = \pgf@y
11287 \pgf@circ@res@right = -\pgf@x
11288 \pgf@circ@res@left = \pgf@x
11289 \pgfpointlineattime{
11290 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/up pos}}{
11291 \pgfpoint{
11292 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11293 {\pgf@circ@res@up}}
11294 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
11295 }
11296 \anchor{up}{
11297 \up
11298 }
11299 \anchor{down}{
11300 \up
11301 \pgf@y=-\pgf@y
11302 }
11303 % reference voltage input anchors.
11304 \savedanchor\refv{%
11305 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
11306 \pgf@y=.5\pgf@y
11307 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
11308 \pgf@x=.5\pgf@x
11309 \pgf@circ@res@up = \pgf@y
11310 \pgf@circ@res@right = -\pgf@x
11311 \pgf@circ@res@left = \pgf@x
11312 \pgfpointlineattime{
11313 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/refv pos}}{
11314 \pgfpoint{
11315 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11316 {\pgf@circ@res@up}}
11317 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
11318 }
11319 % we need both because they are normally drawn under the amp, and if you
11320 % mirror it vertically you need them
11321 \anchor{refv up}{
11322 \refv
11323 }
11324 \anchor{refv down}{
11325 \refv
11326 \pgf@y=-\pgf@y
11327 }
11328 \anchor{out}{
11329 \northwest
11330 \pgf@y=0pt
11331 \pgf@x=-\pgf@x
11332 }
11333 \anchor{west}{
11334 \left
11335 }
11336 \anchor{east}{
11337 \left
11338 \pgf@x=-\pgf@x
11339 }
11340 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11341 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11342 \anchor{north west}{ \northwest }
11343 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11344
11345 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11346
11347 % let's start drawing the component
11348 \backgroundpath{
11349 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11350 %
11351 \northwest
11352 \pgf@circ@res@up = \pgf@y
11353 \pgf@circ@res@down = -\pgf@y
11354 \pgf@circ@res@right = -\pgf@x
11355 \pgf@circ@res@left = \pgf@x
11356 % main component, normally in thicker lines
11357 \pgfscope
11358 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11359 \pgftransformxshift{.7\pgf@circ@res@left}
11360 \pgf@circ@res@step=\pgf@circ@res@right
11361 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11362 \pgf@circ@res@step=.7\pgf@circ@res@step
11363 %first point (near output)
11364 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
11365 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
11366 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
11367 % and then to the input "front up", "down", to the output short side "down"
11368 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11369 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
11370 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
11371 % ...and close
11372 \pgfpathclose
11373 \pgf@circ@draworfill
11374 \endpgfscope
11375 % input terminal -
11376 \pgfpathmoveto{\pgfpoint
11377 {\pgf@circ@res@left}
11378 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
11379 %
11380 \pgfpathlineto{\pgfpoint
11381 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11382 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
11383 %
11384 \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}
11385
11386 % input terminal +
11387 \pgfpathmoveto{\pgfpoint
11388 {\pgf@circ@res@left}
11389 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
11390 %
11391 \pgfpathlineto{\pgfpoint
11392 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
11393 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
11394 \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}
11395 % output lead
11396 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11397 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
11398 %
11399 \pgfsetrectcap
11400 \pgfusepath{draw}
11401 }
11402 }
11403
11404 % instrumentation amplifier, with terminals for gain resistance between inputs
11405 \pgfdeclareshape{inst amp ra}
11406 {
11407 \anchor{center}{\pgfpointorigin}
11408 % bounding-box top left
11409 \savedanchor\northwest{%
11410 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11411 \pgf@y=.5\pgf@y
11412 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11413 \pgf@x=.5\pgf@x
11414 }
11415 \anchor{nw}{
11416 \northwest
11417 }
11418 \anchor{south}{
11419 \northwest
11420 \pgf@y=-\pgf@y\pgf@x=0pt\relax
11421 }
11422 \anchor{north}{
11423 \northwest\pgf@x=0pt\relax
11424 }
11425 \savedanchor\left{%
11426 \pgf@y=0pt
11427 }
11428 \anchor{leftedge}
11429 {\left
11430 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
11431 }
11432 % inputs (+-)
11433 \savedanchor\inOneFixed{%
11434 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11435 \pgf@y=.5\pgf@y
11436 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11437 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11438 \pgf@x=.5\pgf@x
11439 }
11440 \anchor{in up}{
11441 \inOneFixed
11442 }
11443 \anchor{in down}{
11444 \inOneFixed
11445 \pgf@y=-\pgf@y
11446 }
11447 \savedanchor\inOne{%
11448 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11449 \pgf@y=.5\pgf@y
11450 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@y
11451 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11452 \pgf@x=.5\pgf@x
11453 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11454 }
11455 \anchor{-}{
11456 \inOne
11457 }
11458 \anchor{+}{
11459 \inOne
11460 \pgf@y=-\pgf@y
11461 }
11462 % R ampli anchors. They are by default at 20% more than R-length distance
11463 % you can change that with the `ra pos` key (use 0.5 for one-R).
11464 \savedanchor\raOneFixed{%
11465 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
11466 \pgf@y=.5\pgf@y
11467 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
11468 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
11469 \pgf@x=.5\pgf@x
11470 }
11471 \anchor{ra up}{
11472 \inOneFixed
11473 }
11474 \anchor{ra down}{
11475 \inOneFixed
11476 \pgf@y=-\pgf@y
11477 }
11478 \savedanchor\raOne{%
11479 \pgf@y=\pgf@circ@Rlen
11480 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@y
11481 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11482 \pgf@x=.5\pgf@x
11483 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11484 }
11485 \anchor{ra-}{
11486 \raOne
11487 }
11488 \anchor{ra+}{
11489 \raOne
11490 \pgf@y=-\pgf@y
11491 }
11492 % power supplies
11493 \savedanchor\up{%
11494 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11495 \pgf@y=.5\pgf@y
11496 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11497 \pgf@x=.5\pgf@x
11498 \pgf@circ@res@up = \pgf@y
11499 \pgf@circ@res@right = -\pgf@x
11500 \pgf@circ@res@left = \pgf@x
11501 \pgfpointlineattime{
11502 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/up pos}}{
11503 \pgfpoint{
11504 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11505 {\pgf@circ@res@up}}
11506 {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11507 }
11508 \anchor{up}{
11509 \up
11510 }
11511 \anchor{down}{
11512 \up
11513 \pgf@y=-\pgf@y
11514 }
11515 % reference voltage input anchors.
11516 \savedanchor\refv{%
11517 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
11518 \pgf@y=0.5\pgf@y
11519 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
11520 \pgf@x=0.5\pgf@x
11521 \pgf@circ@res@up = \pgf@y
11522 \pgf@circ@res@right = -\pgf@x
11523 \pgf@circ@res@left = \pgf@x
11524 \pgfpointlineattime{
11525 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/refv pos}}{
11526 \pgfpoint{
11527 \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11528 {\pgf@circ@res@up}}
11529 {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11530 }
11531 % we need both because they are normally drawn under the amp, and if you
11532 % mirror it vertically you need them
11533 \anchor{refv up}{
11534 \refv
11535 }
11536 \anchor{refv down}{
11537 \refv
11538 \pgf@y=-\pgf@y
11539 }
11540 \anchor{out}{
11541 \northwest
11542 \pgf@y=0pt
11543 \pgf@x=-\pgf@x
11544 }
11545 \anchor{west}{
11546 \left
11547 }
11548 \anchor{east}{
11549 \left
11550 \pgf@x=-\pgf@x
11551 }
11552 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11553 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11554 \anchor{north west}{ \northwest }
11555 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11556
11557 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11558
11559 % drawing of the component
11560 \backgroundpath{
11561 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11562
11563 \northwest
11564 \pgf@circ@res@up = \pgf@y
11565 \pgf@circ@res@down = -\pgf@y
11566 \pgf@circ@res@right = -\pgf@x
11567 \pgf@circ@res@left = \pgf@x
11568
11569 % main component, normally in thicker lines
11570 \pgfscope
11571 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
11572 \pgftransformxshift{.7\pgf@circ@res@left}
11573 \pgf@circ@res@step=\pgf@circ@res@right
11574 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11575 \pgf@circ@res@step=.7\pgf@circ@res@step
11576 %primer punto: la linea de salida (lado componente)
11577 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
11578 %from the exit to the top (short side)... (note that the .4 must be copied in \up anchor
11579 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@up}}
11580 % and then to the input "front up", "down", to the output short side "down"
11581 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11582 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
11583 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@down}}
11584 % ...and close
11585 \pgfpathclose
11586 \pgf@circ@draworfill
11587 \endpgfscope
11588
11589 % ra terminal -
11590 \pgfpathmoveto{\pgfpoint
11591 {\pgf@circ@res@left}
11592 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11593 %
11594 \pgfpathlineto{\pgfpoint
11595 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11596 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11597 % ra terminal +
11598 \pgfpathmoveto{\pgfpoint
11599 {\pgf@circ@res@left}
11600 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11601 %
11602 \pgfpathlineto{\pgfpoint
11603 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11604 {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
11605 % input terminal -
11606 \pgfpathmoveto{\pgfpoint
11607 {\pgf@circ@res@left}
11608 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
11609 %
11610 \pgfpathlineto{\pgfpoint
11611 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11612 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
11613 %
11614 \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}
11615
11616 % input terminal +
11617 \pgfpathmoveto{\pgfpoint
11618 {\pgf@circ@res@left}
11619 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
11620 %
11621 \pgfpathlineto{\pgfpoint
11622 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
11623 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
11624 \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}
11625 % output lead
11626 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11627 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
11628 %
11629 \pgfsetrectcap
11630 \pgfusepath{draw}
11631 }
11632 }
11633 %% Potentiometer
11634 \pgfcircdeclarebipole{
11635 \anchor{wiper}{
11636 \northeast
11637 \pgfpoint{0pt}{\pgf@y}
11638 }
11639 \anchor{W}{
11640 \northeast
11641 \pgfpoint{0pt}{\pgf@y}
11642 }
11643 }
11644 {\ctikzvalof{bipoles/potentiometer/height 2}}
11645 {potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}
11646 {\ctikzvalof{bipoles/potentiometer/width}}
11647 {
11648 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11649 \pgftransformationadjustments
11650 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
11651 \divide \pgf@circ@res@step by 12
11652
11653 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
11654
11655 \pgf@circ@res@other = \pgf@circ@res@left
11656 \advance\pgf@circ@res@other by \pgf@circ@res@step
11657 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11658 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11659 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11660 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11661 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11662 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11663 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11664 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11665 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
11666 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
11667 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
11668 \advance\pgf@circ@res@other by \pgf@circ@res@step
11669 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
11670 \pgfsetbeveljoin
11671 \pgfusepath{draw}
11672
11673 \pgfscope
11674 %\pgfsetlinewidth{\pgfstartlinewidth}
11675 \pgfsetarrowsend{latexslim}
11676 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11677 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
11678 \pgfusepath{draw}
11679 \endpgfscope
11680 }
11681
11682
11683
11684
11685
11686 %% Generic tunable
11687
11688 \pgfcircdeclarebipole{
11689 \anchor{wiper}{
11690 \northeast
11691 \pgfpoint{0pt}{\pgf@y}
11692 }
11693 }
11694 {\ctikzvalof{bipoles/generic potentiometer/height 2}}
11695 {genericpotentiometer}
11696 {\ctikzvalof{bipoles/generic potentiometer/height}}
11697 {\ctikzvalof{bipoles/generic potentiometer/width}}
11698 {
11699
11700 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
11701 \divide \pgf@circ@res@step by 14
11702
11703 \pgfscope
11704 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11705 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11706 \pgf@circ@draworfill
11707 \endpgfscope
11708 \pgfscope
11709 %\pgfsetlinewidth{\pgfstartlinewidth}
11710 \pgfsetarrowsend{latexslim}
11711 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11712 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
11713 \pgfusepath{draw}
11714 \endpgfscope
11715 }
11716
11717
11718 \pgfdeclareshape{mixer}
11719 {
11720 \savedanchor\northwest{
11721 \ifpgf@circuit@boxed
11722 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11723 \pgf@y=.5\pgf@y
11724 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11725 \pgf@x=.5\pgf@x
11726 \else
11727 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
11728 \pgf@y=.5\pgf@y
11729 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
11730 \pgf@x=.5\pgf@x
11731 \fi
11732 }
11733 \anchor{center}{
11734 \pgfpointorigin
11735 }
11736 \anchor{left}{%
11737 \northwest
11738 \pgf@y=0pt
11739 }
11740 \anchor{1}{
11741 \northwest
11742 \pgf@y=0pt
11743 }
11744 \anchor{2}{
11745 \northwest
11746 \pgf@y=-\pgf@y
11747 \pgf@x=0pt
11748 }
11749 \anchor{3}{
11750 \northwest
11751 \pgf@y=0pt
11752 \pgf@x=-\pgf@x
11753 }
11754 \anchor{4}{
11755 \northwest
11756 \pgf@y=\pgf@y
11757 \pgf@x=0pt
11758 }
11759 \anchor{in 1}{
11760 \northwest
11761 \pgf@y=0pt
11762 }
11763 \anchor{in1}{
11764 \northwest
11765 \pgf@y=0pt
11766 }
11767 \anchor{in}{
11768 \northwest
11769 \pgf@y=0pt
11770 }
11771 \anchor{in 2}{
11772 \northwest
11773 \pgf@y=-\pgf@y
11774 \pgf@x=0pt
11775 }
11776 \anchor{in2}{
11777 \northwest
11778 \pgf@y=-\pgf@y
11779 \pgf@x=0pt
11780 }
11781 \anchor{out}{
11782 \northwest
11783 \pgf@y=0pt
11784 \pgf@x=-\pgf@x
11785 }
11786 \anchor{center}{
11787 \pgf@y=0pt
11788 \pgf@x=0pt
11789 }
11790 \anchor{east}{
11791 \northwest
11792 \pgf@y=0pt
11793 \pgf@x=-\pgf@x
11794 }
11795 \anchor{west}{
11796 \northwest
11797 \pgf@y=0pt
11798 }
11799 \anchor{south}{
11800 \northwest
11801 \pgf@x=0pt
11802 \pgf@y=-\pgf@y
11803 }
11804 \anchor{north}{
11805 \northwest
11806 \pgf@x=0pt
11807 }
11808 \anchor{south west}{
11809 \northwest
11810 \pgf@y=-\pgf@y
11811 }
11812 \anchor{north east}{
11813 \northwest
11814 \pgf@x=-\pgf@x
11815 }
11816 \anchor{north west}{
11817 \northwest
11818 }
11819 \anchor{south east}{
11820 \northwest
11821 \pgf@x=-\pgf@x
11822 \pgf@y=-\pgf@y
11823 }
11824 \backgroundpath{
11825 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11826
11827 \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
11828
11829 \pgfscope
11830 \pgfstartlinewidth=\pgflinewidth
11831
11832 % draw outer box
11833 \ifpgf@circuit@boxed
11834 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11835 \fi
11836
11837 % draw outer circle
11838 \ifpgf@circuit@boxed
11839 \pgf@circ@res@step=.7\pgf@circ@res@step
11840 \pgfsetdash{}{0pt} % draw solid circle if boxed
11841 \else
11842 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11843 \fi
11844 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11845 \pgf@circ@draworfill
11846
11847 % draw inner stuff
11848 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11849 \pgfsetlinewidth{\pgfstartlinewidth}
11850 \pgfpathmoveto{\pgfpointorigin}
11851 \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
11852 \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
11853 \pgfpathmoveto{\pgfpointorigin}
11854 \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
11855 \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
11856 \pgfusepath{draw}
11857
11858 \endpgfscope
11859 }
11860 }
11861
11862 \pgfdeclareshape{adder}
11863 {
11864 \savedanchor\northwest{
11865 \ifpgf@circuit@boxed
11866 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11867 \pgf@y=.5\pgf@y
11868 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
11869 \pgf@x=.5\pgf@x
11870 \else
11871 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
11872 \pgf@y=.5\pgf@y
11873 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
11874 \pgf@x=.5\pgf@x
11875 \fi
11876 }
11877 \anchor{center}{
11878 \pgfpointorigin
11879 }
11880 \anchor{left}{%
11881 \northwest
11882 \pgf@y=0pt
11883 }
11884 \anchor{1}{
11885 \northwest
11886 \pgf@y=0pt
11887 }
11888 \anchor{2}{
11889 \northwest
11890 \pgf@y=-\pgf@y
11891 \pgf@x=0pt
11892 }
11893 \anchor{3}{
11894 \northwest
11895 \pgf@y=0pt
11896 \pgf@x=-\pgf@x
11897 }
11898 \anchor{4}{
11899 \northwest
11900 \pgf@y=\pgf@y
11901 \pgf@x=0pt
11902 }
11903 \anchor{in 1}{
11904 \northwest
11905 \pgf@y=0pt
11906 }
11907 \anchor{in1}{
11908 \northwest
11909 \pgf@y=0pt
11910 }
11911 \anchor{in}{
11912 \northwest
11913 \pgf@y=0pt
11914 }
11915 \anchor{in 2}{
11916 \northwest
11917 \pgf@y=-\pgf@y
11918 \pgf@x=0pt
11919 }
11920 \anchor{in2}{
11921 \northwest
11922 \pgf@y=-\pgf@y
11923 \pgf@x=0pt
11924 }
11925 \anchor{out}{
11926 \northwest
11927 \pgf@y=0pt
11928 \pgf@x=-\pgf@x
11929 }
11930 \anchor{center}{
11931 \pgf@y=0pt
11932 \pgf@x=0pt
11933 }
11934 \anchor{east}{
11935 \northwest
11936 \pgf@y=0pt
11937 \pgf@x=-\pgf@x
11938 }
11939 \anchor{west}{
11940 \northwest
11941 \pgf@y=0pt
11942 }
11943 \anchor{south}{
11944 \northwest
11945 \pgf@x=0pt
11946 \pgf@y=-\pgf@y
11947 }
11948 \anchor{north}{
11949 \northwest
11950 \pgf@x=0pt
11951 }
11952 \anchor{south west}{
11953 \northwest
11954 \pgf@y=-\pgf@y
11955 }
11956 \anchor{north east}{
11957 \northwest
11958 \pgf@x=-\pgf@x
11959 }
11960 \anchor{north west}{
11961 \northwest
11962 }
11963 \anchor{south east}{
11964 \northwest
11965 \pgf@x=-\pgf@x
11966 \pgf@y=-\pgf@y
11967 }
11968 \backgroundpath{
11969 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
11970
11971 \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
11972
11973 \pgfscope
11974 \pgfstartlinewidth=\pgflinewidth
11975
11976 % draw outer box
11977 \ifpgf@circuit@boxed
11978 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
11979 \fi
11980
11981 % draw outer circle
11982 \ifpgf@circuit@boxed
11983 \pgf@circ@res@step=.7\pgf@circ@res@step{}
11984 \pgfsetdash{}{0pt} % draw solid circle if boxed
11985 \else
11986 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
11987 \fi
11988 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
11989 \pgf@circ@draworfill
11990
11991 % draw inner stuff
11992 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
11993 \pgfsetlinewidth{\pgfstartlinewidth}
11994
11995 \pgfpathmoveto{\pgfpointorigin}
11996 \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
11997 \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
11998 \pgfpathmoveto{\pgfpointorigin}
11999 \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
12000 \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
12001 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
12002 \pgfusepath{draw}
12003
12004 \endpgfscope
12005 }
12006 }
12007
12008 \pgfdeclareshape{oscillator}
12009 {
12010 \savedanchor\northwest{
12011 \ifpgf@circuit@boxed
12012 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
12013 \pgf@y=.5\pgf@y
12014 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
12015 \else
12016 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
12017 \pgf@y=.5\pgf@y
12018 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
12019 \fi
12020 }
12021 \anchor{center}{
12022 \pgfpointorigin
12023 }
12024 \anchor{north}{
12025 \northwest
12026 \pgf@x=.5\pgf@x
12027 }
12028 \anchor{south}{
12029 \northwest
12030 \pgf@x=.5\pgf@x
12031 \pgf@y=-\pgf@y
12032 }
12033 \anchor{east}{
12034 \northwest
12035 \pgf@y=0pt
12036 \pgf@x=0pt
12037 }
12038 \anchor{west}{
12039 \northwest
12040 \pgf@y=0pt
12041 }
12042 \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
12043 \anchor{north east}{ \northwest \pgf@x=0pt\relax}
12044 \anchor{north west}{ \northwest }
12045 \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
12046 \anchor{text}{
12047 \pgf@x=-2\pgf@x
12048 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
12049 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
12050 }
12051 \backgroundpath{
12052 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12053
12054 \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{}
12055
12056 \pgfscope
12057 \pgfstartlinewidth=\pgflinewidth
12058
12059 \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
12060
12061 % draw outer box
12062 \ifpgf@circuit@boxed{}
12063 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
12064 \fi
12065
12066 % draw outer circle
12067 \ifpgf@circuit@boxed
12068 \pgf@circ@res@step=.7\pgf@circ@res@step{}
12069 \pgfsetdash{}{0pt} % draw solid circle if boxed
12070 \else
12071 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12072 \fi
12073 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12074 \pgf@circ@draworfill
12075
12076 % draw inner sine waves
12077 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
12078 \pgfsetlinewidth{\pgfstartlinewidth}
12079 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
12080 \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
12081 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
12082 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
12083 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
12084 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
12085
12086 \pgfusepath{draw}
12087
12088 \endpgfscope
12089 }
12090 }
12091
12092 \pgfdeclareshape{circulator}
12093 {
12094 \savedanchor\northwest{
12095 \ifpgf@circuit@boxed
12096 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
12097 \pgf@y=.5\pgf@y
12098 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
12099 \pgf@x=.5\pgf@x
12100 \else
12101 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
12102 \pgf@y=.5\pgf@y
12103 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
12104 \pgf@x=.5\pgf@x
12105 \fi
12106 }
12107 \anchor{center}{
12108 \pgfpointorigin
12109 }
12110 \anchor{left}{%
12111 \northwest
12112 \pgf@y=0pt
12113 }
12114 \anchor{1}{
12115 \northwest
12116 \pgf@y=0pt
12117 }
12118 \anchor{2}{
12119 \northwest
12120 \pgf@y=0pt
12121 \pgf@x=-\pgf@x
12122 }
12123 \anchor{3}{
12124 \northwest
12125 \pgf@y=-\pgf@y
12126 \pgf@x=0pt
12127 }
12128 \anchor{east}{
12129 \northwest
12130 \pgf@y=0pt
12131 \pgf@x=-\pgf@x
12132 }
12133 \anchor{west}{
12134 \northwest
12135 \pgf@y=0pt
12136 }
12137 \anchor{south}{
12138 \northwest
12139 \pgf@x=0pt
12140 \pgf@y=-\pgf@y
12141 }
12142 \anchor{north}{
12143 \northwest
12144 \pgf@x=0pt
12145 }
12146 \anchor{south west}{
12147 \northwest
12148 \pgf@y=-\pgf@y
12149 }
12150 \anchor{north east}{
12151 \northwest
12152 \pgf@x=-\pgf@x
12153 }
12154 \anchor{north west}{
12155 \northwest
12156 }
12157 \anchor{south east}{
12158 \northwest
12159 \pgf@x=-\pgf@x
12160 \pgf@y=-\pgf@y
12161 }
12162 \backgroundpath{
12163 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12164
12165 \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
12166
12167 \pgfscope
12168 \pgfstartlinewidth=\pgflinewidth
12169
12170 % draw outer box
12171 \ifpgf@circuit@boxed
12172 \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
12173 \fi
12174
12175 % draw outer circle
12176 \ifpgf@circuit@boxed{}
12177 \pgf@circ@res@step=.7\pgf@circ@res@step{}
12178 \pgfsetdash{}{0pt} % draw solid circle if boxed
12179 \else
12180 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12181 \fi
12182 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12183 \pgf@circ@draworfill
12184
12185 % inner arrow
12186 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
12187 \pgfsetlinewidth{\pgfstartlinewidth}
12188
12189 \pgfsetarrowsend{latex}
12190 \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
12191 \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
12192 \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
12193 \pgfusepath{draw}
12194
12195 \endpgfscope
12196 }
12197 }
12198
12199
12200 % Wilkinson divider
12201 \pgfdeclareshape{wilkinson}{
12202 \anchor{center}{
12203 \northwest
12204 \pgf@x=0pt
12205 \pgf@y=0pt
12206 }
12207 \savedanchor\northwest{%
12208 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@circ@Rlen
12209 \pgf@y=.5\pgf@y
12210 \pgf@x= \pgf@circ@Rlen
12211 \pgf@x=.5\pgf@x
12212 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
12213 }
12214 \anchor{north}{
12215 \northwest
12216 \pgf@x=0pt
12217 }
12218 \anchor{south}{
12219 \northwest
12220 \pgf@x=0pt
12221 \pgf@y=-\pgf@y
12222 }
12223 \anchor{west}{
12224 \northwest
12225 \pgf@y=0pt
12226 }
12227 \anchor{east}{
12228 \northwest
12229 \pgf@y=0pt
12230 \pgf@x=-\pgf@x
12231 }
12232 \anchor{south west}{
12233 \northwest
12234 \pgf@y=-\pgf@y
12235 }
12236 \anchor{north east}{
12237 \northwest
12238 \pgf@x=-\pgf@x
12239 }
12240 \anchor{north west}{
12241 \northwest
12242 }
12243 \anchor{south east}{
12244 \northwest
12245 \pgf@x=-\pgf@x
12246 \pgf@y=-\pgf@y
12247 }
12248 \anchor{in}{
12249 \northwest
12250 \pgf@y=0pt
12251 }
12252 \anchor{out1}{
12253 \northwest
12254 \pgf@x=-\pgf@x
12255 \pgf@y=-0.5\pgf@y
12256 }
12257 \anchor{out2}{
12258 \northwest
12259 \pgf@x=-\pgf@x
12260 \pgf@y=0.5\pgf@y
12261 }
12262 \anchor{text}{
12263 \northwest
12264 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
12265 \pgf@x=-.5\wd\pgfnodeparttextbox
12266 }
12267 \backgroundpath{
12268 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12269
12270 \northwest
12271 \pgf@circ@res@up = \pgf@y
12272 \pgf@circ@res@down = -\pgf@y
12273 \pgf@circ@res@right = -\pgf@x
12274 \pgf@circ@res@left = \pgf@x
12275
12276 \pgfstartlinewidth=\pgflinewidth
12277
12278 % draw outer box
12279 \pgf@circ@twoportbox
12280
12281 % draw inner stuff
12282 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
12283 \pgfsetarrows{-} %never draw arrows
12284 \pgfsetlinewidth{\pgfstartlinewidth}
12285 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
12286 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
12287 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
12288 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
12289 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
12290 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
12291 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
12292
12293 \pgfusepath{draw}
12294
12295 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
12296 % draw inner resisitor - european or american style is recognised
12297 {
12298 \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
12299 \pgftransformrotate{90}
12300
12301 % calculate size of resistor
12302 \ifpgf@circuit@europeanresistor
12303 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
12304 \pgftransformscale{\pgfmathresult}
12305 \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
12306 \else
12307 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
12308 \pgftransformscale{\pgfmathresult}
12309 \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
12310 \fi
12311 }
12312
12313 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
12314 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
12315
12316 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
12317 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
12318 \pgfusepath{draw}
12319
12320 }
12321 }
12322
12323 % electromechanical device (motor/generator)
12324 \pgfdeclareshape{elmech}
12325 {
12326 \savedanchor\northwest{
12327 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@circ@Rlen
12328 \pgf@y=.5\pgf@y
12329 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@circ@Rlen
12330 \pgf@x=.5\pgf@x
12331 }
12332 \anchor{center}{
12333 \pgfpointorigin
12334 }
12335 \anchor{text}{
12336 \pgfpointorigin
12337 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
12338 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
12339 }
12340 \anchor{left}{%
12341 \northwest
12342 \pgf@y=0pt
12343 }
12344 \anchor{right}{%
12345 \northwest
12346 \pgf@y=0pt
12347 \pgf@x=-\pgf@x
12348 }
12349 \anchor{top}{
12350 \northwest
12351 \pgf@x=0pt
12352 }
12353 \anchor{pathstart}{
12354 \northwest
12355 \pgf@x=0pt
12356 }
12357 \anchor{pathend}{
12358 \northwest
12359 \pgf@x=0pt
12360 \pgf@y=-\pgf@y
12361 }
12362 \anchor{bottom}{
12363 \northwest
12364 \pgf@x=0pt
12365 \pgf@y=-\pgf@y
12366 }
12367 \anchor{center}{
12368 \pgf@y=0pt
12369 \pgf@x=0pt
12370 }
12371 \anchor{east}{
12372 \northwest
12373 \pgf@y=0pt
12374 \pgf@x=-\pgf@x
12375 }
12376 \anchor{west}{
12377 \northwest
12378 \pgf@y=0pt
12379 }
12380 \anchor{south}{
12381 \northwest
12382 \pgf@x=0pt
12383 \pgf@y=-\pgf@y
12384 }
12385 \anchor{north}{
12386 \northwest
12387 \pgf@x=0pt
12388 }
12389 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12390 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12391 \anchor{north west}{ \northwest }
12392 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12393 \backgroundpath{
12394 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12395 \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen
12396 \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
12397 \pgfscope
12398 \pgfstartlinewidth=\pgflinewidth
12399 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12400 \pgfscope % clip the bar: whole size minus the circle
12401 \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
12402 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12403 \pgfseteorule
12404 \pgfusepath{clip}
12405 \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
12406 \pgfsetfillcolor{black}
12407 \pgfusepath{fill, draw}
12408 \endpgfscope
12409 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
12410 \ifx\tikz@fillcolor\pgfutil@empty
12411 \pgfsetfillcolor{white}
12412 \else
12413 \pgfsetfillcolor{\tikz@fillcolor}
12414 \fi
12415 \pgfusepath{draw, fill}
12416 \endpgfscope
12417 }
12418 }
12419
12420 \pgfdeclareshape{magnetron}
12421 {
12422 \savedanchor\northwest{
12423 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
12424 \pgf@y=.5\pgf@y
12425 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
12426 \pgf@x=.5\pgf@x
12427 }
12428 \anchor{center}{
12429 \pgfpointorigin
12430 }
12431 \anchor{anode}{
12432 \northwest
12433 \pgf@x=0pt
12434 \pgf@y=-\pgf@y
12435 }
12436 \anchor{cathode1}{
12437 \northwest
12438 \pgf@circ@res@step=\pgf@y
12439 \pgfmathparse{cos(105)}
12440 \pgf@x=\pgfmathresult\pgf@circ@res@step
12441 \pgfmathparse{sin(105)}
12442 \pgf@y=\pgfmathresult\pgf@circ@res@step
12443 %\pgfpointorigin
12444 %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
12445 }
12446 \anchor{cathode2}{
12447 \northwest
12448 \pgf@circ@res@step=\pgf@y
12449 \pgfmathparse{cos(75)}
12450 \pgf@x=\pgfmathresult\pgf@circ@res@step
12451 \pgfmathparse{sin(75)}
12452 \pgf@y=\pgfmathresult\pgf@circ@res@step
12453 %\pgfpointorigin
12454 %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
12455 }
12456 \anchor{text}{
12457 \pgfpointorigin
12458 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
12459 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
12460 }
12461 \anchor{left}{%
12462 \northwest
12463 \pgf@y=0pt
12464 }
12465 \anchor{right}{%
12466 \northwest
12467 \pgf@y=0pt
12468 \pgf@x=-\pgf@x
12469 }
12470 \anchor{top}{
12471 \northwest
12472 \pgf@x=0pt
12473 }
12474 \anchor{pathstart}{
12475 \northwest
12476 \pgf@x=0pt
12477 }
12478 \anchor{pathend}{
12479 \northwest
12480 \pgf@x=0pt
12481 \pgf@y=-\pgf@y
12482 }
12483 \anchor{bottom}{
12484 \northwest
12485 \pgf@x=0pt
12486 \pgf@y=-\pgf@y
12487 }
12488 \anchor{center}{
12489 \pgf@y=0pt
12490 \pgf@x=0pt
12491 }
12492 \anchor{east}{
12493 \northwest
12494 \pgf@y=0pt
12495 \pgf@x=-\pgf@x
12496 }
12497 \anchor{west}{
12498 \northwest
12499 \pgf@y=0pt
12500 }
12501 \anchor{south}{
12502 \northwest
12503 \pgf@x=0pt
12504 \pgf@y=-\pgf@y
12505 }
12506 \anchor{north}{
12507 \northwest
12508 \pgf@x=0pt
12509 }
12510 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12511 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12512 \anchor{north west}{ \northwest }
12513 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12514 \backgroundpath{
12515 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
12516 \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@Rlen
12517 \northwest
12518 \pgf@circ@res@up = \pgf@y
12519 \pgf@circ@res@down = -\pgf@y
12520 \pgf@circ@res@right = -\pgf@x
12521 \pgf@circ@res@left = \pgf@x
12522 \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
12523
12524 \pgfscope
12525 \pgfstartlinewidth=\pgflinewidth
12526 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
12527 %create outer circle
12528 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
12529 \pgf@circ@draworfill
12530 %create chambers
12531 \foreach \angle in {45,135,225,315}{
12532 \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
12533 \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
12534 }
12535 \pgfsetroundcap
12536 \pgfusepath{draw}
12537 \pgfscope
12538 %draw connection from outside
12539 %anode
12540 \pgfsetlinewidth{\pgfstartlinewidth}
12541 \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
12542 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
12543 %cathodes
12544 \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
12545 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12546 \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
12547 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12548 \pgfsetbuttcap
12549 \pgfusepath{draw}
12550 \endpgfscope
12551 %create cathode
12552 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12553 \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
12554 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
12555 \pgfusepath{draw}
12556 %create anode
12557 \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
12558 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
12559
12560 \pgfsetbuttcap
12561 \pgfusepath{draw}
12562 \endpgfscope
12563 }
12564 }
12565
12566 % Electronic tubes, submitted by J. op den Brouw
12567
12568 % Draw tube outline
12569 \def\pgf@circ@tubes@drawtube{%
12570 \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
12571 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12572 \pgfutil@tempdima=\pgf@circ@res@right
12573 \advance\pgfutil@tempdima by -\pgf@circ@res@up
12574 \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
12575 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
12576 \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
12577 \pgfpatharc{270}{90}{\pgf@circ@res@up}
12578 \else
12579 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
12580 \pgfutil@tempdima=\pgf@circ@res@up
12581 \advance\pgfutil@tempdima by -\pgf@circ@res@right
12582 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12583 \pgfpatharc{180}{0}{\pgf@circ@res@right}
12584 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
12585 \pgfpatharc{180}{0}{-\pgf@circ@res@right}
12586 \fi
12587 \pgfpathclose
12588 }
12589
12590 %% The diode (tube), triode, tetrode and pentode only differ in the
12591 %% number of grids. So we construct a generic declare function in
12592 %% which we can put code for the grid anchors and grid drawing code
12593 %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
12594 \long\def\pgfcircdeclaretube#1#2#3{%
12595 \pgfdeclareshape{#1}{
12596 \anchor{center}{
12597 \pgfpointorigin
12598 }
12599 \savedanchor\northwest{%
12600 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12601 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12602 % x and y should be half the Rlen
12603 \pgf@y=\pgf@circ@res@up
12604 \pgf@y=.5\pgf@y
12605 \pgf@x=-\pgf@circ@res@right
12606 \pgf@x=.5\pgf@x
12607 }
12608 \anchor{north} {%
12609 \northwest
12610 \pgf@x=0pt
12611 }
12612 \anchor{east}{%
12613 \northwest
12614 \pgf@x=-\pgf@x
12615 \pgf@y=0pt
12616 }
12617 \anchor{south}{%
12618 \northwest
12619 \pgf@y=-\pgf@y
12620 \pgf@x=0pt
12621 }
12622 \anchor{west}{%
12623 \northwest
12624 \pgf@y=0pt
12625 }
12626 \anchor{north west}{%
12627 \northwest
12628 }
12629 \anchor{north east}{%
12630 \northwest
12631 \pgf@x=-\pgf@x
12632 }
12633 \anchor{south east}{
12634 \northwest
12635 \pgf@x=-\pgf@x
12636 \pgf@y=-\pgf@y
12637 }
12638 \anchor{south west}{
12639 \northwest
12640 \pgf@y=-\pgf@y
12641 }
12642 \anchor{anode} {%
12643 \northwest
12644 \pgf@x=0pt
12645 }
12646 \anchor{cathode}{%
12647 \northwest
12648 \pgf@y=-\pgf@y
12649 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
12650 }
12651 \anchor{cathode 1}{%
12652 \northwest
12653 \pgf@y=-\pgf@y
12654 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
12655 }
12656 \anchor{cathode 2}{%
12657 \northwest
12658 \pgf@y=-\pgf@y
12659 \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
12660 }
12661 \anchor{filament 1}{%
12662 \northwest
12663 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12664 \pgf@x=\pgfmathresult\pgf@x
12665 \pgf@y=-\pgf@y
12666 }
12667 \anchor{filament 2}{%
12668 \northwest
12669 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12670 \pgf@x=-\pgfmathresult\pgf@x
12671 \pgf@y=-\pgf@y
12672 }
12673
12674 % Extra anchors
12675 #2
12676
12677 \backgroundpath{
12678 \pgfscope
12679 % Line width for tripoles
12680 \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
12681
12682 % Setup to draw tube
12683 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12684 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12685 \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
12686 \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12687
12688 % Tube fill color (if any)
12689 \ifx\tikz@fillcolor\pgfutil@empty
12690 \else
12691 \pgfscope
12692 \pgfsetfillcolor{\tikz@fillcolor}
12693 \pgf@circ@tubes@drawtube
12694 \pgfusepath{fill}
12695 \endpgfscope
12696 \fi
12697
12698 % Tube outline
12699 \pgf@circ@tubes@drawtube
12700
12701 % Setup to draw grid, filament, anode and cathode
12702 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
12703 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
12704 \pgf@circ@res@up=0.5\pgf@circ@res@up
12705 \pgf@circ@res@right=0.5\pgf@circ@res@right
12706
12707 % Grid drawing
12708 #3
12709
12710 % Filament (is not drawn by default)
12711 \ifpgf@circuit@tubes@filament
12712 \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
12713 \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
12714 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
12715 \pgf@xa=\pgfmathresult\pgf@circ@res@right
12716 \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
12717 \pgf@ya=\pgfmathresult\pgf@circ@res@up
12718 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
12719 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
12720 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
12721 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
12722 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
12723 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
12724 \pgf@circuit@tubes@filamentfalse
12725 \fi
12726
12727 % Anode (or plate)
12728 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
12729 \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12730 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12731 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
12732
12733 % Cathode
12734 \ifpgf@circuit@tubes@nocathode
12735 \pgf@circuit@tubes@nocathodefalse
12736 \else
12737 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
12738 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
12739 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
12740 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
12741 \ifpgf@circuit@tubes@fullcathode
12742 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
12743 \pgf@circuit@tubes@fullcathodefalse
12744 \else
12745 \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}}
12746 \fi
12747 \fi
12748
12749 % Draw the background
12750 \pgfusepath{draw}
12751
12752 \endpgfscope
12753 }
12754 }
12755 }
12756
12757 \pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
12758
12759 \pgfcircdeclaretube{triode}
12760 {
12761 \anchor{grid} {% should not be used
12762 \northwest
12763 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12764 }
12765 \anchor{control} {%
12766 \northwest
12767 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12768 }
12769 }
12770 {
12771 % Grid protrusion
12772 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12773 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12774 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12775 \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12776 % Grid dashes: calculations
12777 \pgf@xb=2\pgf@circ@res@right
12778 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12779 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12780 \multiply\pgf@circ@count@a by 2\relax
12781 \advance\pgf@circ@count@a by 1\relax
12782 \advance\pgf@circ@res@step by -\pgf@xa
12783 \divide\pgf@circ@res@step by \pgf@circ@count@a
12784 % Grid dashes: draw
12785 \pgf@circ@res@temp=\pgf@xa
12786 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12787 \loop
12788 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12789 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12790 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12791 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
12792 \advance\pgf@circ@count@a by-1
12793 \ifnum\pgf@circ@count@a>0\relax
12794 \repeat
12795 }
12796
12797 \pgfcircdeclaretube{tetrode}
12798 {
12799 \anchor{grid} {% should not be used
12800 \northwest
12801 \pgfutil@tempdima=\pgf@y
12802 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12803 \pgf@y=0.5\pgf@y
12804 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12805 }
12806 \anchor{control} {%
12807 \northwest
12808 \pgfutil@tempdima=\pgf@y
12809 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12810 \pgf@y=0.5\pgf@y
12811 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12812 }
12813 \anchor{screen} {%
12814 \northwest
12815 \pgfutil@tempdima=\pgf@y
12816 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
12817 \pgf@y=0.5\pgf@y
12818 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12819 }
12820 }
12821 {
12822 % Grid x/y points
12823 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12824 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12825 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12826 \pgfutil@tempdimb=-\pgfutil@tempdima
12827 \pgfutil@tempdima=0.5\pgfutil@tempdima
12828 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12829 \pgfutil@tempdimb=0.5\pgfutil@tempdimb
12830 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12831 % Grid protrusion
12832 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12833 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12834 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12835 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
12836 % Grid dashes: calculations
12837 \pgf@xb=2\pgf@circ@res@right
12838 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12839 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12840 \multiply\pgf@circ@count@a by 2\relax
12841 \advance\pgf@circ@count@a by 1\relax
12842 \advance\pgf@circ@res@step by -\pgf@xa
12843 \divide\pgf@circ@res@step by \pgf@circ@count@a
12844 % Grid dashes: draw
12845 \pgf@circ@res@temp=\pgf@xa
12846 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12847 \loop
12848 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12849 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12850 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12851 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12852 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12853 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12854 \advance\pgf@circ@count@a by-1
12855 \ifnum\pgf@circ@count@a>0\relax
12856 \repeat
12857 }
12858
12859 \pgfcircdeclaretube{pentode}
12860 {
12861 \anchor{grid} {% should not be used
12862 \northwest
12863 \pgfutil@tempdima=\pgf@y
12864 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12865 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12866 }
12867 \anchor{control} {%
12868 \northwest
12869 \pgfutil@tempdima=\pgf@y
12870 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12871 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12872 }
12873 \anchor{screen} {%
12874 \northwest
12875 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12876 }
12877 \anchor{suppressor} {%
12878 \northwest
12879 \pgfutil@tempdima=\pgf@y
12880 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
12881 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12882 }
12883 }
12884 {
12885 % Grid x/y points
12886 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12887 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12888 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12889 \pgfutil@tempdimb=-\pgfutil@tempdima
12890 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12891 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12892 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12893 % Grid protrusion
12894 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12895 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12896 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
12897 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
12898 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
12899 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
12900 % Grid dashes: calculations
12901 \pgf@xb=2\pgf@circ@res@right
12902 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12903 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12904 \multiply\pgf@circ@count@a by 2\relax
12905 \advance\pgf@circ@count@a by 1\relax
12906 \advance\pgf@circ@res@step by -\pgf@xa
12907 \divide\pgf@circ@res@step by \pgf@circ@count@a
12908 % Grid dashes: draw
12909 \pgf@circ@res@temp=\pgf@xa
12910 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12911 \loop
12912 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12913 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12914 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12915 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12916 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12917 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
12918 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
12919 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12920 \advance\pgf@circ@count@a by-1
12921 \ifnum\pgf@circ@count@a>0\relax
12922 \repeat
12923 }
12924
12925 \pgfcircdeclaretube{pentode suppressor to cathode}
12926 {
12927 \anchor{grid} {% should not be used
12928 \northwest
12929 \pgfutil@tempdima=\pgf@y
12930 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12931 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12932 }
12933 \anchor{control} {%
12934 \northwest
12935 \pgfutil@tempdima=\pgf@y
12936 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
12937 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
12938 }
12939 \anchor{screen} {%
12940 \northwest
12941 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
12942 }
12943 }
12944 {
12945 % Grid x/y points
12946 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
12947 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
12948 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
12949 \pgfutil@tempdimb=-\pgfutil@tempdima
12950 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12951 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12952 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
12953 % Grid protrusion
12954 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
12955 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
12956 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
12957 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
12958 % Grid dashes: calculations
12959 \pgf@xb=2\pgf@circ@res@right
12960 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
12961 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
12962 \multiply\pgf@circ@count@a by 2\relax
12963 \advance\pgf@circ@count@a by 1\relax
12964 \advance\pgf@circ@res@step by -\pgf@xa
12965 \divide\pgf@circ@res@step by \pgf@circ@count@a
12966 % Grid dashes: draw
12967 \pgf@circ@res@temp=\pgf@xa
12968 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
12969 \loop
12970 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12971 \ifnum\pgf@circ@count@a>1\relax
12972 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
12973 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
12974 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
12975 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
12976 \fi
12977 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
12978 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
12979 \advance\pgf@circ@res@temp by\pgf@circ@res@step
12980 \advance\pgf@circ@count@a by-1
12981 \ifnum\pgf@circ@count@a>0\relax
12982 \repeat
12983 % Grid: connection from suppressor to cathode
12984 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
12985 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
12986 \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}}
12987
12988 }
12989
12990 %%%---------- close: tex/pgfcirctripoles
12991 %%%%%%%%%%% Springe nach tex/pgfcircquadpoles
12992 %%%---------- open: tex/pgfcircquadpoles.tex
12993 % Copyright 2007-2009 by Massimo Redaelli
12994 %
12995 % This file may be distributed and/or modified
12996 %
12997 % 1. under the LaTeX Project Public License and/or
12998 % 2. under the GNU Public License.
12999 %
13000 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
13001
13002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13003 %% Quadripoles
13004
13005 \long\def\pgfcircdeclarequadpole#1#2#3{
13006 \pgfdeclareshape{#1}
13007 {
13008 \anchor{center}{
13009 \northwest
13010 \pgf@x=0pt
13011 \pgf@y=0pt
13012 }
13013 \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
13014 \savedanchor\northwest{%
13015 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
13016 \pgf@y=.5\pgf@y
13017 \pgf@x=.5\pgf@circ@Rlen
13018 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
13019 }
13020 \anchor{A2}{
13021 \northwest
13022 \pgf@y=-\pgf@y
13023 }
13024 \anchor{B1}{
13025 \northwest
13026 \pgf@x=-\pgf@x
13027 }
13028 \anchor{A1}{
13029 \northwest
13030 }
13031 \anchor{B2}{
13032 \northwest
13033 \pgf@x=-\pgf@x
13034 \pgf@y=-\pgf@y
13035 }
13036 %% notice for the dot anchors: I use the cute inductors as reference
13037 %% size; if you change one you have to change all of them.
13038 \anchor{inner dot A1}{
13039 \northwest
13040 \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
13041 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13042 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
13043 }
13044 \anchor{outer dot A1}{
13045 \northwest
13046 \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
13047 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13048 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
13049 }
13050 \anchor{inner dot A2}{
13051 \northwest
13052 \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
13053 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13054 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
13055 }
13056 \anchor{outer dot A2}{
13057 \northwest
13058 \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
13059 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13060 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
13061 }
13062 \anchor{inner dot B1}{
13063 \northwest
13064 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
13065 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13066 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
13067 }
13068 \anchor{outer dot B1}{
13069 \northwest
13070 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
13071 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13072 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
13073 }
13074 \anchor{inner dot B2}{
13075 \northwest
13076 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
13077 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13078 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
13079 }
13080 \anchor{outer dot B2}{
13081 \northwest
13082 \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
13083 \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
13084 \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
13085 }
13086 \anchor{north}{
13087 \northwest
13088 \pgf@x=0pt
13089 }
13090 \anchor{south}{
13091 \northwest
13092 \pgf@x=0pt
13093 \pgf@y=-\pgf@y
13094 }
13095 \anchor{west}{
13096 \northwest
13097 \pgf@y=0pt
13098 }
13099 \anchor{east}{
13100 \northwest
13101 \pgf@y=0pt
13102 \pgf@x=-\pgf@x
13103 }
13104 \anchor{south west}{
13105 \northwest
13106 \pgf@y=-\pgf@y
13107 }
13108 \anchor{north east}{
13109 \northwest
13110 \pgf@x=-\pgf@x
13111 }
13112 \anchor{north west}{
13113 \northwest
13114 }
13115 \anchor{south east}{
13116 \northwest
13117 \pgf@x=-\pgf@x
13118 \pgf@y=-\pgf@y
13119 }
13120 \anchor{base}{
13121 \northwest
13122 \pgf@x=0pt
13123 }
13124 #3
13125 \backgroundpath{
13126 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13127
13128 \northwest
13129 \pgf@circ@res@up = \pgf@y
13130 \pgf@circ@res@down = -\pgf@y
13131 \pgf@circ@res@right = -\pgf@x
13132 \pgf@circ@res@left = \pgf@x
13133 #2
13134 }
13135 }
13136 }
13137
13138
13139 \def\pgf@circ@drawtransformerbasicanchor{
13140 \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
13141 \anchor{AA2}{
13142 \northwest
13143 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
13144 \pgf@x=.7\pgf@x
13145 \pgf@y=-\pgf@y
13146 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
13147 }
13148 \anchor{BB1}{
13149 \northwest
13150 \pgf@x=-\pgf@x
13151 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
13152 \pgf@x=.7\pgf@x
13153 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
13154 }
13155 \anchor{AA1}{
13156 \northwest
13157 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
13158 \pgf@x=.7\pgf@x
13159 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
13160 }
13161 \anchor{BB2}{
13162 \northwest
13163 \pgf@x=-\pgf@x
13164 \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
13165 \pgf@x=.7\pgf@x
13166 \pgf@y=-\pgf@y
13167 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
13168 }
13169 }
13170
13171 \def\pgf@circ@drawtransformerbasicbody{
13172 \pgfscope
13173 \pgfslopedattimetrue
13174 \pgfallowupsidedownattimetrue
13175 \pgftransformlineattime{.5}{%
13176 \pgfpoint%
13177 {\stretto\pgf@circ@res@left}%
13178 {\pgf@circ@res@up}%
13179 }{%
13180 \pgfpoint
13181 {\stretto\pgf@circ@res@left}%
13182 {\pgf@circ@res@down}%
13183 }
13184
13185 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
13186 \def\pgf@temp{european}%
13187 \ifx\pgf@temp\pgf@circ@temp%
13188 \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
13189 \else%
13190 \def\pgf@temp{cute}
13191 \ifx\pgf@temp\pgf@circ@temp%
13192 \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
13193 \else%
13194 \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
13195 \fi%
13196 \fi%
13197
13198
13199 \endpgfscope
13200 \pgfscope
13201 \pgfslopedattimetrue
13202 \pgfallowupsidedownattimetrue
13203 \pgftransformlineattime{.5}{%
13204 \pgfpoint%
13205 {\stretto\pgf@circ@res@right}%
13206 {\pgf@circ@res@down}%
13207 }{%
13208 \pgfpoint
13209 {\stretto\pgf@circ@res@right}%
13210 {\pgf@circ@res@up}%
13211 }
13212
13213 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
13214 \def\pgf@temp{european}%
13215 \ifx\pgf@temp\pgf@circ@temp%
13216 \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
13217 \else%
13218 \def\pgf@temp{cute}
13219 \ifx\pgf@temp\pgf@circ@temp%
13220 \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
13221 \else%
13222 \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
13223 \fi%
13224 \fi%
13225
13226 \endpgfscope
13227
13228 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
13229 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
13230 \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
13231
13232 \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
13233 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
13234 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
13235
13236 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
13237 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
13238 \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
13239
13240 \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
13241 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
13242 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
13243
13244 \pgfusepath{draw}
13245
13246 }
13247
13248
13249 \pgfcircdeclarequadpole{transformer}{
13250 \pgf@circ@drawtransformerbasicbody
13251 }{\pgf@circ@drawtransformerbasicanchor}
13252
13253 \pgfcircdeclarequadpole{transformer core}{
13254
13255 \pgf@circ@drawtransformerbasicbody
13256
13257 \pgfmoveto{\pgfpoint%
13258 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
13259 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
13260 }
13261 \pgflineto{
13262 \pgfpoint
13263 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
13264 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
13265 }
13266
13267 \pgfmoveto{\pgfpoint%
13268 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
13269 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
13270 }
13271 \pgflineto{
13272 \pgfpoint
13273 {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
13274 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
13275 }
13276
13277 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
13278 \pgfusepath{draw}
13279 }{\pgf@circ@drawtransformerbasicanchor}
13280
13281
13282 \pgfcircdeclarequadpole{gyrator}{
13283
13284 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
13285 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
13286 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
13287 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
13288
13289 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
13290 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
13291 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
13292 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
13293
13294 \pgfusepath{draw}
13295
13296 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
13297 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
13298 \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
13299
13300 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
13301 \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
13302 \pgfusepath{draw}
13303
13304 }{}
13305
13306 %% four-port
13307 % defines a general outer box for four-ports
13308 % TikZ usage:
13309 % \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
13310 % (coup.port1) to[short,-o] ++(-1,0)
13311 %
13312
13313 \long\def\pgfcircdeclarefourport#1#2{
13314 \pgfdeclareshape{#1}{
13315 \anchor{center}{
13316 \northwest
13317 \pgf@x=0pt
13318 \pgf@y=0pt
13319 }
13320 \savedanchor\northwest{%
13321 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
13322 \pgf@y=.5\pgf@y
13323 \pgf@x=.5\pgf@circ@Rlen
13324 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
13325 }
13326 \anchor{north}{
13327 \northwest
13328 \pgf@x=0pt
13329 }
13330 \anchor{south}{
13331 \northwest
13332 \pgf@x=0pt
13333 \pgf@y=-\pgf@y
13334 }
13335 \anchor{west}{
13336 \northwest
13337 \pgf@y=0pt
13338 }
13339 \anchor{east}{
13340 \northwest
13341 \pgf@y=0pt
13342 \pgf@x=-\pgf@x
13343 }
13344 \anchor{south west}{
13345 \northwest
13346 \pgf@y=-\pgf@y
13347 }
13348 \anchor{north east}{
13349 \northwest
13350 \pgf@x=-\pgf@x
13351 }
13352 \anchor{north west}{
13353 \northwest
13354 }
13355 \anchor{south east}{
13356 \northwest
13357 \pgf@x=-\pgf@x
13358 \pgf@y=-\pgf@y
13359 }
13360 \anchor{port1}{
13361 \northwest
13362 \pgf@y=-0.5\pgf@y
13363 }
13364 \anchor{port2}{
13365 \northwest
13366 \pgf@x=-\pgf@x
13367 \pgf@y=-0.5\pgf@y
13368 }
13369 \anchor{port3}{
13370 \northwest
13371 \pgf@x=-\pgf@x
13372 \pgf@y=0.5\pgf@y
13373 }
13374 \anchor{port4}{
13375 \northwest
13376 \pgf@y=0.5\pgf@y
13377 }
13378 \anchor{1}{
13379 \northwest
13380 \pgf@y=-0.5\pgf@y
13381 }
13382 \anchor{2}{
13383 \northwest
13384 \pgf@x=-\pgf@x
13385 \pgf@y=-0.5\pgf@y
13386 }
13387 \anchor{3}{
13388 \northwest
13389 \pgf@x=-\pgf@x
13390 \pgf@y=0.5\pgf@y
13391 }
13392 \anchor{4}{
13393 \northwest
13394 \pgf@y=0.5\pgf@y
13395 }
13396
13397 \anchor{text}{
13398 \northwest
13399 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
13400 \pgf@x=-.5\wd\pgfnodeparttextbox
13401 }
13402 \backgroundpath{
13403 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13404
13405 \northwest
13406 \pgf@circ@res@up = \pgf@y
13407 \pgf@circ@res@down = -\pgf@y
13408 \pgf@circ@res@right = -\pgf@x
13409 \pgf@circ@res@left = \pgf@x
13410
13411 \pgfstartlinewidth=\pgflinewidth
13412
13413 % draw outer box
13414 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
13415 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
13416 \pgfusepath{draw}
13417
13418 % draw inner stuff
13419 #2
13420
13421 % draw inner text
13422 \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
13423 }
13424 }
13425 }
13426
13427 % four-port
13428 \pgfcircdeclarefourport{fourport}{}
13429
13430
13431 % straight coupler
13432 \pgfcircdeclarefourport{coupler}{
13433 \pgfsetlinewidth{\pgfstartlinewidth}
13434 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
13435 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
13436 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
13437 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
13438 \pgfusepath{draw}
13439
13440 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
13441 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
13442 \pgfsetarrows{latex-latex}
13443 \pgfusepath{draw}
13444 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
13445 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
13446 \pgfsetarrows{latex-latex}
13447 \pgfusepath{draw}
13448 }
13449
13450 % "bended" coupler
13451 \pgfcircdeclarefourport{coupler2}{
13452 \pgfsetlinewidth{\pgfstartlinewidth}
13453 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
13454 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
13455 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
13456 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
13457 \pgfusepath{draw}
13458
13459 \pgfscope
13460 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
13461 \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
13462 \pgfsetarrowsend{latex}
13463 \pgfusepath{draw}
13464 \endpgfscope
13465 \pgfscope
13466 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
13467 \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
13468 \pgfsetarrowsend{latex}
13469 \pgfusepath{draw}
13470 \endpgfscope
13471 \pgfscope
13472 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
13473 \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
13474 \pgfsetarrowsend{latex}
13475 \pgfusepath{draw}
13476 \endpgfscope
13477 \pgfscope
13478 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
13479 \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
13480 \pgfsetarrowsend{latex}
13481 \pgfusepath{draw}
13482 \endpgfscope
13483 }
13484
13485 % contrib Kristofer M. Monisit
13486
13487 \pgfdeclareshape{fd op amp}
13488 {
13489 \anchor{center}{\pgfpointorigin}
13490 \savedanchor\northwest{%
13491 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13492 \pgf@y=.5\pgf@y
13493 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13494 \pgf@x=.5\pgf@x
13495 }
13496 \savedanchor\outline{%
13497 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13498 \pgf@y=.5\pgf@y
13499 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13500 \pgf@x=.5\pgf@x
13501 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
13502 }
13503 \anchor{south}{
13504 \northwest
13505 \pgf@y=-\pgf@y\pgf@x=0pt\relax
13506 }
13507 \anchor{north}{
13508 \northwest\pgf@x=0pt\relax
13509 }
13510 \savedanchor\left{%
13511 \pgf@y=0pt
13512 }
13513 \savedanchor\inOneFixed{%
13514 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13515 \pgf@y=.5\pgf@y
13516 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13517 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13518 \pgf@x=.5\pgf@x
13519 }
13520 \anchor{in up}{
13521 \inOneFixed
13522 }
13523 \anchor{in down}{
13524 \inOneFixed
13525 \pgf@y=-\pgf@y
13526 }
13527 \savedanchor\inOne{%
13528 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13529 \pgf@y=.5\pgf@y
13530 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13531 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13532 \pgf@x=.5\pgf@x
13533 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13534 }
13535 \anchor{-}{
13536 \inOne
13537 }
13538 \anchor{+}{
13539 \inOne
13540 \pgf@y=-\pgf@y
13541 }
13542 \savedanchor\up{%
13543 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13544 \pgf@y=.5\pgf@y
13545 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13546 \pgf@x=.5\pgf@x
13547 \pgf@circ@res@up = \pgf@y
13548 \pgf@circ@res@right = -\pgf@x
13549 \pgf@circ@res@left = \pgf@x
13550 \pgfpointlineattime{
13551 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
13552 \pgfpoint{
13553 \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13554 {\pgf@circ@res@up}}
13555 {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
13556 }
13557 \anchor{up}{
13558 \up
13559 }
13560 \anchor{down}{
13561 \up
13562 \pgf@y=-\pgf@y
13563 }
13564 \anchor{out up}{
13565 \northwest
13566 \pgf@y=.5\pgf@y
13567 \pgf@x=-.7\pgf@x
13568 }
13569 \anchor{out down}{
13570 \northwest
13571 \pgf@y=-.5\pgf@y
13572 \pgf@x=-.7\pgf@x
13573 }
13574 \anchor{out +}{
13575 \outline
13576 \pgf@y=.5\pgf@y
13577 \pgf@x=-.7\pgf@x
13578 }
13579 \anchor{out -}{
13580 \outline
13581 \pgf@y=-.5\pgf@y
13582 \pgf@x=-.7\pgf@x
13583 }
13584 \anchor{west}{
13585 \left
13586 }
13587 \anchor{east}{
13588 \left
13589 \pgf@x=-.7\pgf@x
13590 }
13591
13592 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13593 \anchor{north east}{ \northwest \pgf@x=-.7\pgf@x }
13594 \anchor{north west}{ \northwest }
13595 \anchor{south east}{ \northwest \pgf@x=-.7\pgf@x \pgf@y=-\pgf@y }
13596 \backgroundpath{
13597 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13598
13599 \northwest
13600 \pgf@circ@res@up = \pgf@y
13601 \pgf@circ@res@down = -\pgf@y
13602 \pgf@circ@res@right = -\pgf@x
13603 \pgf@circ@res@left = \pgf@x
13604
13605 % Triangle
13606 \pgfscope
13607 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
13608 \pgftransformxshift{.7\pgf@circ@res@left}
13609 \pgf@circ@res@step=\pgf@circ@res@right
13610 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13611 \pgf@circ@res@step=.7\pgf@circ@res@step
13612 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13613 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13614 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13615 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13616 \pgfpathclose
13617 \pgf@circ@draworfill
13618 \endpgfscope
13619 % Negative input terminal
13620 \pgfpathmoveto{\pgfpoint
13621 {\pgf@circ@res@left}
13622 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13623 \pgfpathlineto{\pgfpoint
13624 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13625 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13626 \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}
13627
13628 % Positive input terminal
13629 \pgfpathmoveto{\pgfpoint
13630 {\pgf@circ@res@left}
13631 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13632 \pgfpathlineto{\pgfpoint
13633 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
13634 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13635 \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}
13636
13637 % Negative output terminal
13638 \pgfpathmoveto{\pgfpoint
13639 {0.7\pgf@circ@res@right}
13640 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13641 \pgfpathlineto{\pgfpoint
13642 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
13643 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
13644 \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}
13645
13646 % Positive output terminal
13647 \pgfpathmoveto{\pgfpoint
13648 {0.7\pgf@circ@res@right}
13649 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13650 \pgfpathlineto{\pgfpoint
13651 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
13652 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
13653 \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}
13654
13655 \pgfsetrectcap
13656 % Draw them all!
13657 \pgfusepath{draw}
13658
13659 }
13660 }
13661
13662
13663 %% instrumentation amplifier diff output
13664
13665 \pgfdeclareshape{fd inst amp}
13666 {
13667 % when tikz calls the anchor it wants the relative position in the lengths
13668 % \pgf@x \pgf@y
13669 % \pgfpoint* functions set that variables
13670 % anchors are visible outside and run on use
13671 \anchor{center}{\pgfpointorigin}
13672 % savedanchors are internals and run on node creation (not use)
13673 % bounding-box top left
13674 \savedanchor\northwest{%
13675 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13676 \pgf@y=.5\pgf@y
13677 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13678 \pgf@x=.5\pgf@x
13679 }
13680 \anchor{nw}{
13681 \northwest
13682 }
13683 \anchor{south}{
13684 \northwest
13685 \pgf@y=-\pgf@y\pgf@x=0pt\relax
13686 }
13687 \anchor{north}{
13688 \northwest\pgf@x=0pt\relax
13689 }
13690 \savedanchor\left{%
13691 \pgf@y=0pt
13692 }
13693 \anchor{leftedge}
13694 {\left
13695 \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
13696 }
13697 \savedanchor\inOneFixed{%
13698 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
13699 \pgf@y=.5\pgf@y
13700 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
13701 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
13702 \pgf@x=.5\pgf@x
13703 }
13704 \anchor{in up}{
13705 \inOneFixed
13706 }
13707 \anchor{in down}{
13708 \inOneFixed
13709 \pgf@y=-\pgf@y
13710 }
13711 \savedanchor\inOne{%
13712 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13713 \pgf@y=.5\pgf@y
13714 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13715 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13716 \pgf@x=.5\pgf@x
13717 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13718 }
13719 \anchor{-}{
13720 \inOne
13721 }
13722 \anchor{+}{
13723 \inOne
13724 \pgf@y=-\pgf@y
13725 }
13726 \savedanchor\up{%
13727 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13728 \pgf@y=.5\pgf@y
13729 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13730 \pgf@x=.5\pgf@x
13731 \pgf@circ@res@up = \pgf@y
13732 \pgf@circ@res@right = -\pgf@x
13733 \pgf@circ@res@left = \pgf@x
13734 \pgfpointlineattime{
13735 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/up pos}}{
13736 \pgfpoint{
13737 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13738 {\pgf@circ@res@up}}
13739 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13740 }
13741 \anchor{up}{
13742 \up
13743 }
13744 \anchor{down}{
13745 \up
13746 \pgf@y=-\pgf@y
13747 }
13748 % reference voltage input anchors.
13749 \savedanchor\refv{%
13750 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13751 \pgf@y=.5\pgf@y
13752 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13753 \pgf@x=.5\pgf@x
13754 \pgf@circ@res@up = \pgf@y
13755 \pgf@circ@res@right = -\pgf@x
13756 \pgf@circ@res@left = \pgf@x
13757 \pgfpointlineattime{
13758 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/refv pos}}{
13759 \pgfpoint{
13760 \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13761 {\pgf@circ@res@up}}
13762 {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13763 }
13764 % we need both because they are normally drawn under the amp, and if you
13765 % mirror it vertically you need them
13766 \anchor{refv up}{
13767 \refv
13768 }
13769 \anchor{refv down}{
13770 \refv
13771 \pgf@y=-\pgf@y
13772 }
13773 \savedanchor\outport{
13774 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13775 \pgf@y=.5\pgf@y
13776 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13777 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13778 \pgf@x=-.5\pgf@x
13779 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
13780 }
13781 \anchor{out}{
13782 \outport
13783 \pgf@y=0pt
13784 }
13785 \anchor{out +}{
13786 \outport
13787 }
13788 \anchor{out -}{
13789 \outport
13790 \pgf@y=-\pgf@y
13791 }
13792 \savedanchor\outportfixed{
13793 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
13794 \pgf@y=.5\pgf@y
13795 \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
13796 \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
13797 \pgf@x=-.5\pgf@x
13798 }
13799 \anchor{out up}{
13800 \outportfixed
13801 }
13802 \anchor{out down}{
13803 \outportfixed
13804 \pgf@y=-\pgf@y
13805 }
13806 %
13807 \anchor{west}{
13808 \left
13809 }
13810 \anchor{east}{
13811 \left
13812 \pgf@x=-\pgf@x
13813 }
13814 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13815 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13816 \anchor{north west}{ \northwest }
13817 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13818 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13819
13820 % let's start drawing the component
13821 \backgroundpath{
13822 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13823 %
13824 \northwest
13825 \pgf@circ@res@up = \pgf@y
13826 \pgf@circ@res@down = -\pgf@y
13827 \pgf@circ@res@right = -\pgf@x
13828 \pgf@circ@res@left = \pgf@x
13829 % main component, normally in thicker lines
13830 \pgfscope
13831 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
13832 \pgftransformxshift{.7\pgf@circ@res@left}
13833 \pgf@circ@res@step=\pgf@circ@res@right
13834 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13835 \pgf@circ@res@step=.7\pgf@circ@res@step
13836 %first point (near output)
13837 \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
13838 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
13839 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
13840 % and then to the input "front up", "down", to the output short side "down"
13841 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13842 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13843 \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
13844 % ...and close
13845 \pgfpathclose
13846 \pgf@circ@draworfill
13847 \endpgfscope
13848 % input terminal up
13849 \pgfpathmoveto{\pgfpoint
13850 {\pgf@circ@res@left}
13851 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13852 %
13853 \pgfpathlineto{\pgfpoint
13854 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13855 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13856 %
13857 \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}
13858
13859 % input terminal down
13860 \pgfpathmoveto{\pgfpoint
13861 {\pgf@circ@res@left}
13862 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13863 %
13864 \pgfpathlineto{\pgfpoint
13865 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
13866 {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13867 \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}
13868 % output leads down and up
13869 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13870 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}} %
13871 \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}
13872 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13873 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}} %
13874 \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}
13875 %
13876 \pgfsetrectcap
13877 \pgfusepath{draw}
13878 }
13879 }
13880 %%%---------- close: tex/pgfcircquadpoles
13881 %%%%%%%%%%% Springe nach tex/pgfcircmultipoles
13882 %%%---------- open: tex/pgfcircmultipoles.tex
13883 % Copyright 2007-2009 by Massimo Redaelli
13884 % Copyright 2019 by Romano Giannetti
13885 %
13886 % This file may be distributed and/or modified
13887 %
13888 % 1. under the LaTeX Project Public License and/or
13889 % 2. under the GNU Public License.
13890 %
13891 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
13892
13893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13894 %% Multipoles
13895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13896
13897 % counters for pin accounting...
13898 \def\pgf@circ@dip@pin@shift{0.5}
13899 \def\pgf@circ@qfp@pin@shift{0.25}
13900
13901 % derived from https://tex.stackexchange.com/a/146753/38080
13902 % original author Mark Wibrow
13903 % Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
13904 % a lot of thanks to @marmot for the un-rotation hint
13905 % https://tex.stackexchange.com/a/473571/38080
13906
13907 % DIP (dual in line package) chips
13908
13909 \pgfdeclareshape{dipchip}{
13910 \savedmacro\numpins{%
13911 \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
13912 \def\numpins{\the\pgf@circ@count@a}
13913 }
13914 \savedanchor\centerpoint{%
13915 \pgf@x=-.5\wd\pgfnodeparttextbox%
13916 \pgf@y=-.5\ht\pgfnodeparttextbox%
13917 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
13918 }%
13919 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
13920 \anchor{center}{\origin}
13921 \anchor{text}{\centerpoint}% to adjust text
13922 \saveddimen\height{%
13923 \pgfmathsetlength\pgf@x{((\numpins)
13924 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
13925 }%
13926 \saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}}}
13927 \saveddimen{\width}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}}
13928 \saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
13929 % standard anchors
13930 \savedanchor\northwest{%
13931 \pgfmathsetlength\pgf@y{0.5*((\numpins)
13932 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
13933 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}
13934 }
13935 \anchor{dot}{\northwest
13936 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
13937 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
13938 }
13939 \anchor{nw}{\northwest}
13940 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
13941 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
13942 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
13943 \anchor{north west}{\northwest}
13944 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
13945 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
13946 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
13947 \anchor{n}{\northwest\pgf@x=0pt }
13948 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13949 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13950 \anchor{w}{\northwest\pgf@y=0pt }
13951 \anchor{north}{\northwest\pgf@x=0pt }
13952 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
13953 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
13954 \anchor{west}{\northwest\pgf@y=0pt }
13955 % start drawing
13956 \backgroundpath{%
13957 \northwest
13958 \pgf@circ@res@up = \pgf@y
13959 \pgf@circ@res@down = -\pgf@y
13960 \pgf@circ@res@right = -\pgf@x
13961 \pgf@circ@res@left = \pgf@x
13962 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}\pgf@circ@Rlen
13963 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
13964 \pgfscope% (for the line width)
13965 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
13966 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
13967 \pgf@circ@draworfill
13968 %% upside mark
13969 \ifpgf@circuit@chip@topmark
13970 \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
13971 \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
13972 \fi
13973 \pgfusepath{stroke}%
13974 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
13975 % Adding the pin number
13976 \ifpgf@circuit@chip@shownumbers
13977 \pgf@circ@count@a=\numpins\relax
13978 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
13979 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
13980 \ifpgf@circuit@chip@straightnumbers
13981 \pgfgettransformentries\a\b\temp\temp\temp\temp
13982 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
13983 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
13984 \else
13985 \pgfmathsetmacro{\rot}{0}
13986 \pgfmathsetmacro{\quadrant}{0}
13987 \fi
13988 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
13989 \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
13990 \pgfmathloop%
13991 \ifnum\pgf@circ@count@a>0
13992 \ifcase\quadrant % rotation 0
13993 % left
13994 \pgf@circ@count@c=\pgf@circ@count@a
13995 \pgftext[left,
13996 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
13997 rotate=\rot]{\mytext}
13998 % right
13999 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14000 \pgftext[right,
14001 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14002 rotate=\rot]{\mytext}
14003 \or % rotation -90
14004 % left
14005 \pgf@circ@count@c=\pgf@circ@count@a
14006 \pgftext[top,
14007 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14008 rotate=\rot]{\mytext}
14009 % right
14010 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14011 \pgftext[bottom,
14012 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14013 rotate=\rot]{\mytext}
14014 \or %rotation 180
14015 % left
14016 \pgf@circ@count@c=\pgf@circ@count@a
14017 \pgftext[right,
14018 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14019 rotate=\rot]{\mytext}
14020 % right
14021 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14022 \pgftext[left,
14023 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14024 rotate=\rot]{\mytext}
14025 \or % rotation +90
14026 % left
14027 \pgf@circ@count@c=\pgf@circ@count@a
14028 \pgftext[bottom,
14029 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14030 rotate=\rot]{\mytext}
14031 % right
14032 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14033 \pgftext[top,
14034 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14035 rotate=\rot]{\mytext}
14036 \fi
14037 \advance\pgf@circ@count@a-1\relax%
14038 \repeatpgfmathloop
14039 \fi
14040 \endpgfscope
14041 \ifdim\pgf@circ@res@other>0pt
14042 \pgfscope
14043 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
14044 \pgf@circ@count@a=\numpins\relax
14045 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
14046 \pgfmathloop%
14047 \ifnum\pgf@circ@count@a>0
14048 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
14049 \ifnum\padfrac>0
14050 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
14051 % left side pads
14052 \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}}
14053 \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}}
14054 \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}}
14055 \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}}
14056 % right side pads
14057 \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}}
14058 \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}}
14059 \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}}
14060 \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}}
14061 \else
14062 % left side pins
14063 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14064 \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}}
14065 % right side pins
14066 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14067 \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}}
14068 \fi
14069 \advance\pgf@circ@count@a by -1\relax%
14070 \repeatpgfmathloop
14071 \pgfusepath{stroke}
14072 \endpgfscope
14073 \fi
14074 }%
14075 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
14076 % and is executed just before a node is drawn.
14077 \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
14078 % Start with the maximum pin number and go backwards.
14079 \pgf@circ@count@a=\numpins\relax
14080 \pgfmathloop%
14081 \ifnum\pgf@circ@count@a>0
14082 % we will create two anchors per pin: the "normal one" like `pin 1` for the
14083 % electrical contact, and the "border one" like `bpin 1` for labels.
14084 % they will coincide if `external pins width` is set to 0.
14085 \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
14086 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
14087 }
14088 \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
14089 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
14090 }
14091 \advance\pgf@circ@count@a by -1\relax%
14092 \repeatpgfmathloop%
14093 }%
14094 }
14095
14096 % QFP (quad flat package) chips
14097
14098 \pgfdeclareshape{qfpchip}{
14099 \savedmacro\numpins{%
14100 \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
14101 \def\numpins{\the\pgf@circ@count@a}
14102 }
14103 \savedanchor\centerpoint{%
14104 \pgf@x=-.5\wd\pgfnodeparttextbox%
14105 \pgf@y=-.5\ht\pgfnodeparttextbox%
14106 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
14107 }%
14108 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
14109 \anchor{center}{\origin}
14110 \anchor{text}{\centerpoint}% to adjust text
14111 \saveddimen\height{%
14112 \pgfmathsetlength\pgf@x{((\numpins+2)
14113 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
14114 }%
14115 \saveddimen\width{%
14116 \pgfmathsetlength\pgf@x{((\numpins+2)
14117 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
14118 }%
14119 \saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}}}
14120 \saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
14121 % standard anchors
14122 \savedanchor\northwest{%
14123 \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
14124 *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
14125 \pgf@x=-\pgf@y
14126 }
14127 \anchor{dot}{\northwest
14128 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
14129 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
14130 }
14131 \anchor{nw}{\northwest}
14132 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
14133 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
14134 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
14135 \anchor{north west}{\northwest}
14136 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
14137 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
14138 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
14139 \anchor{n}{\northwest\pgf@x=0pt }
14140 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
14141 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
14142 \anchor{w}{\northwest\pgf@y=0pt }
14143 \anchor{north}{\northwest\pgf@x=0pt }
14144 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
14145 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
14146 \anchor{west}{\northwest\pgf@y=0pt }
14147 % start drawing
14148 \backgroundpath{%
14149 \northwest
14150 \pgf@circ@res@up = \pgf@y
14151 \pgf@circ@res@down = -\pgf@y
14152 \pgf@circ@res@right = -\pgf@x
14153 \pgf@circ@res@left = \pgf@x
14154 \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}\pgf@circ@Rlen
14155 \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
14156 \pgfscope% (for the line width)
14157 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
14158 %% upside mark
14159 \ifpgf@circuit@chip@topmark
14160 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
14161 \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
14162 \else
14163 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
14164 \fi
14165 %% rest of the shape
14166 \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
14167 \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
14168 \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
14169 \pgfpathclose
14170 \pgf@circ@draworfill
14171 % Adding the pin number
14172 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
14173 \ifpgf@circuit@chip@shownumbers
14174 \pgf@circ@count@a=\numpins%
14175 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
14176 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
14177 \ifpgf@circuit@chip@straightnumbers
14178 \pgfgettransformentries\a\b\temp\temp\temp\temp
14179 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
14180 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
14181 \else
14182 \pgfmathsetmacro{\rot}{0}
14183 \pgfmathsetmacro{\quadrant}{0}
14184 \fi
14185 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
14186 \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
14187 \pgfmathloop%
14188 \ifnum\pgf@circ@count@a>0
14189 \ifcase\quadrant % rotation 0
14190 % left
14191 \pgf@circ@count@c=\pgf@circ@count@a
14192 \pgftext[left,
14193 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14194 rotate=\rot]{\mytext}
14195 % bottom
14196 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
14197 \pgftext[bottom,
14198 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
14199 rotate=\rot]{\mytext}
14200 % right
14201 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14202 \pgftext[right,
14203 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14204 rotate=\rot]{\mytext}
14205 % top
14206 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
14207 \pgftext[top,
14208 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
14209 rotate=\rot]{\mytext}
14210 \or % rotation -90
14211 % left
14212 \pgf@circ@count@c=\pgf@circ@count@a
14213 \pgftext[top,
14214 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14215 rotate=\rot]{\mytext}
14216 % bottom
14217 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
14218 \pgftext[left,
14219 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
14220 rotate=\rot]{\mytext}
14221 % right
14222 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14223 \pgftext[bottom,
14224 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14225 rotate=\rot]{\mytext}
14226 % top
14227 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
14228 \pgftext[right,
14229 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
14230 rotate=\rot]{\mytext}
14231 \or %rotation 180
14232 % left
14233 \pgf@circ@count@c=\pgf@circ@count@a
14234 \pgftext[right,
14235 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14236 rotate=\rot]{\mytext}
14237 % bottom
14238 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
14239 \pgftext[top,
14240 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
14241 rotate=\rot]{\mytext}
14242 % right
14243 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14244 \pgftext[left,
14245 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14246 rotate=\rot]{\mytext}
14247 % top
14248 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
14249 \pgftext[bottom,
14250 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
14251 rotate=\rot]{\mytext}
14252 \or % rotation +90
14253 % left
14254 \pgf@circ@count@c=\pgf@circ@count@a
14255 \pgftext[bottom,
14256 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14257 rotate=\rot]{\mytext}
14258 % bottom
14259 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
14260 \pgftext[right,
14261 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
14262 rotate=\rot]{\mytext}
14263 % right
14264 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
14265 \pgftext[top,
14266 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
14267 rotate=\rot]{\mytext}
14268 % top
14269 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
14270 \pgftext[left,
14271 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
14272 rotate=\rot]{\mytext}
14273 \fi
14274 \advance\pgf@circ@count@a-1\relax%
14275 \repeatpgfmathloop
14276 \fi
14277 \endpgfscope
14278 \ifdim\pgf@circ@res@other>0pt
14279 \pgfscope
14280 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
14281 \pgf@circ@count@a=\numpins%
14282 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
14283 \pgfmathloop%
14284 \ifnum\pgf@circ@count@a>0
14285 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
14286 \ifnum\padfrac>0
14287 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
14288 % left side pads
14289 \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}}
14290 \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}}
14291 \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}}
14292 \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}}
14293 % bottom side pads
14294 \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}}
14295 \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}}
14296 \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}}
14297 \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}}
14298 % right side pads
14299 \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}}
14300 \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}}
14301 \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}}
14302 \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}}
14303 % top side pads
14304 \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}}
14305 \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}}
14306 \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}}
14307 \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}}
14308 \else
14309 % left side pins
14310 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14311 \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}}
14312 % bottom side pins
14313 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
14314 \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}}
14315 % right side pins
14316 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
14317 \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}}
14318 % top side pins
14319 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
14320 \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}}
14321 \fi
14322 \advance\pgf@circ@count@a-1\relax%
14323 \repeatpgfmathloop
14324 \pgfusepath{stroke}
14325 \endpgfscope
14326 \fi
14327 }%
14328 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
14329 % and is executed just before a node is drawn.
14330 \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
14331 % Start with the maximum pin number and go backwards.
14332 \pgf@circ@count@a=\numpins%
14333 \pgfmathloop%
14334 \ifnum\pgf@circ@count@a>0
14335 \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
14336 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
14337 }
14338 \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
14339 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
14340 }
14341 \advance\pgf@circ@count@a-1\relax%
14342 \repeatpgfmathloop%
14343 }%
14344 }
14345
14346 %% anchors for DIP
14347 \def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
14348 \c@pgf@countc=\numpins\relax
14349 \divide\c@pgf@countc by 2
14350 \ifnum #1 > \the\c@pgf@countc
14351 % right side
14352 \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
14353 \else
14354 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
14355 \fi
14356 }
14357
14358 %% anchors for QFP
14359 \def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
14360 \c@pgf@countc=\numpins\relax
14361 \divide\c@pgf@countc by 4
14362 \ifnum #1 > \the\c@pgf@countc
14363 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
14364 \ifnum #1 > \the\c@pgf@countb
14365 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
14366 \ifnum #1 > \the\c@pgf@countb
14367 % 3*npins/4 < pin, top side
14368 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
14369 \else
14370 % 2*npins/4 < pin <= 3*npins/4, right side
14371 \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
14372 \fi
14373 \else
14374 % npins/4 < pin <= 2*npins/4, bottom side
14375 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
14376 \fi
14377 \else
14378 % <= npins/4, left side
14379 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
14380 \fi
14381 }
14382
14383
14384 %% Rotary Switch
14385
14386 \pgfdeclareshape{rotaryswitch}
14387 {
14388 \savedanchor\northeast{%
14389 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14390 % the magic number is 0.25/cos(35)
14391 % try to recalculate it for the actual switch
14392 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14393 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14394 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14395 \edef\r{\ctikzvalof{nodes width}}
14396 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14397 \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@Rlen + \pgf@circ@res@temp}
14398 }
14399 \savedanchor\northwest{%
14400 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14401 % the magic number is 0.25/cos(35)
14402 % try to recalculate it for the actual switch
14403 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14404 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14405 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14406 \edef\r{\ctikzvalof{nodes width}}
14407 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14408 \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
14409 }
14410 \savedanchor\central{%
14411 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14412 % the magic number is 0.25/cos(35)
14413 % try to recalculate it for the actual switch
14414 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14415 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
14416 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
14417 \edef\r{\ctikzvalof{nodes width}}
14418 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
14419 \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
14420 }
14421 % external square limits
14422 \savedanchor\extnorthwest{%
14423 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
14424 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
14425 \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
14426 \pgf@x=2.5\pgf@x % external square size
14427 \pgf@y=-\pgf@x %square thing when angle=180?
14428 }
14429 \saveddimen{\width}{\pgfmathsetlength\pgf@x{0.3052*\pgf@circ@Rlen*\ctikzvalof{tripoles/spdt/width}}}
14430 % radius of the connector
14431 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
14432 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
14433 % shapename
14434 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
14435 % shape type
14436 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
14437 \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
14438 \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
14439 \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
14440 \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
14441 % mid of the lever, to stack switches
14442 %\anchor{mid}{\midlever}
14443 \anchor{mid}{\northwest
14444 \pgf@circ@res@temp=-\pgf@x
14445 \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
14446 \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
14447 }
14448 % center anchors
14449 \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
14450 % horizontal angles
14451 \anchor{in}{ \northwest \pgf@y=0pt}
14452 \anchor{ain}{ \northwest \pgf@y=0pt}
14453
14454 \anchor{center}{ \central \pgf@y=0pt }
14455 \anchor{east}{ \northeast \pgf@y=0pt }
14456 \anchor{west}{ \northwest \pgf@y=0pt }
14457 \anchor{south}{ \central \pgf@y=-\pgf@y }
14458 \anchor{north}{ \central }
14459 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14460 \anchor{north east}{ \northeast }
14461 \anchor{north west}{ \northwest }
14462 \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
14463
14464 \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
14465 \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
14466 \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
14467 \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14468 \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
14469 \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14470 \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
14471 \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
14472 \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
14473
14474 \backgroundpath{
14475 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
14476 \pgf@circ@res@right = \width
14477 \pgf@circ@res@left = -\width
14478
14479 \pgfscope %wiper
14480 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
14481 \pgf@circ@res@temp=\radius\relax
14482 \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
14483 \pgfsetlinewidth{2\pgf@circ@res@temp}
14484 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
14485 \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
14486 \pgfsetroundcap\pgfusepath{draw}
14487 \endpgfscope
14488
14489 \ifpgf@circ@rotaryarrow
14490 \pgfscope % arrow
14491 \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
14492 \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
14493 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
14494 \pgftransformrotate{\wiper}
14495 \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
14496 \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
14497 \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
14498 \pgfusepath{draw}
14499 \endpgfscope
14500 \fi
14501
14502 % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
14503 \pgf@circ@count@a=\channels\relax
14504 \pgfmathsetmacro{\currenta}{-\angle}
14505 \pgfmathloop%
14506 \ifnum\pgf@circ@count@a>0
14507 % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
14508 \pgfscope
14509 \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
14510 \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
14511 \endpgfscope
14512 \pgfmathsetmacro{\currenta}{\currenta+\stepa}
14513 % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
14514 \advance\pgf@circ@count@a by -1\relax%
14515 \repeatpgfmathloop
14516
14517 \pgfscope % input
14518 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
14519 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
14520 \endpgfscope
14521 }
14522 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
14523 % and is executed just before a node is drawn.
14524 \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
14525 % Start with the maximum pin number and go backwards.
14526 \pgf@circ@count@a=\channels\relax
14527 \pgfmathloop%
14528 \ifnum\pgf@circ@count@a>0
14529 % we will create two anchors per pin: the "normal one" like `pin 1` for the
14530 % electrical contact, and the "border one" like `bpin 1` for labels.
14531 % they will coincide if `external pins width` is set to 0.
14532 \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
14533 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
14534 }
14535 \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
14536 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
14537 }
14538 \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
14539 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
14540 }
14541 \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
14542 \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
14543 }
14544 \advance\pgf@circ@count@a by -1\relax%
14545 \repeatpgfmathloop%
14546 }%
14547 }
14548
14549 \def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
14550 \pgf@circ@res@temp=\width
14551 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
14552 \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
14553 \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
14554 \advance\pgf@x by -\pgf@circ@res@temp
14555 }
14556
14557 \def\pgf@circ@rotarysqanchor#1{% external square anchors
14558 \pgf@circ@res@temp=\width
14559 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
14560 \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
14561 \advance\pgf@x by -\pgf@circ@res@temp
14562 }
14563
14564 % Seven segments displays
14565
14566 \pgfdeclareshape{bare7seg}{
14567 \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
14568 \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
14569 \ifpgf@circ@sevenseg@dot
14570 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
14571 \else
14572 \pgf@x=0pt
14573 \fi
14574 }
14575 % The object extension is more or less (-width/2,-width) to (width/2,width)
14576 % and adjusted for line thickness (both sides) and eventually the dot
14577 \saveddimen{\width}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}}
14578 \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
14579 \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
14580 \savedanchor{\southwest}{% both negative
14581 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14582 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
14583 \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14584 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
14585 }
14586 \savedanchor{\northeast}{% both positive
14587 \ifpgf@circ@sevenseg@dot
14588 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
14589 \else
14590 \pgf@circ@res@other=0pt
14591 \fi
14592 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14593 +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
14594 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
14595 +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
14596 }
14597 \savedanchor{\topright}{% anchor without the box sep and the thickness
14598 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
14599 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
14600 }
14601 \anchor{center}{\pgfpointorigin}
14602 \anchor{north west}{\southwest\pgf@y=-\pgf@y}
14603 \anchor{north east}{\northeast}
14604 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
14605 \anchor{south west}{\southwest}
14606 \anchor{north}{\northeast\pgf@x=0pt}
14607 \anchor{east}{\northeast\pgf@y=0pt}
14608 \anchor{south}{\southwest\pgf@x=0pt}
14609 \anchor{west}{\southwest\pgf@y=0pt}
14610 \anchor{a}{\topright\pgf@x=0pt}
14611 \anchor{b}{\topright\pgf@y=0.5\pgf@y}
14612 \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
14613 \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
14614 \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
14615 \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
14616 \anchor{g}{\pgfpointorigin}
14617 \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
14618 \behindbackgroundpath{%
14619 \southwest % I do not want the dot here, it will stick out
14620 \pgf@circ@res@up = -\pgf@y
14621 \pgf@circ@res@down = \pgf@y
14622 \pgf@circ@res@right = \pgf@x
14623 \pgf@circ@res@left = -\pgf@x
14624 \pgfscope
14625 \pgfsetlinewidth{\ctikzvalof{multipoles/thickness}\pgflinewidth}
14626 \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
14627 \pgfpathrectanglecorners%
14628 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14629 {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
14630 \ifpgf@circ@sevenseg@box
14631 \pgf@circ@draworfill
14632 \else
14633 \pgf@circ@maybefill
14634 \fi
14635 \endpgfscope
14636 \edef\bits{\ctikzvalof{seven seg/bits}}
14637 \pgfscope
14638 \pfg@circ@sseg@drawbits{\bits}
14639 \endpgfscope
14640 \pgfscope
14641 \ifpgf@circ@sevenseg@dot
14642 \pgf@circ@sseg@drawdots
14643 \fi
14644 \endpgfscope
14645 }
14646 }
14647
14648 \def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
14649 \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
14650 }
14651 \def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
14652 \ifnum #1 > 0\relax
14653 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
14654 \else
14655 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
14656 \fi
14657 \pgfpathmoveto{\pgfpoint{#2}{#3}}
14658 \pgfpathlineto{\pgfpoint{#4}{#5}}
14659 \pgfusepath{draw}
14660 }
14661 \def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
14662 \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
14663 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
14664 \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
14665 % \pgfsetroundcap
14666 \pgfsetarrowsstart{Triangle Cap[]}
14667 \pgfsetarrowsend{Triangle Cap[]}
14668 % segments
14669 \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
14670 \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
14671 \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
14672 \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
14673 \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
14674 \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
14675 \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
14676 }
14677 \def\pgf@circ@sseg@drawdots{% dots
14678 \edef\what{empty}
14679 \ifx\what\pgf@circ@sevenseg@dotstate
14680 % do nothing
14681 \else
14682 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
14683 \edef\what{off}
14684 \ifx\what\pgf@circ@sevenseg@dotstate
14685 % dot off
14686 \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
14687 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
14688 \else
14689 % dot on
14690 \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
14691 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
14692 \fi
14693 \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
14694 \pgfusepath{draw,fill}
14695 \fi
14696 }
14697 %%%---------- close: tex/pgfcircmultipoles
14698
14699 %%%%%%%%%%% Springe nach tex/pgfcirclabel
14700 %%%---------- open: tex/pgfcirclabel.tex
14701 % Copyright 2007-2009 by Massimo Redaelli
14702 %
14703 % This file may be distributed and/or modified
14704 %
14705 % 1. under the LaTeX Project Public License and/or
14706 % 2. under the GNU Public License.
14707 %
14708 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
14709
14710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14711 %% Bipole label positioning
14712
14713 %% Options
14714 \ctikzset{label/.style = { l=#1 } }
14715 \ctikzset{l/.code = {
14716 \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
14717 \ctikzsetvalof{bipole/label/unit}{}
14718 \ifpgf@circ@siunitx
14719 \pgf@circ@handleSI{#1}
14720 \ifpgf@circ@siunitx@res
14721 \edef\pgf@temp{\pgf@circ@handleSI@val}
14722 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
14723 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14724 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
14725 \else
14726 \fi
14727 \else
14728 \fi
14729 }}
14730
14731 \ctikzset{label above/.code = {
14732 l=#1,
14733 \circuitikzbasekey/bipole/label/position=90 }
14734 }
14735
14736 \ctikzset{l^/.style = {
14737 l=#1,
14738 \circuitikzbasekey/bipole/label/position=90 }
14739 }
14740
14741 \ctikzset{label below/.code = {
14742 l=#1,
14743 \circuitikzbasekey/bipole/label/position=-90 }
14744 }
14745
14746 \ctikzset{l_/.style = {
14747 l=#1,
14748 \circuitikzbasekey/bipole/label/position=-90 }
14749 }
14750
14751 \ctikzset{annotation/.style = { a=#1 } }
14752 \ctikzset{a/.code = {
14753 \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
14754 \ctikzsetvalof{bipole/annotation/unit}{}
14755 \ifpgf@circ@siunitx
14756 \pgf@circ@handleSI{#1}
14757 \ifpgf@circ@siunitx@res
14758 \edef\pgf@temp{\pgf@circ@handleSI@val}
14759 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
14760 \edef\pgf@temp{\pgf@circ@handleSI@unit}
14761 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
14762 \else
14763 \fi
14764 \else
14765 \fi
14766 }}
14767
14768 \ctikzset{annotation above/.code = {
14769 a=#1,
14770 \circuitikzbasekey/bipole/annotation/position=90 }
14771 }
14772
14773 \ctikzset{a^/.style = {
14774 a=#1,
14775 \circuitikzbasekey/bipole/annotation/position=90 }
14776 }
14777
14778 \ctikzset{annotation below/.code = {
14779 a=#1,
14780 \circuitikzbasekey/bipole/annotation/position=-90 }
14781 }
14782 \ctikzset{a_/.style = {
14783 a=#1,
14784 \circuitikzbasekey/bipole/annotation/position=-90 }
14785 }
14786
14787 % This is to adjust spacing for the labels so that they are not cramped on components
14788 \def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
14789
14790 \def\pgf@circ@drawlabels#1{
14791 \pgfextra{
14792 % This function will be called with argument #1 equal
14793 % to "label" or "annotation" form pgfcircpath.tex.
14794 % pgf@circ@direction is the direction of the path,
14795 % its value is set in pgfcircpath.tex
14796 \pgfmathsubtract{\pgf@circ@direction}{90}
14797 \pgfmathround{\pgfmathresult} % avoid precision loss errors
14798 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14799
14800 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
14801 \ifnum \pgf@circ@temp < 0
14802 \pgfmathadd{\pgf@circ@labanc}{180}
14803 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14804 \fi
14805 % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
14806 %
14807 % normalize the angle values
14808 %
14809 \pgfmathmod{\pgf@circ@labanc}{360}
14810 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14811 %
14812 \ifpgf@circuit@bipole@inverted
14813 \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
14814 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14815 \fi
14816 %
14817 \ifnum \ctikzvalof{mirror value} = -1
14818 \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
14819 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14820 \fi
14821 % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
14822 }
14823 %Firstly, place a coordinate directly at the edge of the shape
14824 (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
14825 %now decide, which labels should be drawn
14826 \pgfextra{
14827 \edef\pgf@temp{\ctikzvalof{label/align}}
14828 \def\pgf@circ@temp{straight}
14829 }
14830 \ifx\pgf@temp\pgf@circ@temp %straight
14831 \pgf@circ@drawreglabels{#1}
14832 \else
14833 \pgfextra{\def\pgf@circ@temp{rotate}}
14834 \ifx\pgf@temp\pgf@circ@temp %rotate
14835 \pgf@circ@drawrotlabels{#1}
14836 \else% smart
14837 \pgf@circ@drawsmartlabels{#1}
14838 \fi
14839 \fi
14840 }
14841
14842
14843 \def\pgf@circ@drawsmartlabels#1{
14844 \pgfextra{
14845 \pgfmathmod{\pgf@circ@direction}{90}
14846 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14847 }
14848 \ifnum \pgfcircmathresult > 20
14849 \ifnum \pgfcircmathresult < 70
14850 \pgf@circ@drawrotlabels{#1}
14851 \else
14852 \pgf@circ@drawreglabels{#1}
14853 \fi
14854 \else
14855 \pgf@circ@drawreglabels{#1}
14856 \fi
14857 }
14858
14859
14860 \def\pgf@circ@drawrotlabels#1{
14861 \pgfextra{
14862 % scale the distances in function of zoom, so that they are not
14863 % dependent on it but on font size. Thanks to @marmot
14864 % https://tex.stackexchange.com/a/476018/38080
14865 % the coeffcient is adjusted so that the distance is more or less
14866 % the same for rotated labels and straight ones (although it will
14867 % depend on the font, so it's not exact).
14868 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
14869 \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
14870 \ifnum \ctikzvalof{bipole/#1/position}>0
14871 %we need some more space for placement below, due to mid-anchor
14872 \else % we do not have <= in \ifnum...
14873 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
14874 \fi
14875 %Calculate rotation of the label from direction and strip decimals
14876 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
14877 % rotate the label at second or third quadrant:
14878 \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
14879 \pgfmathsubtract{\pgf@circ@direction}{180}
14880 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14881 %invert the space relationships due to rotated strings
14882 \ifnum \ctikzvalof{bipole/#1/position}>0
14883 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
14884 \fi
14885 \fi\fi
14886 \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
14887 \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14888 }
14889 % reset cm is not working correctly here
14890 (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
14891 node[anchor=mid, rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
14892 }
14893
14894 \def\pgf@circ@drawreglabels#1{
14895 %Now calculate all shape positions
14896 %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
14897 %All points between will be addressed by angled-anchors:
14898 \pgfextra{
14899 % scale ex-distance to make it independent on scale
14900 % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
14901 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
14902 \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
14903 \pgfmathadd{\pgf@circ@labanc}{90}
14904 \pgfmathround{\pgfmathresult}
14905 \def\pgf@circ@labanctext{\pgf@circ@labanc}
14906 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14907 \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
14908 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
14909 }
14910 %Values around 90 are at both y-axis
14911 \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
14912 \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
14913 \ifnum \pgf@circ@labpos > 180
14914 \ifnum \ctikzvalof{bipole/#1/position} > 0
14915 \pgfextra{\def\pgf@circ@labanctext{mid west}}
14916 \else
14917 \pgfextra{\def\pgf@circ@labanctext{mid east}}
14918 \fi
14919 \else
14920 \ifnum \ctikzvalof{bipole/#1/position} > 0
14921 \pgfextra{\def\pgf@circ@labanctext{mid east}}
14922 \else
14923 \pgfextra{\def\pgf@circ@labanctext{mid west}}
14924 \fi
14925 \fi
14926 \fi\fi
14927 %Values between -5 and 5 are at pos /neg x-axis
14928 \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
14929 \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
14930 \ifnum \ctikzvalof{bipole/#1/position} < 0
14931 \ifnum \pgf@circ@labanc > 90
14932 % using base coordinate instead of south to naturally align
14933 % symbols with descendants; but this invalidate the effect of
14934 % the inner sep, so recover it by shifting the anchor
14935 % reset cm is not working sometime, use @marmot solution
14936 % see https://tex.stackexchange.com/a/476018/38080
14937 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14938 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14939 \else
14940 \pgfextra{\def\pgf@circ@labanctext{north}}%north
14941 \fi
14942 \else
14943 \ifnum \pgf@circ@labanc < 90
14944 % shift, as above
14945 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14946 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14947 \else
14948 \ifnum \pgf@circ@labanc > 180
14949 % this shouldn't happen, but somehow it does (270 degree anchors)
14950 % shift, as above
14951 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
14952 \pgfextra{\def\pgf@circ@labanctext{base}}%base
14953 \else
14954 \pgfextra{\def\pgf@circ@labanctext{north}}%north
14955 \fi
14956 \fi
14957 \fi
14958 \fi\fi
14959 (labelcoor) node[anchor=\pgf@circ@labanctext,
14960 inner sep=0.5\pgf@circ@res@temp, outer sep=0pt,
14961 ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
14962 }
14963 }
14964
14965 \def\pgf@circ@finallabels#1{%
14966 \edef\pgf@temp{}%
14967 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
14968 \ifx\pgf@temp\pgf@circ@temp%
14969 \ctikzvalof{bipole/#1/name}%
14970 \else%
14971 $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
14972 \fi%
14973 }
14974
14975 \ctikzset{text/.style = { t=#1 } }
14976 \ctikzset{t/.code = {
14977 \ctikzsetvalof{bipoles/twoport/text}{#1}
14978 }}
14979
14980 %%%% Stacked labels
14981 %
14982 % stacked labels by Romano Giannetti [email protected]
14983 % heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
14984 % \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
14985 %
14986 % labels are in a tabular, globally aligned:
14987 % vertically with key l2 valign (default c)
14988 % c: center t: top b: bottom
14989 % horizontally with key l2 align (default l)
14990 % l: left c: centered r: right
14991 % you can switch sides using l2_=... and l2^=...
14992 % syntax is l2_ = line1 and line2 (same for l2^)
14993 %
14994 \ctikzset{%
14995 l2 valign/.store in=\ltwo@valign, l2 valign=c,
14996 l2 halign/.store in=\ltwo@halign, l2 halign=l,
14997 }
14998 \ctikzset{l2base/.code n args={2}{
14999 \pgfkeys{/tikz/circuitikz/bipole/label/name=%
15000 \bgroup
15001 \setlength{\tabcolsep}{2pt}%
15002 \def\ltwo@tabu{\tabular[\ltwo@valign]}%
15003 \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
15004 #1\\ #2%
15005 \endtabular
15006 \egroup
15007 }%
15008 \ctikzsetvalof{bipole/label/unit}{}
15009 \ifpgf@circ@siunitx
15010 \pgf@circ@handleSI{#2}
15011 \ifpgf@circ@siunitx@res
15012 \edef\pgf@temp{\pgf@circ@handleSI@val}
15013 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
15014 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15015 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
15016 \else
15017 \fi
15018 \else
15019 \fi
15020 }}
15021 \ctikzset{l2/.style args={#1 and #2}{
15022 l2base={#1}{#2},
15023 \circuitikzbasekey/bipole/label/position=90 }
15024 }
15025 \ctikzset{l2 above/.style args={#1 and #2}{
15026 l2base={#1}{#2},
15027 \circuitikzbasekey/bipole/label/position=90 }
15028 }
15029 \ctikzset{l2^/.style args={#1 and #2}{
15030 l2base={#1}{#2},
15031 \circuitikzbasekey/bipole/label/position=90 }
15032 }
15033 \ctikzset{l2 below/.style args={#1 and #2}{
15034 l2base={#1}{#2},
15035 \circuitikzbasekey/bipole/label/position=-90 }
15036 }
15037 \ctikzset{l2_/.style args={#1 and #2}{
15038 l2base={#1}{#2},
15039 \circuitikzbasekey/bipole/label/position=-90 }
15040 }
15041
15042 %%%---------- close: tex/pgfcirclabel
15043 %%%%%%%%%%% Springe nach tex/pgfcircvoltage
15044 %%%---------- open: tex/pgfcircvoltage.tex
15045 % Copyright 2007-2009 by Massimo Redaelli
15046 %
15047 % This file may be distributed and/or modified
15048 %
15049 % 1. under the LaTeX Project Public License and/or
15050 % 2. under the GNU Public License.
15051 %
15052 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15053
15054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15055 %% Voltage management
15056
15057
15058 \ctikzset{v^>/.style = {
15059 v = #1,
15060 \circuitikzbasekey/bipole/voltage/direction = forward,
15061 \circuitikzbasekey/bipole/voltage/position = above
15062 }
15063 }
15064
15065 \ctikzset{v^</.style = {
15066 v = #1,
15067 \circuitikzbasekey/bipole/voltage/direction = backward,
15068 \circuitikzbasekey/bipole/voltage/position = above
15069 }
15070 }
15071
15072 \ctikzset{v_>/.style = {
15073 v = #1,
15074 \circuitikzbasekey/bipole/voltage/direction = forward,
15075 \circuitikzbasekey/bipole/voltage/position = below
15076 }
15077 }
15078
15079 \ctikzset{v_</.style = {
15080 v = #1,
15081 \circuitikzbasekey/bipole/voltage/direction = backward,
15082 \circuitikzbasekey/bipole/voltage/position = below
15083 }
15084 }
15085
15086 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
15087 \ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
15088 \ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
15089 \ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
15090
15091 % Default position varies whether the component is a voltage source
15092 % or not
15093 \ctikzset{v/.code = {
15094 \ifpgf@circuit@bipole@isvoltage
15095 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
15096 \circuitikzbasekey/bipole/voltage/direction=forward}
15097 \else
15098 \ifpgf@circ@oldvoltagedirection
15099 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
15100 \circuitikzbasekey/bipole/voltage/direction=backward}
15101 \else
15102 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
15103 \circuitikzbasekey/bipole/voltage/direction=forward}
15104 \fi
15105 \fi
15106 \ifpgf@circ@oldvoltagedirection
15107 \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
15108 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
15109 \circuitikzbasekey/bipole/voltage/direction=forward}
15110 \fi\fi
15111 \else
15112 \ifpgf@circuit@bipole@iscurrent
15113 \ifpgf@circuit@bipole@current@backward
15114 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
15115 \circuitikzbasekey/bipole/voltage/direction=forward}
15116 \else
15117 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
15118 \circuitikzbasekey/bipole/voltage/direction=backward}
15119 \fi\fi\fi
15120 \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
15121 \ctikzsetvalof{bipole/voltage/label/unit}{}
15122 \ifpgf@circ@siunitx
15123 \pgf@circ@handleSI{#1}
15124 \ifpgf@circ@siunitx@res
15125 \edef\pgf@temp{\pgf@circ@handleSI@val}
15126 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
15127 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15128 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
15129 \else
15130 \fi
15131 \else
15132 \fi
15133 }
15134 }
15135
15136 % american voltage font selection and symbol definition
15137 % the default font command is {} --- nothing
15138 \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
15139 %
15140 % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
15141 % notice that the double braces are needed to be able
15142 % to use \boldmath in the font (although it is semi-deprecated...)
15143 %
15144 \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
15145 \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
15146
15147 %% Output routine for generic bipoles
15148
15149 \def\pgf@circ@drawvoltagegeneric{
15150 \pgfextra{
15151 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}
15152 \pgfkeysifdefined{\pgf@temp}
15153 {
15154 \edef\partheight{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}}
15155 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
15156 }
15157 {
15158 \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
15159 {
15160 \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
15161 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
15162 }
15163 {%calculate default value from part height
15164 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}
15165 \pgfkeysifdefined{\pgf@temp}
15166 {
15167 \edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
15168 \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen+0.2\pgf@circ@Rlen)}
15169 }
15170 {
15171 \edef\tmpdistfromline{(.5\pgf@circ@Rlen)} %fallback to fixed value
15172 }
15173 }
15174 }
15175 \ifnum \ctikzvalof{mirror value}=-1
15176 \ifpgf@circuit@bipole@inverted
15177 \ifpgf@circuit@bipole@voltage@straight
15178 \def\distfromline{\tmpdistfromline}
15179 \else
15180 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
15181 \fi
15182 \else
15183 \ifpgf@circuit@bipole@voltage@straight
15184 \def\distfromline{-\tmpdistfromline}
15185 \else
15186 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
15187 \fi
15188 \fi
15189 \else
15190 \ifpgf@circuit@bipole@inverted
15191 \ifpgf@circuit@bipole@voltage@straight
15192 \def\distfromline{-\tmpdistfromline}
15193 \else
15194 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
15195 \fi
15196 \else
15197 \ifpgf@circuit@bipole@voltage@straight
15198 \def\distfromline{\tmpdistfromline}
15199 \else
15200 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
15201 \fi
15202 \fi
15203 \fi
15204 \ifpgf@circuit@bipole@voltage@below
15205 \def\pgf@circ@voltage@angle{90}
15206 \else
15207 \def\pgf@circ@voltage@angle{-90}
15208 \fi
15209 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
15210 \pgfkeysifdefined{\pgf@temp}
15211 { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
15212 { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
15213 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
15214 \pgfkeysifdefined{\pgf@temp}
15215 { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
15216 { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
15217 \edef\shiftv{\ctikzvalof{voltage/shift}}
15218 \pgfmathsetmacro{\bumpb}{\bumpb + \shiftv} %% adjust the bump is shift
15219 \ifpgf@circuit@bipole@inverted
15220 \pgfmathsetmacro{\shiftv}{-\shiftv}
15221 \fi
15222 \ifnum \ctikzvalof{mirror value} = -1
15223 \pgfmathsetmacro{\shiftv}{-\shiftv}
15224 \fi
15225 }
15226 % %\pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} is equal to the length of the currarrow
15227 coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
15228 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorstartnode)$)
15229
15230 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
15231 coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
15232 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorendnode)$)
15233
15234 coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
15235
15236 \ifpgf@circuit@bipole@voltage@below
15237 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto) ! \shiftv!90 : (anchorendnode)$)
15238 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! \shiftv!-90 : (anchorstartnode)$)
15239 coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
15240 coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
15241 \else
15242 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto) ! -\shiftv!90 : (anchorendnode)$)
15243 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! -\shiftv!-90 : (anchorstartnode)$)
15244 coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
15245 coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
15246 \fi
15247
15248 \ifpgf@circuit@europeanvoltage
15249 \ifpgf@circuit@bipole@voltage@straight
15250 \ifpgf@circuit@bipole@voltage@backward
15251 (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
15252 \else
15253 (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
15254 \fi
15255 \else
15256 \ifpgf@circuit@bipole@voltage@backward
15257 (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
15258 node[currarrow, sloped, allow upside down, pos=1] {}
15259 (pgfcirc@Vfrom)
15260 \else
15261 (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
15262 node[currarrow, sloped, allow upside down, pos=1] {}
15263 (pgfcirc@Vto)
15264 \fi
15265 \fi
15266 \else
15267 \ifpgf@circuit@bipole@voltage@backward
15268 \ifpgf@circ@oldvoltagedirection
15269 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
15270 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
15271 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
15272 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
15273 \else
15274 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
15275 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
15276 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
15277 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
15278 \fi
15279 \else
15280 \ifpgf@circ@oldvoltagedirection
15281 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
15282 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
15283 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
15284 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
15285 \else
15286 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
15287 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
15288 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
15289 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
15290 \fi
15291 \fi
15292 \fi
15293 }
15294
15295 %% Output routine for voltage sources
15296 \def\pgf@circ@drawvoltagegenerator{
15297 % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
15298 % it's not perfect, but I can't find the way to do it correctly...
15299 \pgfextra{
15300 \edef\shiftv{\ctikzvalof{voltage/shift}}
15301 \edef\bumpa{\ctikzvalof{voltage/bump a}}
15302 \pgfmathsetmacro{\bumpaplus}{\bumpa + \shiftv}
15303 }
15304 \ifpgf@circuit@bipole@voltage@below
15305 coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
15306 coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
15307 \else
15308 coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
15309 coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
15310 \fi
15311 \ifpgf@circuit@europeanvoltage
15312 \ifpgf@circuit@bipole@voltage@backward
15313 (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vfrom)
15314 \else
15315 (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vto)
15316 \fi
15317 \else% american voltage
15318 \ifpgf@circuit@bipole@voltageoutsideofsymbol
15319 % if it is a battery, must put + and -
15320
15321 \ifpgf@circ@fixbatteries
15322 \ifpgf@circuit@bipole@voltage@backward
15323 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15324 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15325 \else
15326 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15327 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15328 \fi
15329 \else
15330 \ifpgf@circuit@bipole@voltage@backward
15331 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15332 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15333 \else
15334 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
15335 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
15336 \fi
15337 \fi
15338 \fi
15339 \fi
15340 }
15341
15342 %% Output routine
15343 \def\pgf@circ@drawvoltage{% node name
15344 \pgfextra{ %WARNING: indentation is probably wrong
15345 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
15346 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15347 \ifpgf@circuit@bipole@voltage@below
15348 \def\pgf@circ@bipole@voltage@label@anchor{north west}
15349 \else
15350 \def\pgf@circ@bipole@voltage@label@anchor{south east}
15351 \fi
15352 \fi\fi
15353 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15354 \ifpgf@circuit@bipole@voltage@below
15355 \def\pgf@circ@bipole@voltage@label@anchor{west}
15356 \else
15357 \def\pgf@circ@bipole@voltage@label@anchor{east}
15358 \fi
15359 \fi\fi
15360 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15361 \ifpgf@circuit@bipole@voltage@below
15362 \def\pgf@circ@bipole@voltage@label@anchor{south west}
15363 \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
15364 \fi
15365 \fi\fi
15366 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15367 \ifpgf@circuit@bipole@voltage@below
15368 \def\pgf@circ@bipole@voltage@label@anchor{south}
15369 \else\def\pgf@circ@bipole@voltage@label@anchor{north}
15370 \fi
15371 \fi\fi
15372 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15373 \ifpgf@circuit@bipole@voltage@below
15374 \def\pgf@circ@bipole@voltage@label@anchor{south east}
15375 \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
15376 \fi
15377 \fi\fi
15378 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15379 \ifpgf@circuit@bipole@voltage@below
15380 \def\pgf@circ@bipole@voltage@label@anchor{east}
15381 \else \def\pgf@circ@bipole@voltage@label@anchor{west}
15382 \fi
15383 \fi\fi
15384 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15385 \ifpgf@circuit@bipole@voltage@below
15386 \def\pgf@circ@bipole@voltage@label@anchor{north east}
15387 \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
15388 \fi
15389 \fi\fi
15390 \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
15391 \ifpgf@circuit@bipole@voltage@below
15392 \def\pgf@circ@bipole@voltage@label@anchor{north}
15393 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
15394 \fi
15395 \fi\fi
15396 \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
15397 \ifpgf@circuit@bipole@voltage@below
15398 \def\pgf@circ@bipole@voltage@label@anchor{north}
15399 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
15400 \fi
15401 \fi\fi
15402
15403 \ifnum \ctikzvalof{mirror value}=-1
15404 \ifpgf@circuit@bipole@voltage@below
15405 \pgf@circuit@bipole@voltage@belowfalse
15406 \else
15407 \pgf@circuit@bipole@voltage@belowtrue
15408 \fi
15409 \fi
15410
15411 \ifpgf@circuit@bipole@inverted
15412 \ifpgf@circuit@bipole@voltage@below
15413 \pgf@circuit@bipole@voltage@belowfalse
15414 \else
15415
15416 \pgf@circuit@bipole@voltage@belowtrue
15417 \fi
15418 \fi
15419
15420 \ifpgf@circuit@bipole@voltage@below
15421 \def\pgf@circ@bipole@voltage@label@where{-90}
15422 \else
15423 \def\pgf@circ@bipole@voltage@label@where{90}
15424 \fi
15425
15426
15427 \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
15428 \pgfkeysifdefined{\pgf@temp}
15429 { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
15430 { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
15431 \edef\shiftv{\ctikzvalof{voltage/shift}}
15432 % adjust the label distance to the shift.
15433 \pgfmathsetmacro{\eudistplus}{\eudist+\shiftv}
15434
15435 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
15436 }%end pgfextra
15437
15438 \ifpgf@circuit@bipole@isvoltage
15439 \pgf@circ@drawvoltagegenerator
15440 \else
15441 \pgf@circ@drawvoltagegeneric
15442 \fi
15443
15444 % (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) %Zeile sinnlos!?
15445 \ifpgf@circuit@bipole@voltage@straight
15446 coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
15447 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt]
15448 at (Vlab) { \pgf@circ@finallabels{voltage/label} }
15449 \else
15450 coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
15451 \ifpgf@circuit@europeanvoltage
15452 \eudistplus
15453 \else
15454 \ctikzvalof{voltage/american label distance}
15455 \fi !
15456 (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
15457 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] at (Vlab) { \pgf@circ@finallabels{voltage/label} }
15458 \fi
15459 }%end drawvoltages
15460 %%%---------- close: tex/pgfcircvoltage
15461 %%%%%%%%%%% Springe nach tex/pgfcirccurrent
15462 %%%---------- open: tex/pgfcirccurrent.tex
15463 % Copyright 2007-2009 by Massimo Redaelli
15464 %
15465 % This file may be distributed and/or modified
15466 %
15467 % 1. under the LaTeX Project Public License and/or
15468 % 2. under the GNU Public License.
15469 %
15470 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15471
15472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15473 %% Current handling
15474
15475 %% Options
15476 \ctikzset{i^>/.style = {
15477 i = #1,
15478 \circuitikzbasekey/bipole/current/direction = forward,
15479 \circuitikzbasekey/bipole/current/x position = after,
15480 \circuitikzbasekey/bipole/current/y position = above
15481 }
15482 }
15483
15484 \ctikzset{i_>/.style = {
15485 i = #1,
15486 \circuitikzbasekey/bipole/current/direction = forward,
15487 \circuitikzbasekey/bipole/current/x position = after,
15488 \circuitikzbasekey/bipole/current/y position = below
15489 }
15490 }
15491
15492 \ctikzset{i>^/.style = {
15493 i = #1,
15494 \circuitikzbasekey/bipole/current/direction = forward,
15495 \circuitikzbasekey/bipole/current/x position = before,
15496 \circuitikzbasekey/bipole/current/y position = above
15497 }
15498 }
15499
15500 \ctikzset{i>_/.style = {
15501 i = #1,
15502 \circuitikzbasekey/bipole/current/direction = forward,
15503 \circuitikzbasekey/bipole/current/x position = before,
15504 \circuitikzbasekey/bipole/current/y position = below
15505 }
15506 }
15507
15508 \ctikzset{i^</.style = {
15509 i = #1,
15510 \circuitikzbasekey/bipole/current/direction = backward,
15511 \circuitikzbasekey/bipole/current/x position = after,
15512 \circuitikzbasekey/bipole/current/y position = above
15513 }
15514 }
15515
15516 \ctikzset{i_</.style = {
15517 i = #1,
15518 \circuitikzbasekey/bipole/current/direction = backward,
15519 \circuitikzbasekey/bipole/current/x position = after,
15520 \circuitikzbasekey/bipole/current/y position = below
15521 }
15522 }
15523
15524 \ctikzset{i<^/.style = {
15525 i = #1,
15526 \circuitikzbasekey/bipole/current/direction = backward,
15527 \circuitikzbasekey/bipole/current/x position = before,
15528 \circuitikzbasekey/bipole/current/y position = above
15529 }
15530 }
15531
15532 \ctikzset{i<_/.style = {
15533 i = #1,
15534 \circuitikzbasekey/bipole/current/direction = backward,
15535 \circuitikzbasekey/bipole/current/x position = before,
15536 \circuitikzbasekey/bipole/current/y position = below
15537 }
15538 }
15539
15540 \ctikzset{i/.code = {
15541 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
15542 \circuitikzbasekey/bipole/current/x position = after,
15543 \circuitikzbasekey/bipole/current/y position = above }
15544 \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
15545 \ctikzsetvalof{bipole/current/label/unit}{}
15546 \ifpgf@circ@siunitx
15547 \pgf@circ@handleSI{#1}
15548 \ifpgf@circ@siunitx@res
15549 \edef\pgf@temp{\pgf@circ@handleSI@val}
15550 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
15551 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15552 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
15553 \else
15554 \fi
15555 \else
15556 \fi
15557 %reverse current direction for voltage sources
15558 \ifpgf@circ@oldvoltagedirection\else
15559 \ifpgf@circuit@bipole@isvoltage
15560 \ifpgf@circuit@bipole@voltage@backward
15561 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
15562 \circuitikzbasekey/bipole/current/x position = after,
15563 \circuitikzbasekey/bipole/current/y position = below }
15564 \else
15565 \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
15566 \circuitikzbasekey/bipole/current/x position = before,
15567 \circuitikzbasekey/bipole/current/y position = above }
15568 \fi\fi\fi
15569 }
15570 }
15571
15572 \ifpgf@circ@oldvoltagedirection
15573 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
15574 \else
15575 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
15576 \fi
15577 \ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
15578 \ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
15579 \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
15580
15581 %% Output routine
15582 \def\pgf@circ@drawcurrent{
15583 \pgfextra{
15584 \edef\pgf@circ@ffffff{\pgf@circ@direction}
15585 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
15586
15587 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15588 \ifpgf@circuit@bipole@current@below
15589 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
15590 \fi
15591 \fi\fi
15592 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15593 \ifpgf@circuit@bipole@current@below
15594 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
15595 \fi
15596 \fi\fi
15597 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15598 \ifpgf@circuit@bipole@current@below
15599 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
15600 \fi
15601 \fi\fi
15602 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15603 \ifpgf@circuit@bipole@current@below
15604 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
15605 \fi
15606 \fi\fi
15607 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15608 \ifpgf@circuit@bipole@current@below
15609 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
15610 \fi
15611 \fi\fi
15612 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15613 \ifpgf@circuit@bipole@current@below
15614 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
15615 \fi
15616 \fi\fi
15617 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15618 \ifpgf@circuit@bipole@current@below
15619 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
15620 \fi
15621 \fi\fi
15622 \ifnum\pgfcircmathresult <5
15623 \ifpgf@circuit@bipole@current@below
15624 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15625 \fi
15626 \fi
15627 \ifnum\pgfcircmathresult >355
15628 \ifpgf@circuit@bipole@current@below
15629 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15630 \fi
15631 \fi
15632
15633 \ifpgf@circuit@bipole@current@below
15634 \def\pgf@circ@bipole@current@label@where{-90}
15635 \else
15636 \def\pgf@circ@bipole@current@label@where{+90}
15637 \fi
15638 }
15639
15640 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
15641 \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
15642 (\tikztostart)--(\tikztotarget)
15643 \else% normal bipole or source
15644 \ifpgf@circuit@bipole@current@before
15645 (\tikztostart)--(anchorstartnode)
15646 \else
15647 (anchorendnode)--(\tikztotarget)
15648 \fi
15649 \fi
15650 \ifpgf@circuit@bipole@current@backward
15651 \pgfextra{
15652 \pgfmathsubtract{\pgf@circ@ffffff}{180}
15653 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15654 }
15655 \fi
15656 coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff](Iarrow)
15657 (Iarrow.\pgf@circ@bipole@current@label@where) node[anchor=\pgf@circ@dir]{\pgf@circ@finallabels{current/label}}
15658 }
15659
15660 %%%---------- close: tex/pgfcirccurrent
15661 %%%%%%%%%%% Springe nach tex/pgfcircflow
15662 %%%---------- open: tex/pgfcircflow.tex
15663 % Copyright 2007-2009 by Massimo Redaelli
15664 %
15665 % This file may be distributed and/or modified
15666 %
15667 % 1. under the LaTeX Project Public License and/or
15668 % 2. under the GNU Public License.
15669 %
15670 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15671
15672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15673 %% flow handling
15674
15675 %% Options
15676 \ctikzset{f^>/.style = {
15677 f = #1,
15678 \circuitikzbasekey/bipole/flow/direction = forward,
15679 \circuitikzbasekey/bipole/flow/x position = after,
15680 \circuitikzbasekey/bipole/curflowrent/y position = above
15681 }
15682 }
15683
15684 \ctikzset{f_>/.style = {
15685 f = #1,
15686 \circuitikzbasekey/bipole/flow/direction = forward,
15687 \circuitikzbasekey/bipole/flow/x position = after,
15688 \circuitikzbasekey/bipole/flow/y position = below
15689 }
15690 }
15691
15692 \ctikzset{f>^/.style = {
15693 f = #1,
15694 \circuitikzbasekey/bipole/flow/direction = forward,
15695 \circuitikzbasekey/bipole/flow/x position = before,
15696 \circuitikzbasekey/bipole/flow/y position = above
15697 }
15698 }
15699
15700 \ctikzset{f>_/.style = {
15701 f = #1,
15702 \circuitikzbasekey/bipole/flow/direction = forward,
15703 \circuitikzbasekey/bipole/flow/x position = before,
15704 \circuitikzbasekey/bipole/flow/y position = below
15705 }
15706 }
15707
15708 \ctikzset{f^</.style = {
15709 f = #1,
15710 \circuitikzbasekey/bipole/flow/direction = backward,
15711 \circuitikzbasekey/bipole/flow/x position = after,
15712 \circuitikzbasekey/bipole/flow/y position = above
15713 }
15714 }
15715
15716 \ctikzset{f_</.style = {
15717 f = #1,
15718 \circuitikzbasekey/bipole/flow/direction = backward,
15719 \circuitikzbasekey/bipole/flow/x position = after,
15720 \circuitikzbasekey/bipole/flow/y position = below
15721 }
15722 }
15723
15724 \ctikzset{f<^/.style = {
15725 f = #1,
15726 \circuitikzbasekey/bipole/flow/direction = backward,
15727 \circuitikzbasekey/bipole/flow/x position = before,
15728 \circuitikzbasekey/bipole/flow/y position = above
15729 }
15730 }
15731
15732 \ctikzset{f<_/.style = {
15733 f = #1,
15734 \circuitikzbasekey/bipole/flow/direction = backward,
15735 \circuitikzbasekey/bipole/flow/x position = before,
15736 \circuitikzbasekey/bipole/flow/y position = below
15737 }
15738 }
15739
15740 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
15741 \ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
15742 \ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
15743 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
15744
15745 \ctikzset{f/.code = {
15746 \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
15747 \circuitikzbasekey/bipole/flow/x position = after,
15748 \circuitikzbasekey/bipole/flow/y position = above }
15749 \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
15750 \ctikzsetvalof{bipole/flow/label/unit}{}
15751 \ifpgf@circ@siunitx
15752 \pgf@circ@handleSI{#1}
15753 \ifpgf@circ@siunitx@res
15754 \edef\pgf@temp{\pgf@circ@handleSI@val}
15755 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
15756 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15757 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
15758 \else
15759 \fi
15760 \else
15761 \fi
15762 }
15763 }
15764
15765 %% Output routine
15766 \def\pgf@circ@drawflow{
15767 \pgfextra{
15768 \edef\pgf@circ@ffffff{\pgf@circ@direction}
15769 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
15770
15771 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
15772 \ifpgf@circuit@bipole@flow@below
15773 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
15774 \fi
15775 \fi\fi
15776 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
15777 \ifpgf@circuit@bipole@flow@below
15778 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
15779 \fi
15780 \fi\fi
15781 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
15782 \ifpgf@circuit@bipole@flow@below
15783 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
15784 \fi
15785 \fi\fi
15786 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
15787 \ifpgf@circuit@bipole@flow@below
15788 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
15789 \fi
15790 \fi\fi
15791 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
15792 \ifpgf@circuit@bipole@flow@below
15793 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
15794 \fi
15795 \fi\fi
15796 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
15797 \ifpgf@circuit@bipole@flow@below
15798 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
15799 \fi
15800 \fi\fi
15801 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
15802 \ifpgf@circuit@bipole@flow@below
15803 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
15804 \fi
15805 \fi\fi
15806 \ifnum\pgfcircmathresult <5
15807 \ifpgf@circuit@bipole@flow@below
15808 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15809 \fi
15810 \fi
15811 \ifnum\pgfcircmathresult >355
15812 \ifpgf@circuit@bipole@flow@below
15813 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
15814 \fi
15815 \fi
15816
15817 \ifpgf@circuit@bipole@flow@below
15818 \def\pgf@circ@bipole@flow@label@where{-90}
15819 \else
15820 \def\pgf@circ@bipole@flow@label@where{+90}
15821 \fi
15822 }
15823
15824 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
15825 \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
15826 (\tikztostart)--(\tikztotarget)
15827 \else% normal bipole or source
15828 \ifpgf@circuit@bipole@flow@before
15829 (\tikztostart)--(anchorstartnode)
15830 \else
15831 (anchorendnode)--(\tikztotarget)
15832 \fi
15833 \fi
15834 \pgfextra{
15835 \ifpgf@circuit@bipole@flow@backward
15836 \ifpgf@circuit@bipole@flow@below
15837 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15838 \else
15839 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15840 \fi
15841 \pgfmathsubtract{\pgf@circ@ffffff}{180}
15842 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15843 \else
15844 \ifpgf@circuit@bipole@flow@below
15845 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15846 \else
15847 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
15848 \fi
15849 \fi
15850 }
15851 coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset](Farrowpos)
15852 (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir]{ \pgf@circ@finallabels{flow/label}}
15853 }
15854
15855 %%%---------- close: tex/pgfcircflow
15856
15857 % notice that the default is nooldvoltagedirection; it's not explicitly set to allow for the warning
15858 \ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
15859
15860 \ProcessOptions\relax
15861
15862 %%%%%%%%%%% Springe nach tex/pgfcircpath
15863 %%%---------- open: tex/pgfcircpath.tex
15864
15865 \def\pgf@circ@direction{0.0}
15866
15867 % Names
15868 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
15869 \ctikzset{n/.code = {
15870 \pgfkeys{/tikz/circuitikz/bipole/name=#1}
15871 }}
15872
15873 % Reflect the node along
15874 \ctikzset{mirrored/.is choice}
15875 \ctikzset{mirror value/.initial=1}
15876 \ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
15877 \ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
15878 \ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
15879
15880 % Invert node along path
15881 \ctikzset{inverted/.is choice}
15882 \ctikzset{invert value/.initial=1}
15883 \ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
15884 \ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
15885 \ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
15886 \newif\ifpgf@circuit@bipole@inverted
15887 \ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
15888
15889 \newif\ifpgf@circuit@bipole@voltage@backward
15890 \ctikzset{bipole/voltage/direction/.is choice}
15891 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
15892 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
15893
15894 % Initialize paths
15895 \def\pgfcircresetpath{
15896 \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
15897 bipole/inverted=false, bipole/kind=,
15898 bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
15899 bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
15900 bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
15901 bipole/current/y position=above, bipole/current/direction=forward,
15902 mirrored=false
15903 }
15904 }
15905
15906 %% Helper function for path-function to ensure using anchors between nodes
15907 \def\set@explicit@center@anchor#1{
15908 \pgfutil@ifundefined{pgf@sh@ns@#1}
15909 {
15910 %This coordinate is no node(but a relative position or a coordinate), no further handling needed
15911 }{
15912 \pgfutil@in@.{#1}
15913 \ifpgfutil@in@
15914 % Anchor is used, do nothing!
15915 \else%
15916 \let\tikz@moveto@waiting=\relax
15917 \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
15918 \edef#1{#1.center}%ensure using center anchor
15919 \fi
15920 }
15921 }
15922
15923
15924 %% Generic bipole path
15925 \def\pgf@circ@bipole@path#1#2{
15926
15927 \pgfextra{
15928 \set@explicit@center@anchor{\tikztostart}
15929 \set@explicit@center@anchor{\tikztotarget}
15930 \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
15931 \ctikzset{bipole/kind = #1}
15932 \edef\pgf@temp{\ctikzvalof{bipole/name}}
15933 \def\pgf@circ@temp{}
15934 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
15935 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
15936 \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
15937 \fi
15938 }
15939
15940 (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
15941 (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
15942 \pgfextra{
15943 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
15944 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
15945 \pgfmathround{\pgfmathresult}
15946 \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
15947 \pgfsyssoftpath@setcurrentpath{\myp@th}
15948 }
15949 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15950 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15951 \else
15952 --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
15953 \fi
15954 ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
15955 node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
15956 (\ctikzvalof{bipole/name}) {}
15957 \ifpgf@circuit@bipole@inverted
15958 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
15959 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
15960 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
15961 \else
15962 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
15963 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
15964 \fi
15965 \else
15966 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
15967 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
15968 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
15969 \else
15970 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
15971 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
15972 \fi
15973 \fi
15974 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15975 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15976 \else
15977 (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
15978 (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
15979 \fi
15980
15981 \drawpoles
15982 \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
15983 \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
15984 \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
15985 \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
15986 \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
15987 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
15988 \ifx\pgf@temp\pgf@circ@temp % if it is an open
15989 (\ctikzvalof{bipole/name}end)%Move to end of path
15990 \else
15991 ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
15992 %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
15993
15994 \fi
15995 % reset
15996 \pgfextra{
15997 \pgfcircresetpath
15998 }
15999 \tikztonodes%draw pending nodes an path
16000 }
16001
16002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16003 %% Handling of terminals
16004
16005 \ctikzset{bipole/nodes/.is family}
16006 \ctikzset{bipole/nodes/left/.initial=none}
16007 \ctikzset{bipole/nodes/right/.initial=none}
16008 \tikzset{bipole nodes/.style n args={2}{%
16009 \circuitikzbasekey/bipole/nodes/left=#1,
16010 \circuitikzbasekey/bipole/nodes/right=#2
16011 }
16012 }
16013
16014 %% Easily usable styles
16015
16016 \ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
16017 \ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
16018 \ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
16019 \ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
16020 \ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
16021 \ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
16022 \ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
16023 \ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
16024 \ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
16025 \ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
16026 \ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
16027 \ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
16028 \ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
16029 \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
16030 \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
16031
16032 % rectjoinfill workarounds
16033
16034 \ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
16035 \ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
16036 \ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
16037 \ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
16038 \ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
16039 \ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
16040 \ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
16041 \ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
16042 \ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
16043
16044 \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
16045
16046 \def\drawpoles{
16047 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
16048 \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
16049 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
16050 \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
16051 }
16052
16053 %% Path definitions
16054 \def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
16055 \def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
16056 \def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
16057 \def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
16058 \def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
16059 \def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
16060 \def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
16061 \def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
16062 \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
16063 \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
16064 \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
16065 \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
16066 \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
16067 \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
16068 \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
16069 \def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
16070 \def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
16071 \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
16072 \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
16073 \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
16074 \def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
16075 \def\pgf@circ@inductor@path#1{%
16076 \pgfextra{
16077 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
16078 \def\pgf@temp{european}%
16079 }
16080 \ifx\pgf@temp\pgf@circ@temp%
16081 \pgf@circ@europeaninductor@path{#1}%
16082 \else%
16083 \pgfextra{ \def\pgf@temp{cute} }%
16084 \ifx\pgf@temp\pgf@circ@temp%
16085 \pgf@circ@cuteinductor@path{#1}%
16086 \else%
16087 \pgf@circ@americaninductor@path{#1}%
16088 \fi%
16089 \fi%
16090 }
16091 \def\pgf@circ@vinductor@path#1{
16092 \pgfextra{
16093 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
16094 \def\pgf@temp{european}%
16095 }
16096 \ifx\pgf@temp\pgf@circ@temp%
16097 \pgf@circ@veuropeaninductor@path{#1}%
16098 \else%
16099 \pgfextra{ \def\pgf@temp{cute} }%
16100 \ifx\pgf@temp\pgf@circ@temp%
16101 \pgf@circ@vcuteinductor@path{#1}%
16102 \else%
16103 \pgf@circ@vamericaninductor@path{#1}%
16104 \fi%
16105 \fi%
16106 }
16107 \def\pgf@circ@inductivesens@path#1{%
16108 \pgfextra{
16109 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
16110 \def\pgf@temp{european}%
16111 }
16112 \ifx\pgf@temp\pgf@circ@temp%
16113 \pgf@circ@europeaninductivesens@path{#1}%
16114 \else%
16115 \pgfextra{ \def\pgf@temp{cute} }%
16116 \ifx\pgf@temp\pgf@circ@temp%
16117 \pgf@circ@cuteinductivesens@path{#1}%
16118 \else%
16119 \pgf@circ@americaninductivesens@path{#1}%
16120 \fi%
16121 \fi%
16122 }
16123 \def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
16124 \def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
16125 \def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
16126 \def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
16127 \def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
16128 \def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
16129 \def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
16130 \def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
16131 \def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
16132 \def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
16133 \def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
16134 \def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
16135 \def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
16136 \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
16137 \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
16138 \def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
16139 \def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
16140 \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
16141 \def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
16142 \def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
16143 \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
16144 \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
16145 \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
16146 \def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
16147 \def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
16148 \def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
16149 \def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
16150 \def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
16151 \def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
16152 \def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
16153 \def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
16154 \def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
16155 \def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
16156 \def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
16157 \def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
16158 \def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
16159 \def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
16160 \def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
16161 \def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
16162 \def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
16163 \def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
16164 \def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
16165 \def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
16166 \def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
16167 \def\pgf@circ@empty@path#1{}
16168 \def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
16169 \def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
16170 \def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
16171 \def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
16172 \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
16173 \def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
16174 \def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
16175 \def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
16176 \def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
16177 \def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
16178 \def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
16179 \def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
16180 \def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
16181 \def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
16182
16183 \def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
16184 \def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
16185 \def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
16186
16187 \def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
16188 \def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
16189 \def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
16190 \def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
16191 \def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
16192 \def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
16193 \def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
16194 \def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
16195 \def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
16196 \def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
16197 \def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
16198 \def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
16199 \def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
16200 \def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
16201 \def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
16202 \def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
16203 \def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
16204 \def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
16205 \def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
16206
16207 %%Mechanical
16208 \def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
16209 \def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
16210 \def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
16211 \def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
16212
16213 %% Styles
16214
16215 \def\comnpatname{\ifpgf@circuit@compat *\else\fi}
16216 \def\compattikzset#1{\tikzset{\comnpatname#1}}
16217
16218 %\def\ctikzsetbipole#1#2{%
16219 % \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
16220 %}
16221
16222 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
16223 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
16224 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
16225 \compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
16226 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
16227 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
16228 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
16229 \compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
16230 \compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
16231 \compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
16232 \compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
16233 \compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
16234 \compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
16235 \compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
16236 \compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
16237 \compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
16238 \compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
16239 \compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
16240 \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
16241 \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
16242 \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
16243 \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
16244 \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
16245 \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
16246 \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16247 \compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16248 \compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16249 \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
16250 \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
16251 \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
16252 \compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
16253 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
16254 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
16255 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
16256 \compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
16257 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
16258 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
16259 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
16260 \compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
16261 \compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
16262 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
16263 \compattikzset{transmission line/.style = {tline = #1}}
16264 \compattikzset{TL/.style = {tline = #1}}
16265 \compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
16266 \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}}
16267 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16268 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16269 \compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16270 \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}}
16271 \compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16272 \compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16273 \compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16274 \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 }}
16275 \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 }}
16276 \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 }}
16277 \compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16278 \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}}
16279 \compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16280
16281 \compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16282 \compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
16283 \compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
16284 \compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
16285
16286
16287 \compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
16288 \compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
16289 \compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
16290 \compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
16291 \compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
16292 \compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
16293 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
16294
16295 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
16296 \compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
16297
16298 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
16299 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
16300 \compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
16301 \compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
16302 \compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
16303
16304 \compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
16305 \compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
16306 \compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
16307 \compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
16308 \compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
16309 \compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
16310 \compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
16311 \compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
16312 \compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
16313 \compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
16314 \compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
16315 \compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
16316 \compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
16317 \compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
16318 \compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
16319 \compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
16320 \compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
16321 \compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
16322 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
16323
16324 % % % % % %
16325 % % Begin of Diodes
16326 % % % % % %
16327
16328 \def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
16329 \def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
16330 \def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
16331 \def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
16332 \def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
16333 \def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
16334 \def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
16335 \def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
16336 \def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
16337 \def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
16338 \def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
16339 \def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
16340 \def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
16341 \def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
16342 \def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
16343 \def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
16344 \def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
16345 \def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
16346
16347 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
16348 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
16349 \compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
16350 \compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
16351 \compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
16352 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
16353 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
16354 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
16355 \compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
16356 \compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
16357 \compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
16358
16359 \compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
16360 \compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
16361 \compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
16362 \compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
16363 \compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
16364 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
16365 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
16366 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
16367 \compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
16368 \compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
16369 \compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
16370
16371 \compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
16372 \compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
16373 \compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
16374 \compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
16375 \compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
16376 \compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
16377 \compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
16378 \compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
16379 \compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
16380 %\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
16381
16382 \def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
16383
16384 \compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
16385 \compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
16386 \compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
16387 \compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
16388 \compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
16389 \compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
16390 \compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
16391 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
16392 \compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
16393 \compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
16394 \compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
16395
16396 %% Define Shortcuts
16397 \compattikzset{Do/.style = {\comnpatname empty diode}}
16398 \compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
16399 \compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
16400 \compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
16401 \compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
16402 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
16403 \compattikzset{leDo/.style = {\comnpatname empty led}}
16404 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
16405 \compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
16406 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
16407 \compattikzset{Tro/.style = {\comnpatname empty triac}}
16408
16409 \compattikzset{D*/.style = {\comnpatname full diode}}
16410 \compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
16411 \compattikzset{zD*/.style = {\comnpatname full Zener diode}}
16412 \compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
16413 \compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
16414 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
16415 \compattikzset{leD*/.style = {\comnpatname full led}}
16416 \compattikzset{VC*/.style = {\comnpatname full varcap}}
16417 \compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
16418 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
16419 \compattikzset{Tr*/.style = {\comnpatname full triac}}
16420
16421 \compattikzset{D/.style = {\comnpatname diode}}
16422 \compattikzset{tD/.style = {\comnpatname tunnel diode}}
16423 \compattikzset{zD/.style = {\comnpatname Zener diode}}
16424 \compattikzset{zzD/.style = {\comnpatname ZZener diode}}
16425 \compattikzset{sD/.style = {\comnpatname Schottky diode}}
16426 \compattikzset{pD/.style = {\comnpatname photodiode}}
16427 \compattikzset{leD/.style = {\comnpatname led}}
16428 \compattikzset{VC/.style = {\comnpatname varcap}}
16429 \compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
16430 \compattikzset{Ty/.style = {\comnpatname thyristor}}
16431 \compattikzset{Tr/.style = {\comnpatname triac}}
16432
16433 \compattikzset{D-/.style = {\comnpatname stroke diode}}
16434 \compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
16435 \compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
16436 \compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
16437 \compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
16438 \compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
16439 \compattikzset{leD-/.style = {\comnpatname stroke led}}
16440 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
16441 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
16442 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
16443 \compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
16444
16445 % % % % % %
16446 % % End of Diodes
16447 % % % % % %
16448
16449
16450 \compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
16451 \compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
16452 \compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
16453 \compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
16454 \compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
16455 \compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
16456 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
16457 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
16458 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16459 \compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16460 \compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
16461 \compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
16462 \compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
16463 \compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
16464
16465 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
16466 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
16467 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
16468 \tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
16469
16470 % cute switches
16471 %% closed cute switch
16472 \def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
16473 \compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
16474 \compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
16475
16476 %% open cute switch
16477 \def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
16478 \compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
16479 \compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
16480
16481 %% closing cute switch
16482 \def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
16483 \compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
16484 \compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
16485
16486 %% opening cute switch
16487 \def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
16488 \compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
16489 \compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
16490
16491
16492 % short forms
16493 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16494 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16495 \compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
16496 \compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
16497
16498 \compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
16499 \compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
16500
16501 \compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
16502 \compattikzset{isource/.style = {\comnpatname current source = #1}}
16503 \compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
16504 \compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
16505 \compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
16506 \compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
16507 \compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
16508 \compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
16509 \compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
16510 \compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16511
16512 \compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
16513 \compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
16514 \compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16515 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
16516
16517 \compattikzset{R/.style= {\comnpatname resistor = #1}}
16518 \compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
16519 \compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
16520 \compattikzset{thR/.style= {\comnpatname thermistor = #1}}
16521 \compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
16522 \compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
16523 \compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
16524 \compattikzset{C/.style = {\comnpatname capacitor = #1}}
16525 \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
16526 \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
16527 \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
16528 \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
16529 \compattikzset{L/.style = {\comnpatname inductor = #1}}
16530 \compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
16531 \compattikzset{V/.style = {\comnpatname voltage source = #1}}
16532 \compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
16533 \compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
16534 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
16535 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
16536 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
16537 \def\pgf@temp#1{
16538 \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
16539 \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
16540 \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
16541 \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
16542 }
16543 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
16544 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
16545
16546 %current sources
16547 \compattikzset{I/.style = {\comnpatname current source = #1}}
16548 \compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
16549 \compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
16550 \compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
16551 \def\pgf@temp#1{
16552 \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
16553 \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
16554 \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
16555 \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
16556 }
16557 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
16558 \pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
16559 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
16560
16561 % cute sources
16562 \def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
16563 \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}}
16564 \compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
16565 \compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
16566
16567 \def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
16568 \compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16569 \compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
16570 \compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
16571
16572 \def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
16573 \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}}
16574 \compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
16575 \compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
16576
16577 \def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
16578 \compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16579 \compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
16580 \compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
16581
16582 % noise sources
16583 \def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
16584 \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}}
16585 \compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
16586 \compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
16587
16588 \def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
16589 \compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
16590 \compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
16591 \compattikzset{nI/.style= {\comnpatname noise current source= #1}}
16592
16593 % resistive sensor american style
16594 \def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
16595 \compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
16596 \compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
16597 \compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
16598 \compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
16599
16600 \compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
16601 \compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
16602
16603 \compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
16604 \compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
16605 \compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
16606 \compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
16607 \compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
16608
16609 \compattikzset{Mr/.style = {\comnpatname memristor}}
16610
16611 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
16612 \compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
16613 \compattikzset{spst/.style = {\comnpatname switch = #1}}
16614
16615 \compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
16616
16617 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
16618 \compattikzset{vss/.style = {\comnpatname vee = #1}}
16619
16620 % activate the to-style crossing
16621 \def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
16622 \compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
16623 \compattikzset{xing/.style= {\comnpatname crossing= #1}}
16624
16625 %% loudspeaker and microphone
16626
16627 \def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
16628 \compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
16629
16630 \def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
16631 \compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
16632
16633 % more instrument
16634 \def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
16635 \compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
16636 \def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
16637 \compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
16638 \def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
16639 \compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
16640 % current loop probes
16641 \def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
16642 \compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
16643 \def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
16644 \compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
16645 % qucs-style probes
16646 \def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
16647 \compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
16648 \def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
16649 \compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
16650 \def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
16651 \compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
16652
16653
16654 % Transistor like bipoles
16655
16656 \def\pgf@circ@trans@path#1#2{
16657 \pgfextra{
16658 \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
16659 \def\pgf@circ@temp{#2}
16660 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
16661 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
16662 \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
16663 \fi
16664 }
16665 \ifpgf@circuit@bipole@inverted
16666 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
16667 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
16668 \else
16669 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
16670 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
16671 \fi
16672 \pgfextra{
16673 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
16674 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
16675 \pgfmathadd{\pgfmathresult}{-90}
16676 \pgfmathround{\pgfmathresult}
16677 \edef\pgf@circ@direction{\pgfmathresult}
16678 }
16679 ($(\tikztostart) ! .5 ! (\tikztotarget)$)
16680 node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
16681 (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
16682 \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
16683 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
16684 (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
16685 \else
16686 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
16687 (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
16688 \fi
16689 \pgfextra{
16690 \pgfcircresetpath
16691 }
16692 (\tikztotarget) \tikztonodes % e si continua
16693 }
16694
16695
16696 \def\pgf@circ@definetranspath#1{
16697 \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
16698 }
16699
16700 \pgf@circ@definetranspath{elmech}
16701 \pgf@circ@definetranspath{nmos}
16702 \pgf@circ@definetranspath{pmos}
16703 \pgf@circ@definetranspath{hemt}
16704 \pgf@circ@definetranspath{npn}
16705 \pgf@circ@definetranspath{pnp}
16706 \pgf@circ@definetranspath{nfet}
16707 \pgf@circ@definetranspath{nigfete}
16708 \pgf@circ@definetranspath{nigfetd}
16709 \pgf@circ@definetranspath{nigfetebulk}
16710 \pgf@circ@definetranspath{pfet}
16711 \pgf@circ@definetranspath{pigfete}
16712 \pgf@circ@definetranspath{pigfetd}
16713 \pgf@circ@definetranspath{pigfetebulk}
16714 \pgf@circ@definetranspath{njfet}
16715 \pgf@circ@definetranspath{pjfet}
16716 \pgf@circ@definetranspath{pigbt}
16717 \pgf@circ@definetranspath{nigbt}
16718 \pgf@circ@definetranspath{Lpigbt}
16719 \pgf@circ@definetranspath{Lnigbt}
16720 %%%---------- close: tex/pgfcircpath
16721
16722 \ifpgf@circ@siunitx
16723 \RequirePackage{xstring}[2009/03/13]
16724 %\expandafter\let\csname angstrom\endcsname\relax
16725 \RequirePackage{siunitx}
16726 \fi
16727
16728 \ifpgf@circ@explicitvdir\else
16729 \PackageWarningNoLine{circuitikz}{%
16730 You did not specify one of the voltage directions:\MessageBreak
16731 \space\space oldvoltagedirection, nooldvoltagedirection, \MessageBreak
16732 \space\space RPvoltages or EFvoltages \MessageBreak
16733 Default directions may have changed, \MessageBreak
16734 please check the manual%
16735 }
16736 \fi
16737
16738 \newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
16739 %override (unused) circuitikz environment for compability to externalization)
16740 \let\circuitikz\tikzpicture
16741 \let\endcircuitikz\endtikzpicture
16742
16743 \endinput