Debian Codegraph @

texmf-dist/tex/latex/circuitikz/circuitikz-1.0-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{1.0}
16 \def\pgfcircversiondate{2020/02/04}
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 \DeclareOption{legacytransistorstext}{
257 \pgf@circuit@transisors@fixlabelsfalse
258 }
259
260 \DeclareOption{nolegacytransistorstext}{
261 \pgf@circuit@transisors@fixlabelstrue
262 }
263
264 \DeclareOption{centertransistorstext}{
265 \pgf@circuit@transisors@fixlabelstrue
266 }
267
268 \DeclareOption{betterproportions}{
269 \ctikzset{monopoles/ground/width/.initial=.15}
270
271 \ctikzset{bipoles/resistor/height/.initial=.23}
272 \ctikzset{bipoles/resistor/width/.initial=.6}
273 \ctikzset{bipoles/capacitor/height/.initial=.4}
274 \ctikzset{bipoles/capacitor/width/.initial=.1}
275 \ctikzset{bipoles/potentiometer/height/.initial=.6}
276 \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
277 \ctikzset{bipoles/potentiometer/width/.initial=.6}
278 \ctikzset{bipoles/photoresistor/height/.initial=.6}
279 \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
280 \ctikzset{bipoles/photoresistor/width/.initial=.6}
281 \ctikzset{bipoles/thermistor/main/.initial=.7}
282 \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
283 \ctikzset{bipoles/thermistor/width/.initial=.6}
284 \ctikzset{bipoles/thermistorntc/width/.initial=.6}
285 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
286 \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
287 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
288 \ctikzset{bipoles/thermistorptc/width/.initial=.6}
289 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
290 \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
291 \ctikzset{bipoles/varistor/main/.initial=.7}
292 \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
293 \ctikzset{bipoles/varistor/width/.initial=.6}
294 \ctikzset{bipoles/vresistor/height/.initial=.45}
295 \ctikzset{bipoles/vresistor/width/.initial=.6}
296 \ctikzset{bipoles/generic/height/.initial=.23}
297 \ctikzset{bipoles/generic/width/.initial=.6}
298 \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
299 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
300 \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
301 \ctikzset{bipoles/ageneric/height/.initial=.23}
302 \ctikzset{bipoles/ageneric/width/.initial=.6}
303 \ctikzset{bipoles/memristor/height/.initial=.23}
304 \ctikzset{bipoles/memristor/wave height/.initial=.375}
305 \ctikzset{bipoles/memristor/width/.initial=.60}
306 \ctikzset{bipoles/tgeneric/height/.initial=.525}
307 \ctikzset{bipoles/tgeneric/width/.initial=.6}
308 \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
309 \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
310 \ctikzset{bipoles/fullgeneric/height/.initial=.23}
311 \ctikzset{bipoles/fullgeneric/width/.initial=.6}
312 \ctikzset{bipoles/diode/height/.initial=.3}
313 \ctikzset{bipoles/diode/width/.initial=.25}
314 \ctikzset{bipoles/bidirectionaldiode/height/.initial=.66}
315 \ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
316 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
317 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
318
319 \ctikzset{tripoles/thyristor/height/.initial=.66}
320 \ctikzset{tripoles/thyristor/height 2/.initial=.3}
321 \ctikzset{tripoles/thyristor/width/.initial=.6}
322 \ctikzset{tripoles/thyristor/diode height/.initial=.3}
323 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
324 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
325
326 \ctikzset{tripoles/triac/height/.initial=.66}
327 \ctikzset{tripoles/triac/width/.initial=.6}
328 \ctikzset{tripoles/triac/diode width left/.initial=.3}
329 \ctikzset{tripoles/triac/diode width right/.initial=.3}
330 }
331
332 % This is a nice hack that prints all the shapes declared
333 % by the package. Very useful for coverage testing and debugging.
334 %
335 % \let\origpgfdeclareshape=\pgfdeclareshape
336 % \def\pgfdeclareshape#1{%
337 % \typeout{SHAPE:\space"#1"}%
338 % \origpgfdeclareshape{#1}
339 % }
340
341
342 %%%%%%%%%
343 %%%%%%%%%%% Springe nach tex/pgfcirc.defines
344 %%%---------- open: tex/pgfcirc.defines.tex
345 % Copyright 2018-2026 by Romano Giannetti
346 % Copyright 2015-2026 by Stefan Lindner
347 % Copyright 2013-2026 by Stefan Erhardt
348 % Copyright 2007-2026 by Massimo Redaelli
349 %
350 % This file may be distributed and/or modified
351 %
352 % 1. under the LaTeX Project Public License and/or
353 % 2. under the GNU Public License.
354 %
355 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
356
357 %
358 %% Key managements
359
360 \long\def\pgf@circ@comment#1{}
361
362 \def\circuitikzbasekey{/tikz/circuitikz}
363
364 \pgfkeys{\circuitikzbasekey/.is family}
365
366 \def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
367 \let\ctikzset\circuitikzset
368 \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
369 \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
370
371 %% Temporary Counters
372
373 \newcount\pgf@circ@count@a
374 \newcount\pgf@circ@count@b
375 \newcount\pgf@circ@count@c
376 %%%%%%%%%%%%
377 %% Dimensions
378
379 % coordinates
380 \newdimen\pgf@circ@res@up
381 \newdimen\pgf@circ@res@down
382 \newdimen\pgf@circ@res@zero
383 \newdimen\pgf@circ@res@left
384 \newdimen\pgf@circ@res@right
385 \newdimen\pgf@circ@res@other
386 \newdimen\pgf@circ@res@step
387 \newdimen\pgf@circ@res@temp
388 % inital thickness
389 \newdimen \pgfstartlinewidth
390
391 % arrow tips, ported over old arrows library (deprecated)
392 % see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
393 % this was the original definition of latex' tips, renamed to avoid clashes
394 %
395 \pgfarrowsdeclare{latexslim}{latexslim}
396 {
397 \pgfutil@tempdima=0.28pt%
398 \advance\pgfutil@tempdima by.3\pgflinewidth%
399 \pgfarrowsleftextend{+-4\pgfutil@tempdima}
400 \pgfarrowsrightextend{+6\pgfutil@tempdima}
401 }
402 {
403 \pgfutil@tempdima=0.28pt%
404 \advance\pgfutil@tempdima by.3\pgflinewidth%
405 \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
406 \pgfpathcurveto
407 {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
408 {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
409 {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
410 \pgfpathcurveto
411 {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
412 {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
413 {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
414 \pgfpathcurveto
415 {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
416 {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
417 {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
418 \pgfpathclose
419 \pgfusepathqfill
420 }
421
422 \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
423
424 \def\pgf@circ@setifdefinedfill#1#2{%
425 % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
426 % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
427 \ifdefined\ctikzclass
428 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
429 {% yes, it's defined
430 \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
431 \ifx\@@tmp\@@none % but it's none
432 \pgfusepath{#2}%
433 \else
434 \pgfsetfillcolor{\@@tmp}%
435 \pgfusepath{#1}%
436 \fi
437 }{% the class is defined but the fill key not; use #2
438 \pgfusepath{#2}%
439 }
440 \else
441 \pgfusepath{#2}%
442 \fi
443 }
444
445 %% Macro to fill or draw
446
447 \def\pgf@circ@draworfill{%
448 \ifx\tikz@fillcolor\pgfutil@empty
449 \pgf@circ@setifdefinedfill{draw,fill}{draw}
450 \else
451 \pgfsetfillcolor{\tikz@fillcolor}
452 \pgfusepath{draw, fill}
453 \fi
454 }
455
456 \def\pgf@circ@draworfillandclip{%
457 \ifx\tikz@fillcolor\pgfutil@empty
458 \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
459 \pgfusepath{draw, clip}
460 \else
461 \pgfsetfillcolor{\tikz@fillcolor}
462 \pgfusepath{draw, clip, fill}
463 \fi
464 }
465
466 \def\pgf@circ@maybefill{%
467 \ifx\tikz@fillcolor\pgfutil@empty
468 \pgf@circ@setifdefinedfill{fill}{discard}
469 \else
470 \pgfsetfillcolor{\tikz@fillcolor}
471 \pgfusepath{fill}
472 \fi
473 }
474
475 %% Macros for setting linewidth
476 % #1 is the legacy class (bipoles, tripoles) etc
477 % #2 is the reference linewidth
478 \def\pgf@circ@setlinewidth#1#2{%
479 \ifdefined\ctikzclass
480 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
481 {% yes, it's defined
482 \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
483 \ifx\@@tmp\@@none % but it's none
484 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
485 \else
486 \pgfsetlinewidth{\@@tmp #2}%
487 \fi
488 }{ % key not defined, do the legacy thing
489 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
490 }% Ok, do nothing
491 \else % no class
492 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
493 \fi
494 }
495 % use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
496 \ctikzset{none/thickness/.initial=1.0} % do not touch
497
498 %% font changes compatible with plain/LaTeX/ConTeXt
499 %% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605
500
501 \ifpgfutil@format@is@latex
502 \long\def\pgf@circ@font@tiny{\tiny}
503 \long\def\pgf@circ@font@small{\small}
504 \long\def\pgf@circ@font@bold{\textbf}
505 \long\def\pgf@circ@font@boldmath{\boldmath}
506 \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath}
507 \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath}
508 \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont}
509 \else\ifpgfutil@format@is@plain
510 \long\def\pgf@circ@font@tiny{\fiverm}
511 \long\def\pgf@circ@font@small{\sevenrm}
512 \long\def\pgf@circ@font@bold#1{{\bf#1}}
513 \long\def\pgf@circ@font@boldmath{\bf} % to be tested
514 \long\def\pgf@circ@font@sixbm{\sevenrm\bf} %
515 \long\def\pgf@circ@font@tenbm{\tenrm\bf} %
516 \long\def\pgf@circ@font@twelve{\twelverm} %
517 \else\ifpgfutil@format@is@context
518 \long\def\pgf@circ@font@tiny{\tfxx}
519 \long\def\pgf@circ@font@small{\tfx}
520 \long\def\pgf@circ@font@bold{\bold}
521 \long\def\pgf@circ@font@boldmath{\bold} % to be tested
522 \long\def\pgf@circ@font@sixbm{\tfx\bold} %
523 \long\def\pgf@circ@font@tenbm{\normal\bold}%
524 \long\def\pgf@circ@font@twelve{\tfa} %
525 \fi\fi\fi
526
527
528 %
529 % Thanks to Phelype Oleinik https://tex.stackexchange.com/a/520806/38080
530 %
531 % this is needed to avoid problems with \ConTeXt
532 \ifcsname normalunexpanded\endcsname
533 \let\pgfcircutil@unexpanded\normalunexpanded
534 \else
535 \let\pgfcircutil@unexpanded\unexpanded
536 \fi
537 % minimally expand a pgfkey to check if it's {}/undefined or filled.
538 \def\unexpandedvalueof#1{%
539 \pgfcircutil@unexpanded\expandafter\expandafter
540 \expandafter\pgf@circ@valueof@chk\pgfkeysvalueof{#1}}
541 \def\pgf@circ@valueof@chk#1{%
542 \ifx\relax#1%
543 \expandafter\pgfutil@firstoftwo
544 \else
545 \expandafter\pgfutil@secondoftwo
546 \fi
547 {{}}% #1 is \relax, so consider empty
548 {\expandafter{#1}}% otherwise, leave the key after one more expansion
549 }%
550
551 % voltage options
552
553 \newif\ifpgf@circ@siunitx
554 \newif\ifpgf@circuit@compat
555 \newif\ifpgf@circ@oldvoltagedirection % default false
556 \newif\ifpgf@circ@explicitvdir
557 \newif\ifpgf@circ@fixbatteries
558
559 \ctikzset{voltage dir/.is choice}
560 \ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
561 \ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
562 \ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
563 \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
564 \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
565
566 % Option ">" for twoports
567 \newif\ifpgf@circuit@inputarrow
568 \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
569 \ctikzset{inputarrow/.is choice}
570 \ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
571 \ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
572
573 % Option "boxed" for nodes and twoports
574 \newif\ifpgf@circuit@boxed
575 \pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
576 \ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
577 \pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
578 \ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
579
580 % Option "dashed" for nodes and twoports
581 \newif\ifpgf@circuit@dashed
582 \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
583 \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
584
585 % Option "t=*" for nodes
586 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
587
588 \ctikzset{current arrow scale/.initial=16}
589
590 \ctikzset{bipoles/.is family}
591 \ctikzset{bipoles/border margin/.initial=1.1}
592 \ctikzset{bipoles/thickness/.initial=2}
593 \ctikzset{tripoles/thickness/.initial=2}
594 \ctikzset{quadpoles/thickness/.initial=2}
595 \ctikzset{nodes width/.initial=.04}
596
597 % Base len for all circuitikz
598 \newdimen\pgf@circ@Rlen
599 % scaled length for internal use in scalable shapes
600 \newdimen\pgf@circ@scaled@Rlen
601 \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}}
602 \pgf@circ@Rlen = 1.4cm
603 % by default scale is 1.0
604 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
605
606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
607 %% main style definitions
608 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
609
610
611
612 % load a style file: search ctikzstyle-NAME.tex in path
613 \def\ctikzloadstyle#1{%
614 \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{%
615 \tikzerror{I did not find the circuitikz style #1}}%
616 }
617
618 % load and enact a style
619 \def\ctikzsetstyle#1{%
620 \ctikzloadstyle{#1}%
621 \tikzset{#1 circuit style}%
622 }
623
624 % global style parameters
625 \ctikzset{default/scale/.initial=1.0} % do not touch
626 \ctikzset{default/fill/.initial=none} % do not touch
627 \ctikzset{default/thickness/.initial=none} % do not touch
628 % default is use as the generic default style for bipoles
629
630 % mostly bipoles:
631
632 \ctikzset{resistors/scale/.initial=1.0}
633 \ctikzset{resistors/fill/.initial=none}
634 \ctikzset{resistors/thickness/.initial=none}
635
636 \ctikzset{capacitors/scale/.initial=1.0}
637 \ctikzset{capacitors/fill/.initial=none}
638 \ctikzset{capacitors/thickness/.initial=none}
639
640 \ctikzset{inductors/scale/.initial=1.0}
641 \ctikzset{inductors/fill/.initial=none}
642 \ctikzset{inductors/thickness/.initial=none}
643
644 \ctikzset{diodes/scale/.initial=1.0}
645 \ctikzset{diodes/fill/.initial=none}
646 \ctikzset{diodes/thickness/.initial=none}
647
648 \ctikzset{batteries/scale/.initial=1.0}
649 \ctikzset{batteries/fill/.initial=none}
650 \ctikzset{batteries/thickness/.initial=none}
651
652 \ctikzset{sources/scale/.initial=1.0}
653 \ctikzset{sources/fill/.initial=none}
654 \ctikzset{sources/thickness/.initial=none}
655
656 \ctikzset{csources/scale/.initial=1.0}
657 \ctikzset{csources/fill/.initial=none}
658 \ctikzset{csources/thickness/.initial=none}
659
660 \ctikzset{instruments/scale/.initial=1.0}
661 \ctikzset{instruments/fill/.initial=none}
662 \ctikzset{instruments/thickness/.initial=none}
663
664 \ctikzset{mechanicals/scale/.initial=1.0}
665 \ctikzset{mechanicals/fill/.initial=none}
666 \ctikzset{mechanicals/thickness/.initial=none}
667
668 \ctikzset{misc/scale/.initial=1.0}
669 \ctikzset{misc/fill/.initial=none}
670 \ctikzset{misc/thickness/.initial=none}
671
672 \ctikzset{blocks/scale/.initial=1.0}
673 \ctikzset{blocks/fill/.initial=none}
674 \ctikzset{blocks/thickness/.initial=none}
675
676 % mostly nodes
677
678 \ctikzset{grounds/scale/.initial=1.0}
679 \ctikzset{grounds/fill/.initial=none}
680 \ctikzset{grounds/thickness/.initial=none}
681
682 \ctikzset{power supplies/scale/.initial=1.0}
683 \ctikzset{power supplies/fill/.initial=none}
684 \ctikzset{power supplies/thickness/.initial=none}
685
686 \ctikzset{transistors/scale/.initial=1.0}
687 \ctikzset{transistors/fill/.initial=none}
688 \ctikzset{transistors/thickness/.initial=none}
689
690 \ctikzset{tubes/scale/.initial=1.0}
691 \ctikzset{tubes/fill/.initial=none}
692 \ctikzset{tubes/thickness/.initial=none}
693
694 \ctikzset{RF/scale/.initial=1.0}
695 \ctikzset{RF/fill/.initial=none}
696 \ctikzset{RF/thickness/.initial=none}
697
698 \ctikzset{electromechanicals/scale/.initial=1.0}
699 \ctikzset{electromechanicals/fill/.initial=none}
700 \ctikzset{electromechanicals/thickness/.initial=none}
701
702 % transformers go with inductors
703 \ctikzset{amplifiers/scale/.initial=1.0}
704 \ctikzset{amplifiers/fill/.initial=none}
705 \ctikzset{amplifiers/thickness/.initial=none}
706
707 \ctikzset{switches/scale/.initial=1.0}
708 \ctikzset{switches/fill/.initial=none}
709 \ctikzset{switches/thickness/.initial=none}
710
711 \ctikzset{logic ports/scale/.initial=1.0}
712 \ctikzset{logic ports/fill/.initial=none}
713 \ctikzset{logic ports/thickness/.initial=none}
714
715 \ctikzset{flipflops/scale/.initial=1.0}
716 \ctikzset{flipflops/fill/.initial=none}
717 \ctikzset{flipflops/thickness/.initial=none}
718
719 \ctikzset{muxdemuxes/scale/.initial=1.0}
720 \ctikzset{muxdemuxes/fill/.initial=none}
721 \ctikzset{muxdemuxes/thickness/.initial=none}
722
723 \ctikzset{chips/scale/.initial=1.0}
724 \ctikzset{chips/fill/.initial=none}
725 \ctikzset{chips/thickness/.initial=none}
726
727 \ctikzset{displays/scale/.initial=1.0}
728 \ctikzset{displays/fill/.initial=none}
729 \ctikzset{displays/thickness/.initial=none}
730
731 % grounds and power supplies
732
733 \ctikzset{monopoles/.is family}
734 \ctikzset{monopoles/ground/width/.initial=.25}
735 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
736 \ctikzset{monopoles/ground/thickness/.initial=2}
737 \ctikzset{monopoles/rground/thickness/.initial=2}
738 \ctikzset{monopoles/tground/thickness/.initial=3}
739 \ctikzset{monopoles/vcc/width/.initial=.2}
740 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
741 \ctikzset{monopoles/vee/arrow/.initial=legacy}
742 \ctikzset{monopoles/match/width/.initial=.4}
743 \ctikzset{monopoles/chassis/width/.initial=.25}
744 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
745 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
746 \ctikzset{monopoles/antenna/width/.initial=.25}
747 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
748 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
749 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
750 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
751 \ctikzset{monopoles/txantenna/width/.initial=.25}
752 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
753 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
754 \ctikzset{monopoles/rxantenna/width/.initial=.25}
755 \ctikzset{monopoles/bareantenna/width/.initial=.25}
756 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
757 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
758 \ctikzset{monopoles/waves/width/.initial=0.5}
759
760 % microstrips
761 \ctikzset{bipoles/mstline/height/.initial=0.3}
762 \ctikzset{bipoles/mstline/width/.initial=1.2}
763 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
764 \ctikzset{monopoles/msport/width/.initial=.5}
765 \ctikzset{monopoles/msrstub/height/.initial=1.0}
766 \ctikzset{monopoles/msrstub/width/.initial=0.6}
767
768 % microphone and loudspeaker
769 \ctikzset{bipoles/loudspeaker/height/.initial=.8}
770 \ctikzset{bipoles/loudspeaker/depth/.initial=.3}
771 \ctikzset{bipoles/loudspeaker/width/.initial=.8}
772 \ctikzset{bipoles/mic/height/.initial=1.2}
773 \ctikzset{bipoles/mic/depth/.initial=.0}
774 \ctikzset{bipoles/mic/width/.initial=.8}
775
776 % Zig Zag resistors
777 \ctikzset{resistors/zigs/.initial=3}
778 \ctikzset{resistors/width/.code={%
779 \ctikzset{bipoles/resistor/width=#1}%
780 \ctikzset{bipoles/vresistor/width=#1}%
781 \ctikzset{bipoles/potentiometer/width=#1}%
782 \ctikzset{bipoles/resistivesens/width=#1}%
783 \ctikzset{bipoles/photoresistor/width=#1}%
784 \ctikzset{bipoles/thermistor/width=#1}%
785 \ctikzset{bipoles/thermistorntc/width=#1}%
786 \ctikzset{bipoles/thermistorptc/width=#1}%
787 \ctikzset{bipoles/varistor/width=#1}%
788 \ctikzset{bipoles/generic/width=#1}%
789 \ctikzset{bipoles/generic potentiometer/width=#1}%
790 \ctikzset{bipoles/ageneric/width=#1}%
791 \ctikzset{bipoles/tgeneric/width=#1}%
792 }}
793 \ctikzset{wiper pos/.code={%
794 \ctikzset{bipoles/potentiometer/wiper pos=#1}%
795 \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
796 }}
797 % zigzag resistor
798 \ctikzset{bipoles/resistor/height/.initial=.3}
799 \ctikzset{bipoles/resistor/width/.initial=.8}
800 \ctikzset{bipoles/potentiometer/height/.initial=.8}
801 \ctikzset{bipoles/potentiometer/height 2/.initial=.3}
802 \ctikzset{bipoles/potentiometer/width/.initial=.8}
803 \ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
804 \ctikzset{bipoles/vresistor/height/.initial=.6}
805 \ctikzset{bipoles/vresistor/width/.initial=.8}
806 \ctikzset{bipoles/resistivesens/height/.initial=.6}
807 \ctikzset{bipoles/resistivesens/width/.initial=.8}
808 % square resistors
809 \ctikzset{bipoles/photoresistor/height/.initial=.6}
810 \ctikzset{bipoles/photoresistor/height 2/.initial=.3}
811 \ctikzset{bipoles/photoresistor/width/.initial=.8}
812 \ctikzset{bipoles/thermistor/main/.initial=.7}
813 \ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
814 \ctikzset{bipoles/thermistorntc/width/.initial=.8}
815 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
816 \ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
817 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
818 \ctikzset{bipoles/thermistorptc/width/.initial=.8}
819 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
820 \ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
821 \ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
822 \ctikzset{bipoles/thermistor/width/.initial=.8}
823 \ctikzset{bipoles/varistor/main/.initial=.7}
824 \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
825 \ctikzset{bipoles/varistor/width/.initial=.8}
826 \ctikzset{bipoles/generic/height/.initial=.30}
827 \ctikzset{bipoles/generic/width/.initial=.80}
828 \ctikzset{bipoles/generic potentiometer/height/.initial=.80}
829 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
830 \ctikzset{bipoles/generic potentiometer/width/.initial=.80}
831 \ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
832 \ctikzset{bipoles/ageneric/height/.initial=.30}
833 \ctikzset{bipoles/tgeneric/height/.initial=.70}
834 \ctikzset{bipoles/tgeneric/width/.initial=.80}
835 \ctikzset{bipoles/ageneric/width/.initial=.80}
836
837 %% Capacitors
838 \ctikzset{bipoles/capacitor/height/.initial=.6}
839 \ctikzset{bipoles/capacitor/width/.initial=.2}
840 \ctikzset{bipoles/ecapacitor/height/.initial=.5}
841 \ctikzset{bipoles/ecapacitor/width/.initial=.2}
842 \ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm}
843 %%% pcapacitor is deprecated
844 \ctikzset{bipoles/pcapacitor/height/.initial=.6}
845 \ctikzset{bipoles/pcapacitor/width/.initial=.2}
846 \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
847 \ctikzset{bipoles/ccapacitor/height/.initial=.6}
848 \ctikzset{bipoles/ccapacitor/width/.initial=.12}
849 \ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
850 \ctikzset{bipoles/vcapacitor/height/.initial=.6}
851 \ctikzset{bipoles/vcapacitor/width/.initial=.5}
852 \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
853 \ctikzset{bipoles/piezoelectric/height/.initial=.7}
854 \ctikzset{bipoles/piezoelectric/width/.initial=.5}
855
856 % Inductors
857 \ctikzset{inductors/coils/.code={%
858 \ctikzset{bipoles/cuteinductor/coils=#1}%
859 \ctikzset{bipoles/cutechoke/coils=#1}%
860 \ctikzset{bipoles/americaninductor/coils=#1}%
861 \ctikzset{bipoles/vcuteinductor/coils=#1}%
862 \ctikzset{bipoles/vamericaninductor/coils=#1}%
863 }}
864 \ctikzset{inductors/width/.code={%
865 \ctikzset{bipoles/cuteinductor/width=#1}%
866 \ctikzset{bipoles/cutechoke/width=#1}%
867 \ctikzset{bipoles/americaninductor/width=#1}%
868 \ctikzset{bipoles/vcuteinductor/width=#1}%
869 \ctikzset{bipoles/vamericaninductor/width=#1}%
870 \ctikzset{bipoles/fullgeneric/width=#1}%
871 \ctikzset{bipoles/tfullgeneric/width=#1}%
872 }}
873 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
874 \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
875 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
876 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
877 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
878 %% Cute choke settings
879 \ctikzset{bipoles/cutechoke/height/.initial=.3}
880 \ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
881 \ctikzset{bipoles/cutechoke/width/.initial=.6}
882 \ctikzset{bipoles/cutechoke/coils/.initial=5}
883 \ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
884 \ctikzset{bipoles/cutechoke/cstep/.initial=.3}
885 \ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
886 \ctikzset{bipoles/cutechoke/cthick/.initial=1}
887 \newif\ifpgf@circuit@bipole@twolineschoke
888 \pgf@circuit@bipole@twolineschokefalse
889 \pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
890 \ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
891 \pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
892 \ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
893 %
894 \ctikzset{bipoles/americaninductor/height/.initial=.3}
895 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
896 \ctikzset{bipoles/americaninductor/width/.initial=.8}
897 \ctikzset{bipoles/americaninductor/coils/.initial=4}
898 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
899 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
900 \ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
901 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
902 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
903 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
904 \ctikzset{bipoles/vamericaninductor/height/.initial=.6}
905 \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
906 \ctikzset{bipoles/vamericaninductor/width/.initial=.8}
907 \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
908 \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
909 \ctikzset{bipoles/tfullgeneric/height/.initial=.70}
910 \ctikzset{bipoles/tfullgeneric/width/.initial=.80}
911 \ctikzset{bipoles/fullgeneric/height/.initial=.30}
912 \ctikzset{bipoles/fullgeneric/width/.initial=.80}
913
914 % Sources
915
916 \ctikzset{bipoles/esource/height/.initial=.60}
917 \ctikzset{bipoles/esource/width/.initial=.60}
918 \ctikzset{bipoles/pvsource/height/.initial=.60}
919 \ctikzset{bipoles/pvsource/width/.initial=.60}
920 \ctikzset{bipoles/isource/height/.initial=.60}
921 \ctikzset{bipoles/isource/width/.initial=.60}
922 \ctikzset{bipoles/oosource/height/.initial=.60}
923 \ctikzset{bipoles/oosource/width/.initial=.60}
924 \ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
925 \ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
926 \ctikzset{bipoles/dcisource/angle/.initial=80}
927 \ctikzset{bipoles/dcisource/height/.initial=.60}
928 \ctikzset{bipoles/dcisource/width/.initial=.60}
929 \ctikzset{bipoles/dcvsource/height/.initial=.60}
930 \ctikzset{bipoles/dcvsource/width/.initial=.60}
931 \ctikzset{bipoles/vsourcetri/height/.initial=.60}
932 \ctikzset{bipoles/vsourcetri/width/.initial=.60}
933 \ctikzset{bipoles/isourceam/height/.initial=.60}
934 \ctikzset{bipoles/isourceam/width/.initial=.60}
935 \ctikzset{bipoles/vsource/height/.initial=.60}
936 \ctikzset{bipoles/vsource/width/.initial=.60}
937 \ctikzset{bipoles/vsourceam/height/.initial=.60}
938 \ctikzset{bipoles/vsourceam/width/.initial=.60}
939 \ctikzset{bipoles/vsourceam/margin/.initial=.7}
940 \ctikzset{bipoles/isourcesin/height/.initial=.60}
941 \ctikzset{bipoles/isourcesin/width/.initial=.60}
942 \ctikzset{bipoles/vsourcesin/height/.initial=.60}
943 \ctikzset{bipoles/vsourcesin/width/.initial=.60}
944 \ctikzset{bipoles/vsourcesquare/height/.initial=.60}
945 \ctikzset{bipoles/vsourcesquare/width/.initial=.60}
946 \ctikzset{bipoles/cisource/height/.initial=.7}
947 \ctikzset{bipoles/cisource/width/.initial=.7}
948 \ctikzset{bipoles/cisourceam/height/.initial=.7}
949 \ctikzset{bipoles/cisourceam/width/.initial=.7}
950 \ctikzset{bipoles/ecsource/height/.initial=.7}
951 \ctikzset{bipoles/ecsource/width/.initial=.7}
952 \ctikzset{bipoles/cvsource/height/.initial=.7}
953 \ctikzset{bipoles/cvsource/width/.initial=.7}
954 \ctikzset{bipoles/cvsourceam/height/.initial=.7}
955 \ctikzset{bipoles/cvsourceam/width/.initial=.7}
956 \ctikzset{bipoles/cvsourceam/margin/.initial=.7}
957 \ctikzset{bipoles/cvsourceam/text scale/.initial=1}
958 \ctikzset{bipoles/cisourcesin/width/.initial=.7}
959 \ctikzset{bipoles/cvsourcesin/height/.initial=.7}
960 \ctikzset{bipoles/cvsourcesin/width/.initial=.7}
961 \ctikzset{bipoles/battery/height/.initial=.6}
962 \ctikzset{bipoles/battery/width/.initial=.3}
963 \ctikzset{bipoles/battery1/height/.initial=.6}
964 \ctikzset{bipoles/battery1/width/.initial=.3}
965 \ctikzset{bipoles/battery2/height/.initial=.6}
966 \ctikzset{bipoles/battery2/width/.initial=.3}
967
968 % diodes
969
970 \ctikzset{bipoles/diode/height/.initial=.50}
971 \ctikzset{bipoles/diode/width/.initial=.40}
972 \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
973 \ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
974 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
975 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
976 \ctikzset{bipoles/varcap/height/.initial=.50}
977 \ctikzset{bipoles/varcap/width/.initial=.45}
978
979 % switches
980
981 \ctikzset{bipoles/spst/height/.initial=.35}
982 \ctikzset{bipoles/spst/width/.initial=.35}
983 \ctikzset{bipoles/spst/depth/.initial=.2}
984 \ctikzset{bipoles/nos/height/.initial=.3}
985 \ctikzset{bipoles/nos/width/.initial=.35}
986 \ctikzset{bipoles/nos/depth/.initial=.2}
987 \ctikzset{bipoles/ncs/height/.initial=.35}
988 \ctikzset{bipoles/ncs/width/.initial=.35}
989 \ctikzset{bipoles/ncs/depth/.initial=.2}
990 %%% reed switch
991 \ctikzset{bipoles/reed/height/.initial=.4}
992 \ctikzset{bipoles/reed/width/.initial=.8}% 0.35 in nos
993 \ctikzset{bipoles/reed/depth/.initial=.4}
994
995 % misc
996
997 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
998 \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
999 \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
1000 \ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
1001 \ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
1002 \ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
1003 \ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
1004 \ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
1005 \ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
1006 \ctikzset{bipoles/fuse/height/.initial=.20}
1007 \ctikzset{bipoles/fuse/width/.initial=.50}
1008 \ctikzset{bipoles/afuse/height/.initial=.20}
1009 \ctikzset{bipoles/afuse/width/.initial=.50}
1010 \ctikzset{bipoles/memristor/height/.initial=.30}
1011 \ctikzset{bipoles/memristor/wave height/.initial=.5}
1012 \ctikzset{bipoles/memristor/width/.initial=.80}
1013 \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
1014 \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
1015 \ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
1016 \ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
1017 \ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
1018 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
1019 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
1020 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
1021 % multiwire
1022 \ctikzset{bipoles/multiwire/height/.initial=0.4}
1023 \ctikzset{bipoles/multiwire/width/.initial=0.2}
1024 \ctikzset{bipoles/multiwire/spacing/.initial=0.05}
1025
1026 \ctikzset{bipoles/ammeter/height/.initial=.60}
1027 \ctikzset{bipoles/ammeter/width/.initial=.60}
1028 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
1029 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
1030 \ctikzset{bipoles/voltmeter/height/.initial=.60}
1031 \ctikzset{bipoles/voltmeter/width/.initial=.60}
1032 \ctikzset{bipoles/smeter/height/.initial=.60}
1033 \ctikzset{bipoles/smeter/width/.initial=.60}
1034 \ctikzset{bipoles/smeter/voltage/additional label shift/.initial=1}
1035 \ctikzset{bipoles/qmeter/depth/.initial=.40}
1036 \ctikzset{bipoles/qmeter/height/.initial=.80}
1037 \ctikzset{bipoles/qmeter/width/.initial=.60}
1038 % this must be specified for each one
1039 \ctikzset{bipoles/qvprobe/voltage/additional label shift/.initial=.5}
1040 \ctikzset{bipoles/qiprobe/voltage/additional label shift/.initial=.5}
1041 \ctikzset{bipoles/qpprobe/voltage/additional label shift/.initial=.5}
1042 \ctikzset{bipoles/iloop/width/.initial=.40}
1043 \ctikzset{bipoles/iloop/height/.initial=.60}
1044
1045 \ctikzset{bipoles/oscope/height/.initial=.60}
1046 \ctikzset{bipoles/oscope/width/.initial=.60}
1047 \ctikzset{bipoles/oscope/voltage/additional label shift/.initial=1}
1048
1049
1050 % option to not rotate the new (Romano's) instruments
1051 \newif\ifpgf@circuit@straightinstruments\pgf@circuit@straightinstrumentstrue
1052 \pgfkeys{/tikz/straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
1053 \ctikzset{straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}}
1054 \pgfkeys{/tikz/rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
1055 \ctikzset{rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}}
1056
1057
1058 \ctikzset{bipoles/buffer/height/.initial=1}
1059 \ctikzset{bipoles/buffer/width/.initial=1}
1060 \ctikzset{bipoles/not port/width/.initial=1}
1061 \ctikzset{bipoles/not port/height/.initial=.8}
1062 \ctikzset{bipoles/not port/circle width/.initial=.15}
1063 \ctikzset{bipoles/lamp/height/.initial=.60}
1064 \ctikzset{bipoles/lamp/width/.initial=.60}
1065 \ctikzset{bipoles/bulb/height/.initial=.8}
1066 \ctikzset{bipoles/bulb/width/.initial=.8}
1067 \ctikzset{bipoles/tline/height/.initial=.3}
1068 \ctikzset{bipoles/tline/width/.initial=.8}
1069 \ctikzset{bipoles/squid/height/.initial=.60}
1070 \ctikzset{bipoles/squid/width/.initial=.60}
1071 \ctikzset{bipoles/barrier/height/.initial=.60}
1072 \ctikzset{bipoles/barrier/width/.initial=.60}
1073 \ctikzset{bipoles/thermocouple/height/.initial=.250}
1074 \ctikzset{bipoles/thermocouple/height 2/.initial=.60}
1075 \ctikzset{bipoles/thermocouple/width/.initial=.140}
1076 \ctikzset{bipoles/pushbutton/height/.initial=.5}
1077 \ctikzset{bipoles/pushbutton/height 2/.initial=.2}
1078 \ctikzset{bipoles/pushbutton/width/.initial=.50}
1079
1080 \ctikzset{bipoles/twoport/width/.initial=.7}
1081 \ctikzset{bipoles/twoport/height/.initial=.7}
1082 \ctikzset{bipoles/twoport/text/.initial=}
1083 \ctikzset{bipoles/vco/width/.initial=.7}
1084 \ctikzset{bipoles/bandpass/width/.initial=.7}
1085 \ctikzset{bipoles/bandstop/width/.initial=.7}
1086 \ctikzset{bipoles/highpass/width/.initial=.7}
1087 \ctikzset{bipoles/lowpass/width/.initial=.7}
1088 \ctikzset{bipoles/adc/width/.initial=.7}
1089 \ctikzset{bipoles/dac/width/.initial=.7}
1090 \ctikzset{bipoles/dsp/width/.initial=.7}
1091 \ctikzset{bipoles/fft/width/.initial=.7}
1092 \ctikzset{bipoles/amp/width/.initial=.7}
1093 \ctikzset{bipoles/vamp/width/.initial=.7}
1094 \ctikzset{bipoles/piattenuator/width/.initial=.7}
1095 \ctikzset{bipoles/vpiattenuator/width/.initial=.7}
1096 \ctikzset{bipoles/tattenuator/width/.initial=.7}
1097 \ctikzset{bipoles/vtattenuator/width/.initial=.7}
1098 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
1099 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
1100 \ctikzset{bipoles/detector/width/.initial=.7}
1101
1102 % crossing wires
1103 \ctikzset{bipoles/crossing/size/.initial=.2}
1104
1105 % Transistors starts here
1106
1107 \newif\ifpgf@circuit@trans@depletiontype
1108 \pgf@circuit@trans@depletiontypefalse
1109
1110 \newif\ifpgf@circuit@mos@arrows
1111 \ctikzset{tripoles/mos style/.is choice}
1112 \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
1113 \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
1114 \pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
1115 \pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
1116
1117 % Fixed label positions
1118 \newif\ifpgf@circuit@transisors@fixlabels
1119 \pgf@circuit@transisors@fixlabelstrue
1120 \pgfkeys{/tikz/center transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
1121 \ctikzset{fix transistors text/.add code={}{\pgf@circuit@transisors@fixlabelstrue}}
1122 \pgfkeys{/tikz/legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
1123 \ctikzset{legacy transistors text/.add code={}{\pgf@circuit@transisors@fixlabelsfalse}}
1124
1125 % Option solderdot for fet
1126 \newif\ifpgf@circuit@fet@solderdot
1127 \pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
1128 \ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
1129 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
1130 \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
1131
1132 % Option bodydiode for fet
1133 \newif\ifpgf@circuit@fet@bodydiode
1134 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
1135 \ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
1136 \pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
1137 \ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
1138
1139 % Option draw fet without gate connection
1140 \newif\ifpgf@circuit@bpt@drawgate
1141 \pgf@circuit@bpt@drawgatetrue
1142 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1143 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1144 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1145 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1146
1147 % Option draw bpt without base connection
1148 \newif\ifpgf@circuit@bpt@drawbase
1149 \pgf@circuit@bpt@drawbasetrue
1150 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1151 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1152 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1153 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1154
1155 % Option draw bpt with optical input
1156 \newif\ifpgf@circuit@bpt@drawphoto
1157 \pgf@circuit@bpt@drawphotofalse
1158 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1159 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1160 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1161 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1162
1163 % Option draw fet without bulk connection -- Added by Burak Kelleci
1164 \newif\ifpgf@circuit@bpt@drawbulk
1165 \pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
1166 \ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
1167 \pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
1168 \ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
1169
1170 % Option draw pmos with empty circle
1171 \newif\ifpgf@circuit@pmos@emptycircle
1172 \pgf@circuit@pmos@emptycirclefalse
1173 \ctikzset{tripoles/pmos style/.is choice}
1174 \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
1175 \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
1176 % Option draw pmos with no circle
1177 \newif\ifpgf@circuit@pmos@nocircle
1178 \pgf@circuit@pmos@nocirclefalse
1179 \pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
1180 \ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
1181 % back to normal
1182 \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
1183 \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
1184 % arrows at the end, the correct way
1185 \newif\ifpgf@circuit@trans@arrowatend
1186 \pgf@circuit@trans@arrowatendfalse
1187 \ctikzset{transistors/arrow pos/.is choice}
1188 \ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}}
1189 \ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}}
1190
1191 \newif\ifpgf@circuit@trans@ntype
1192 \pgf@circuit@trans@ntypetrue %default true
1193 %\newif\ifpgf@circuit@trans@ptype
1194 %\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
1195 \ctikzset{tripoles/nmos/width/.initial=.7}
1196 \ctikzset{tripoles/nmos/gate height/.initial=.35}
1197 \ctikzset{tripoles/nmos/base height/.initial=.5}
1198 \ctikzset{tripoles/nmos/conn height/.initial=0}
1199 \ctikzset{tripoles/nmos/height/.initial=1.1}
1200 \ctikzset{tripoles/nmos/base width/.initial=.5}
1201 \ctikzset{tripoles/nmos/gate width/.initial=.62}
1202 \ctikzset{tripoles/nmos/arrow pos/.initial=.6}
1203 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
1204 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
1205 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
1206 \ctikzset{tripoles/nmos/curr direction/.initial=1}
1207
1208 \ctikzset{tripoles/pmos/width/.initial=.7}
1209 \ctikzset{tripoles/pmos/gate height/.initial=.35}
1210 \ctikzset{tripoles/pmos/base height/.initial=.5}
1211 \ctikzset{tripoles/pmos/conn height/.initial=0}
1212 \ctikzset{tripoles/pmos/height/.initial=1.1}
1213 \ctikzset{tripoles/pmos/base width/.initial=.5}
1214 \ctikzset{tripoles/pmos/gate width/.initial=.62}
1215 \ctikzset{tripoles/pmos/arrow pos/.initial=.4}
1216 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
1217 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
1218 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
1219 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
1220
1221 \ctikzset{tripoles/hemt/width/.initial=.7}
1222 \ctikzset{tripoles/hemt/gate height/.initial=.35}
1223 \ctikzset{tripoles/hemt/base height/.initial=.5}
1224 \ctikzset{tripoles/hemt/conn height/.initial=0}
1225 \ctikzset{tripoles/hemt/height/.initial=1.1}
1226 \ctikzset{tripoles/hemt/base width/.initial=.5}
1227 \ctikzset{tripoles/hemt/gate width/.initial=.62}
1228 \ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
1229 \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
1230 \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
1231 \ctikzset{tripoles/hemt/curr direction/.initial=1}
1232
1233 \ctikzset{tripoles/nfet/width/.initial=.7}
1234 \ctikzset{tripoles/nfet/gate height/.initial=.35}
1235 \ctikzset{tripoles/nfet/base height/.initial=.5}
1236 \ctikzset{tripoles/nfet/conn height/.initial=0}
1237 \ctikzset{tripoles/nfet/height/.initial=1.1}
1238 \ctikzset{tripoles/nfet/base width/.initial=.5}
1239 \ctikzset{tripoles/nfet/gate width/.initial=.62}
1240 \ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
1241 \ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
1242 \ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
1243 \ctikzset{tripoles/nfet/curr direction/.initial=1}
1244
1245 \ctikzset{tripoles/pfet/width/.initial=.7}
1246 \ctikzset{tripoles/pfet/gate height/.initial=.35}
1247 \ctikzset{tripoles/pfet/base height/.initial=.5}
1248 \ctikzset{tripoles/pfet/conn height/.initial=0}
1249 \ctikzset{tripoles/pfet/height/.initial=1.1}
1250 \ctikzset{tripoles/pfet/base width/.initial=.5}
1251 \ctikzset{tripoles/pfet/gate width/.initial=.62}
1252 \ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
1253 \ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
1254 \ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
1255 \ctikzset{tripoles/pfet/curr direction/.initial=-1}
1256
1257 \ctikzset{tripoles/nigfete/width/.initial=.7}
1258 \ctikzset{tripoles/nigfete/gate height/.initial=.35}
1259 \ctikzset{tripoles/nigfete/base height/.initial=.5}
1260 \ctikzset{tripoles/nigfete/conn height/.initial=.35}
1261 \ctikzset{tripoles/nigfete/height/.initial=1.1}
1262 \ctikzset{tripoles/nigfete/base width/.initial=.5}
1263 \ctikzset{tripoles/nigfete/gate width/.initial=.62}
1264 \ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
1265 \ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
1266 \ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
1267 \ctikzset{tripoles/nigfete/curr direction/.initial=1}
1268
1269 \ctikzset{tripoles/nigfetd/width/.initial=.7}
1270 \ctikzset{tripoles/nigfetd/gate height/.initial=.35}
1271 \ctikzset{tripoles/nigfetd/base height/.initial=.5}
1272 \ctikzset{tripoles/nigfetd/conn height/.initial=.35}
1273 \ctikzset{tripoles/nigfetd/height/.initial=1.1}
1274 \ctikzset{tripoles/nigfetd/base width/.initial=.5}
1275 \ctikzset{tripoles/nigfetd/gate width/.initial=.62}
1276 \ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
1277 \ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
1278 \ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
1279 \ctikzset{tripoles/nigfetd/curr direction/.initial=1}
1280
1281 \ctikzset{tripoles/nigfetebulk/width/.initial=.7}
1282 \ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
1283 \ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
1284 \ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
1285 \ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
1286 \ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
1287 \ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
1288 \ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
1289 \ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
1290 \ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
1291 \ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
1292
1293 \ctikzset{tripoles/pigfete/width/.initial=.7}
1294 \ctikzset{tripoles/pigfete/gate height/.initial=.35}
1295 \ctikzset{tripoles/pigfete/base height/.initial=.5}
1296 \ctikzset{tripoles/pigfete/conn height/.initial=.35}
1297 \ctikzset{tripoles/pigfete/height/.initial=1.1}
1298 \ctikzset{tripoles/pigfete/base width/.initial=.5}
1299 \ctikzset{tripoles/pigfete/gate width/.initial=.62}
1300 \ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
1301 \ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
1302 \ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
1303 \ctikzset{tripoles/pigfete/curr direction/.initial=-1}
1304
1305 \ctikzset{tripoles/pigfetd/width/.initial=.7}
1306 \ctikzset{tripoles/pigfetd/gate height/.initial=.35}
1307 \ctikzset{tripoles/pigfetd/base height/.initial=.5}
1308 \ctikzset{tripoles/pigfetd/conn height/.initial=.35}
1309 \ctikzset{tripoles/pigfetd/height/.initial=1.1}
1310 \ctikzset{tripoles/pigfetd/base width/.initial=.5}
1311 \ctikzset{tripoles/pigfetd/gate width/.initial=.62}
1312 \ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
1313 \ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
1314 \ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
1315 \ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
1316
1317 \ctikzset{tripoles/pigfetebulk/width/.initial=.7}
1318 \ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
1319 \ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
1320 \ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
1321 \ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
1322 \ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
1323 \ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
1324 \ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
1325 \ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
1326 \ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
1327 \ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
1328
1329 \ctikzset{tripoles/npn/width/.initial=.6}
1330 \ctikzset{tripoles/npn/base height/.initial=.45}
1331 \ctikzset{tripoles/npn/base height 2/.initial=.15}
1332 \ctikzset{tripoles/npn/base height/.initial=.4}
1333 \ctikzset{tripoles/npn/conn height/.initial=0}
1334 \ctikzset{tripoles/npn/height/.initial=1.1}
1335 \ctikzset{tripoles/npn/base width/.initial=.5}
1336 \ctikzset{tripoles/npn/arrow pos/.initial=.5}
1337 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
1338 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
1339 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
1340 \ctikzset{tripoles/npn/curr direction/.initial=1}
1341
1342 \ctikzset{tripoles/pnp/width/.initial=.6}
1343 \ctikzset{tripoles/pnp/base height/.initial=.45}
1344 \ctikzset{tripoles/pnp/base height 2/.initial=.15}
1345 \ctikzset{tripoles/pnp/base height/.initial=.4}
1346 \ctikzset{tripoles/pnp/conn height/.initial=0}
1347 \ctikzset{tripoles/pnp/height/.initial=1.1}
1348 \ctikzset{tripoles/pnp/base width/.initial=.5}
1349 \ctikzset{tripoles/pnp/arrow pos/.initial=.5}
1350 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
1351 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
1352 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
1353 \ctikzset{tripoles/pnp/curr direction/.initial=-1}
1354
1355 \ctikzset{tripoles/pigbt/width/.initial=.6}
1356 \ctikzset{tripoles/pigbt/gate height/.initial=.45}
1357 \ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
1358 \ctikzset{tripoles/pigbt/base height/.initial=.4}
1359 \ctikzset{tripoles/pigbt/conn height/.initial=0}
1360 \ctikzset{tripoles/pigbt/height/.initial=1.1}
1361 \ctikzset{tripoles/pigbt/gate width/.initial=.62}
1362 \ctikzset{tripoles/pigbt/base width/.initial=.5}
1363 \ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
1364 \ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
1365 \ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
1366 \ctikzset{tripoles/pigbt/curr direction/.initial=-1}
1367
1368 \ctikzset{tripoles/nigbt/width/.initial=.6}
1369 \ctikzset{tripoles/nigbt/gate height/.initial=.45}
1370 \ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
1371 \ctikzset{tripoles/nigbt/base height/.initial=.4}
1372 \ctikzset{tripoles/nigbt/conn height/.initial=0}
1373 \ctikzset{tripoles/nigbt/height/.initial=1.1}
1374 \ctikzset{tripoles/nigbt/gate width/.initial=.62}
1375 \ctikzset{tripoles/nigbt/base width/.initial=.5}
1376 \ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
1377 \ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
1378 \ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
1379 \ctikzset{tripoles/nigbt/curr direction/.initial=1}
1380
1381 \ctikzset{tripoles/Lpigbt/width/.initial=.6}
1382 \ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
1383 \ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
1384 \ctikzset{tripoles/Lpigbt/base height/.initial=.4}
1385 \ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
1386 \ctikzset{tripoles/Lpigbt/height/.initial=1.1}
1387 \ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
1388 \ctikzset{tripoles/Lpigbt/base width/.initial=.5}
1389 \ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
1390 \ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
1391 \ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
1392 \ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
1393
1394 \ctikzset{tripoles/Lnigbt/width/.initial=.6}
1395 \ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
1396 \ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
1397 \ctikzset{tripoles/Lnigbt/base height/.initial=.4}
1398 \ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
1399 \ctikzset{tripoles/Lnigbt/height/.initial=1.1}
1400 \ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
1401 \ctikzset{tripoles/Lnigbt/base width/.initial=.5}
1402 \ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
1403 \ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
1404 \ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
1405 \ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
1406
1407 \ctikzset{tripoles/njfet/width/.initial=.7}
1408 \ctikzset{tripoles/njfet/gate height/.initial=.5}
1409 \ctikzset{tripoles/njfet/gate height 2/.initial=.35}
1410 \ctikzset{tripoles/njfet/gate width/.initial=.5}
1411 \ctikzset{tripoles/njfet/conn height/.initial=.35}
1412 \ctikzset{tripoles/njfet/height/.initial=1.1}
1413 \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
1414 \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
1415 \ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
1416 \ctikzset{tripoles/njfet/curr direction/.initial=1}
1417
1418 \ctikzset{tripoles/pjfet/width/.initial=.7}
1419 \ctikzset{tripoles/pjfet/gate height/.initial=.5}
1420 \ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
1421 \ctikzset{tripoles/pjfet/gate width/.initial=.5}
1422 \ctikzset{tripoles/pjfet/conn height/.initial=.35}
1423 \ctikzset{tripoles/pjfet/height/.initial=1.1}
1424 \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
1425 \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
1426 \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
1427 \ctikzset{tripoles/pjfet/curr direction/.initial=-1}
1428
1429 \ctikzset{tripoles/isfet/width/.initial=1}
1430 \ctikzset{tripoles/isfet/gate height/.initial=.35}
1431 \ctikzset{tripoles/isfet/base height/.initial=.5}
1432 \ctikzset{tripoles/isfet/height/.initial=1.1}
1433 \ctikzset{tripoles/isfet/base width/.initial=.3}
1434 \ctikzset{tripoles/isfet/gate width/.initial=.5}
1435 \ctikzset{tripoles/isfet/conn height/.initial=0}
1436 \ctikzset{tripoles/isfet/wave width/.initial=.16}
1437 \ctikzset{tripoles/isfet/wave amp/.initial=.06}
1438 \ctikzset{tripoles/isfet/waves y sep/.initial=.22}
1439 \ctikzset{tripoles/isfet/waves x sep/.initial=.8}
1440 \ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
1441 \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
1442 \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
1443 \ctikzset{tripoles/isfet/curr direction/.initial=1}
1444 %
1445 % multi-emitter and multi-collector BJTs by Romano Giannetti
1446 %
1447 \ctikzset{tripoles/bjt/emitters/.initial=1}
1448 \ctikzset{tripoles/bjt/collectors/.initial=1}
1449 \pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
1450 \pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
1451 \ctikzset{tripoles/bjt/pins width/.initial=0.3}
1452 \pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
1453 \ctikzset{tripoles/bjt/multi height/.initial=.5}
1454 \pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
1455 %
1456 \ctikzset{tripoles/bjt/width/.initial=.3}
1457 \ctikzset{tripoles/bjt/base height 2/.initial=.4}
1458 \ctikzset{tripoles/bjt/base height/.initial=1.1}
1459 \ctikzset{tripoles/bjt/height/.initial=.4}
1460 \ctikzset{tripoles/bjt/base width/.initial=1}
1461 \ctikzset{tripoles/bjt/arrow pos/.initial=.5}
1462 % do NOT touch these two!
1463 \ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
1464 \ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1}
1465
1466 %% transistors stop here
1467
1468 %% Logic ports
1469
1470 \newif\ifpgf@circuit@europeanlogicport
1471 \ctikzset{logic ports/.is choice}
1472 \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
1473 \tikzset{and port/.style={shape=european and port}}%
1474 \tikzset{or port/.style={shape=european or port}}%
1475 \tikzset{xor port/.style={shape=european xor port}}%
1476 \tikzset{buffer port/.style={shape=european buffer port}}%
1477 \tikzset{not port/.style={shape=european not port}}%
1478 \tikzset{nand port/.style={shape=european nand port}}%
1479 \tikzset{nor port/.style={shape=european nor port}}%
1480 \tikzset{xnor port/.style={shape=european xnor port}}%
1481 }}
1482 \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
1483 \tikzset{and port/.style={shape=american and port}}%
1484 \tikzset{or port/.style={shape=american or port}}%
1485 \tikzset{xor port/.style={shape=american xor port}}%
1486 \tikzset{buffer port/.style={shape=american buffer port}}%
1487 \tikzset{not port/.style={shape=american not port}}%
1488 \tikzset{nand port/.style={shape=american nand port}}%
1489 \tikzset{nor port/.style={shape=american nor port}}%
1490 \tikzset{xnor port/.style={shape=american xnor port}}%
1491 }}
1492
1493 \ctikzset{logic ports origin/.is choice}
1494 \ctikzset{logic ports origin/legacy/.code={
1495 \ctikzset{tripoles/american and port/origin/.initial=0.8}%
1496 \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
1497 \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
1498 \ctikzset{tripoles/american or port/origin/.initial=0.8}%
1499 \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
1500 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
1501 \ctikzset{tripoles/european and port/origin/.initial=0.8}%
1502 \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
1503 \ctikzset{tripoles/european or port/origin/.initial=0.8}%
1504 \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
1505 \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
1506 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
1507 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
1508 \ctikzset{tripoles/european not port/origin/.initial=0.8}%
1509 }%
1510 }
1511 \ctikzset{logic ports origin/center/.code={%
1512 \ctikzset{tripoles/american and port/origin/.initial=0}%
1513 \ctikzset{tripoles/american nand port/origin/.initial=0}%
1514 \ctikzset{tripoles/american nor port/origin/.initial=0}%
1515 \ctikzset{tripoles/american or port/origin/.initial=0}%
1516 \ctikzset{tripoles/american xor port/origin/.initial=0}%
1517 \ctikzset{tripoles/american xnor port/origin/.initial=0}%
1518 \ctikzset{tripoles/european and port/origin/.initial=0}%
1519 \ctikzset{tripoles/european nand port/origin/.initial=0}%
1520 \ctikzset{tripoles/european or port/origin/.initial=0}%
1521 \ctikzset{tripoles/european nor port/origin/.initial=0}%
1522 \ctikzset{tripoles/european xor port/origin/.initial=0}%
1523 \ctikzset{tripoles/european xnor port/origin/.initial=0}%
1524 \ctikzset{tripoles/european buffer port/origin/.initial=0}%
1525 \ctikzset{tripoles/european not port/origin/.initial=0}%
1526 }%
1527 }
1528
1529 \newif\ifpgfcirc@roundy@or@shapes\pgfcirc@roundy@or@shapesfalse
1530 \ctikzset{american or shape/.is choice}
1531 \ctikzset{american or shape/roundy/.code={\pgfcirc@roundy@or@shapestrue}}
1532 \ctikzset{american or shape/pointy/.code={\pgfcirc@roundy@or@shapesfalse}}
1533
1534 \newif\ifpgfcirc@draw@leads\pgfcirc@draw@leadstrue
1535 \ctikzset{logic ports draw input leads/.is choice}
1536 \ctikzset{logic ports draw input leads/true/.code={\pgfcirc@draw@leadstrue}}
1537 \ctikzset{logic ports draw input leads/false/.code={\pgfcirc@draw@leadsfalse}}
1538 \tikzset{input leads/.code={\pgfcirc@draw@leadstrue}}
1539 \tikzset{no input leads/.code={\pgfcirc@draw@leadsfalse}}
1540
1541 \ctikzset{tripoles/american and port/width/.initial=1.1}
1542 \ctikzset{tripoles/american and port/height/.initial=.8}
1543 \ctikzset{tripoles/american and port/port width/.initial=.7}
1544 \ctikzset{tripoles/american and port/input height/.initial=.5}
1545 \ctikzset{tripoles/american nand port/width/.initial=1.1}
1546 \ctikzset{tripoles/american nand port/height/.initial=.8}
1547 \ctikzset{tripoles/american nand port/port width/.initial=.7}
1548 \ctikzset{tripoles/american nand port/circle width/.initial=.15}
1549 \ctikzset{tripoles/american nand port/input height/.initial=.5}
1550 \ctikzset{tripoles/american or port/width/.initial=1.1}
1551 \ctikzset{tripoles/american or port/height/.initial=.8}
1552 \ctikzset{tripoles/american or port/port width/.initial=.7}
1553 \ctikzset{tripoles/american or port/input height/.initial=.5}
1554 \ctikzset{tripoles/american or port/input skip/.initial=.25}
1555 \ctikzset{tripoles/american or port/aaa/.initial=.6}
1556 \ctikzset{tripoles/american or port/bbb/.initial=.4}
1557 \ctikzset{tripoles/american or port/ccc/.initial=.5}
1558 \ctikzset{tripoles/american or port/ddd/.initial=.0}
1559 \ctikzset{tripoles/american nor port/width/.initial=1.1}
1560 \ctikzset{tripoles/american nor port/height/.initial=.8}
1561 \ctikzset{tripoles/american nor port/port width/.initial=.7}
1562 \ctikzset{tripoles/american nor port/input height/.initial=.5}
1563 \ctikzset{tripoles/american nor port/input skip/.initial=.25}
1564 \ctikzset{tripoles/american nor port/circle width/.initial=.15}
1565 \ctikzset{tripoles/american nor port/aaa/.initial=.6}
1566 \ctikzset{tripoles/american nor port/bbb/.initial=.4}
1567 \ctikzset{tripoles/american nor port/ccc/.initial=.5}
1568 \ctikzset{tripoles/american nor port/ddd/.initial=.0}
1569 \ctikzset{tripoles/american xor port/width/.initial=1.1}
1570 \ctikzset{tripoles/american xor port/height/.initial=.8}
1571 \ctikzset{tripoles/american xor port/port width/.initial=.7}
1572 \ctikzset{tripoles/american xor port/input height/.initial=.5}
1573 \ctikzset{tripoles/american xor port/input skip/.initial=.15}
1574 \ctikzset{tripoles/american xor port/distance/.initial=.1}
1575 \ctikzset{tripoles/american xnor port/width/.initial=1.1}
1576 \ctikzset{tripoles/american xnor port/height/.initial=.8}
1577 \ctikzset{tripoles/american xnor port/port width/.initial=.7}
1578 \ctikzset{tripoles/american xnor port/input height/.initial=.5}
1579 \ctikzset{tripoles/american xnor port/input skip/.initial=.15}
1580 \ctikzset{tripoles/american xnor port/distance/.initial=.1}
1581 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
1582 \ctikzset{tripoles/american and port/origin/.initial=0.8}
1583 \ctikzset{tripoles/american and port/inputs/.initial=2}
1584 % variable number of inputs
1585 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
1586 \ctikzset{tripoles/american nand port/inputs/.initial=2}
1587 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
1588 \ctikzset{tripoles/american nor port/inputs/.initial=2}
1589 \ctikzset{tripoles/american nor port/angle/.initial=70}
1590 \ctikzset{tripoles/american nor port/inner/.initial=0.3}
1591 \ctikzset{tripoles/american or port/origin/.initial=0.8}
1592 \ctikzset{tripoles/american or port/inputs/.initial=2}
1593 \ctikzset{tripoles/american or port/angle/.initial=70}
1594 \ctikzset{tripoles/american or port/inner/.initial=0.3}
1595 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
1596 \ctikzset{tripoles/american xor port/inputs/.initial=2}
1597 \ctikzset{tripoles/american xor port/angle/.initial=70}
1598 \ctikzset{tripoles/american xor port/inner/.initial=0.3}
1599 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
1600 \ctikzset{tripoles/american xnor port/inputs/.initial=2}
1601 \ctikzset{tripoles/american xnor port/angle/.initial=70}
1602 \ctikzset{tripoles/american xnor port/inner/.initial=0.3}
1603
1604 \ctikzset{tripoles/european and port/width/.initial=1.4}
1605 \ctikzset{tripoles/european and port/height/.initial=.65}
1606 \ctikzset{tripoles/european and port/reserved/.initial=.6}
1607 \ctikzset{tripoles/european and port/input height/.initial=.6}
1608 \ctikzset{tripoles/european or port/width/.initial=1.4}
1609 \ctikzset{tripoles/european or port/height/.initial=.65}
1610 \ctikzset{tripoles/european or port/reserved/.initial=.6}
1611 \ctikzset{tripoles/european or port/input height/.initial=.6}
1612 \ctikzset{tripoles/european xor port/width/.initial=1.4}
1613 \ctikzset{tripoles/european xor port/height/.initial=.65}
1614 \ctikzset{tripoles/european xor port/reserved/.initial=.6}
1615 \ctikzset{tripoles/european xor port/input height/.initial=.6}
1616 \ctikzset{tripoles/european nand port/width/.initial=1.4}
1617 \ctikzset{tripoles/european nand port/not height/.initial=.3}
1618 \ctikzset{tripoles/european nand port/not width/.initial=.8}
1619 \ctikzset{tripoles/european nand port/height/.initial=.65}
1620 \ctikzset{tripoles/european nand port/reserved/.initial=.6}
1621 \ctikzset{tripoles/european nand port/input height/.initial=.6}
1622 \ctikzset{tripoles/european buffer port/width/.initial=1.4}
1623 \ctikzset{tripoles/european buffer port/not height/.initial=.3}
1624 \ctikzset{tripoles/european buffer port/not width/.initial=.8}
1625 \ctikzset{tripoles/european buffer port/height/.initial=.65}
1626 \ctikzset{tripoles/european buffer port/reserved/.initial=.6}
1627 \ctikzset{tripoles/european buffer port/input height/.initial=0}
1628 \ctikzset{tripoles/european not port/width/.initial=1.4}
1629 \ctikzset{tripoles/european not port/not height/.initial=.3}
1630 \ctikzset{tripoles/european not port/not width/.initial=.8}
1631 \ctikzset{tripoles/european not port/height/.initial=.65}
1632 \ctikzset{tripoles/european not port/reserved/.initial=.6}
1633 \ctikzset{tripoles/european not port/input height/.initial=0}
1634 \ctikzset{tripoles/european xnor port/width/.initial=1.4}
1635 \ctikzset{tripoles/european xnor port/not height/.initial=.3}
1636 \ctikzset{tripoles/european xnor port/not width/.initial=.8}
1637 \ctikzset{tripoles/european xnor port/height/.initial=.65}
1638 \ctikzset{tripoles/european xnor port/reserved/.initial=.6}
1639 \ctikzset{tripoles/european xnor port/input height/.initial=.6}
1640 \ctikzset{tripoles/european nor port/width/.initial=1.4}
1641 \ctikzset{tripoles/european nor port/not height/.initial=.3}
1642 \ctikzset{tripoles/european nor port/not width/.initial=.8}
1643 \ctikzset{tripoles/european nor port/height/.initial=.65}
1644 \ctikzset{tripoles/european nor port/reserved/.initial=.6}
1645 \ctikzset{tripoles/european nor port/input height/.initial=.6}
1646 % variable number of inputs
1647 \ctikzset{tripoles/european and port/origin/.initial=0.8}
1648 \ctikzset{tripoles/european and port/inputs/.initial=2}
1649 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
1650 \ctikzset{tripoles/european nand port/inputs/.initial=2}
1651 \ctikzset{tripoles/european or port/origin/.initial=0.8}
1652 \ctikzset{tripoles/european or port/inputs/.initial=2}
1653 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
1654 \ctikzset{tripoles/european nor port/inputs/.initial=2}
1655 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
1656 \ctikzset{tripoles/european xor port/inputs/.initial=2}
1657 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
1658 \ctikzset{tripoles/european xnor port/inputs/.initial=2}
1659 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}
1660 \ctikzset{tripoles/european buffer port/inputs/.initial=1}%
1661 \ctikzset{tripoles/european not port/origin/.initial=0.8}
1662 \ctikzset{tripoles/european not port/inputs/.initial=1}%
1663 %%% parameters that are not used anymore after multi-input
1664 %%% gates --- left for compatibility of source code.
1665 \ctikzset{tripoles/american xor port/aaa/.initial=.6}
1666 \ctikzset{tripoles/american xor port/bbb/.initial=.4}
1667 \ctikzset{tripoles/american xor port/ccc/.initial=.5}
1668 \ctikzset{tripoles/american xor port/ddd/.initial=.0}
1669 \ctikzset{tripoles/american xnor port/aaa/.initial=.6}
1670 \ctikzset{tripoles/american xnor port/bbb/.initial=.4}
1671 \ctikzset{tripoles/american xnor port/ccc/.initial=.5}
1672 \ctikzset{tripoles/american xnor port/ddd/.initial=.0}
1673 % switches for logic gates
1674 %
1675 \pgfkeys{/tikz/number inputs/.initial=0}
1676 \pgfkeys{/tikz/number inputs/.default=0}
1677
1678 %% flip-flop specific keys (most others are the same as chips)
1679
1680 \ctikzset{multipoles/flipflop/font/.initial=\pgf@circ@font@small}
1681 \ctikzset{multipoles/flipflop/fontud/.initial=\pgf@circ@font@tiny}
1682 \ctikzset{multipoles/flipflop/width/.initial=1.2}
1683 \ctikzset{multipoles/flipflop/pin spacing/.initial=0.6}
1684 \ctikzset{multipoles/flipflop/clock wedge size/.initial=0.2}
1685
1686 %% muxdemuxes keys
1687
1688 \ctikzset{multipoles/muxdemux/base len/.initial=0.4}
1689 \ctikzset{multipoles/muxdemux/Lh/.initial=8.0}
1690 \ctikzset{multipoles/muxdemux/Rh/.initial=6.0}
1691 \ctikzset{multipoles/muxdemux/w/.initial=3.0}
1692 \ctikzset{multipoles/muxdemux/inset w/.initial=0.0}
1693 \ctikzset{multipoles/muxdemux/inset Lh/.initial=0.0}
1694 \ctikzset{multipoles/muxdemux/inset Rh/.initial=0.0}
1695 \ctikzset{multipoles/muxdemux/NL/.initial=8}
1696 \ctikzset{multipoles/muxdemux/NR/.initial=1}
1697 \ctikzset{multipoles/muxdemux/NB/.initial=3}
1698 \ctikzset{multipoles/muxdemux/NT/.initial=0}
1699 \ctikzset{multipoles/muxdemux/square pins/.initial=0}
1700 %
1701 % switches for op amps
1702 % changing input polarity
1703 %
1704 \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
1705 \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1706 \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1707 \pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1708 \ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1709 %
1710 % changing output polarity (for fully diff objects)
1711 %
1712 \newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
1713 \pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1714 \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1715 \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1716 \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1717
1718 % Operational amplifier
1719 \ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
1720 \ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
1721 \ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
1722 \ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
1723 \ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
1724 \ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1725
1726 % Fully differential operational amplifier
1727 \ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
1728 \ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
1729 \ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
1730 \ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
1731 \ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
1732 \ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
1733 \ctikzset{tripoles/fd op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1734
1735 \ctikzset{tripoles/en amp/width/.initial=1.7}
1736 \ctikzset{tripoles/en amp/port width/.initial=.7}
1737 \ctikzset{tripoles/en amp/height/.initial=1.6}
1738 \ctikzset{tripoles/en amp/input height/.initial=.3}
1739 \ctikzset{tripoles/en amp/up pos/.initial=.45}
1740 \ctikzset{tripoles/en amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1741 \ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed!
1742 \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
1743 \tikzset{
1744 en amp text/.code = {%
1745 \ctikzsetvalof{tripoles/en amp/text}{#1}%
1746 },
1747 en amp text A/.code = {%
1748 \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
1749 },
1750 }
1751
1752 % Transconductance amplifier
1753 \ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
1754 \ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
1755 \ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
1756 \ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
1757 \ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
1758 \ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
1759 \ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1760
1761 % Instrumentation amplifier
1762 \ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
1763 \ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
1764 \ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
1765 \ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1766 \ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
1767 \ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
1768 \ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1769 \ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1770
1771 % Instrumentation amplifier with differential output
1772 \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
1773 \ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
1774 \ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
1775 \ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1776 \ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
1777 \ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
1778 \ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
1779 \ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1780 \ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1781
1782 % Instrumentation amplifier with gain resistor terminals
1783 \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
1784 \ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
1785 \ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
1786 \ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
1787 \ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
1788 \ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
1789 \ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
1790 \ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
1791 \ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1792
1793 % Plain amplifier
1794 \ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
1795 \ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
1796 \ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
1797 \ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
1798 \ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
1799
1800 % changing fonts and symbols of amplifiers
1801 \ctikzset{amplifiers/symbol font/.code={%
1802 \ctikzset{tripoles/inst amp ra/font=#1}%
1803 \ctikzset{tripoles/fd inst amp/font=#1}%
1804 \ctikzset{tripoles/inst amp/font=#1}%
1805 \ctikzset{tripoles/gm amp/font=#1}%
1806 \ctikzset{tripoles/en amp/font=#1}%
1807 \ctikzset{tripoles/fd op amp/font=#1}%
1808 \ctikzset{tripoles/op amp/font=#1}%
1809 }}
1810 \ctikzset{amplifiers/plus/.initial={$+$}}
1811 \ctikzset{amplifiers/minus/.initial={$-$}}
1812 \tikzset{amp symbol font/.code={%
1813 \ctikzset{amplifiers/symbol font={#1}}%
1814 }
1815 }
1816 \tikzset{amp plus/.code={\ctikzsetvalof{amplifiers/plus}{#1}}}
1817 \tikzset{amp minus/.code={\ctikzsetvalof{amplifiers/minus}{#1}}}
1818 \def\pgf@circ@ampli@plus{\ctikzvalof{amplifiers/plus}}
1819 \def\pgf@circ@ampli@minus{\ctikzvalof{amplifiers/minus}}
1820
1821 \ctikzset{tripoles/thyristor/height/.initial=1.10}
1822 \ctikzset{tripoles/thyristor/height 2/.initial=.5}
1823 \ctikzset{tripoles/thyristor/width/.initial=1.0}
1824 \ctikzset{tripoles/thyristor/diode height/.initial=.5}
1825 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
1826 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
1827
1828 \ctikzset{tripoles/triac/height/.initial=1.1}
1829 \ctikzset{tripoles/triac/width/.initial=1}
1830 \ctikzset{tripoles/triac/diode width left/.initial=.3}
1831 \ctikzset{tripoles/triac/diode width right/.initial=.3}
1832
1833 %% Cute switches
1834 \ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
1835 \ctikzset{bipoles/cuteswitch/height/.initial=.6}
1836 \ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
1837 \ctikzset{bipoles/cuteswitch/width/.initial=.50}
1838 \ctikzset{bipoles/cuteswitch/thickness/.initial=1}
1839
1840 \ctikzset{tripoles/spdt/width/.initial=.85}
1841 \ctikzset{tripoles/spdt/height/.initial=.45}
1842 \ctikzset{tripoles/spdt/margin/.initial=.45}
1843
1844 \ctikzset{tripoles/toggleswitch/height/.initial=.8}
1845 \ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
1846 \ctikzset{tripoles/toggleswitch/width/.initial=.80}
1847
1848 \ctikzset{tripoles/mixer/width/.initial=0.7}
1849 \ctikzset{tripoles/adder/width/.initial=0.7}
1850 \ctikzset{tripoles/circulator/width/.initial=.7}
1851 \ctikzset{tripoles/oscillator/width/.initial=.7}
1852
1853
1854 \ctikzset{tripoles/wilkinson/height/.initial=1.3}
1855 \ctikzset{tripoles/wilkinson/width/.initial=1.3}
1856
1857 \ctikzset{quadpoles/transformer/inner/.initial=0.4}
1858 \ctikzset{quadpoles/transformer/width/.initial=1.5}
1859 \ctikzset{quadpoles/transformer/width1/.initial=.4}
1860 \ctikzset{quadpoles/transformer/height/.initial=1.5}
1861 \ctikzset{quadpoles/transformer/height1/.initial=.8}
1862 \ctikzset{quadpoles/transformer core/inner/.initial=0.4}
1863 \ctikzset{quadpoles/transformer core/width/.initial=1.5}
1864 \ctikzset{quadpoles/transformer core/height/.initial=1.5}
1865 \ctikzset{quadpoles/transformer core/core height/.initial=.5}
1866 \ctikzset{quadpoles/transformer core/core width/.initial=.05}
1867 \ctikzset{quadpoles/gyrator/inner/.initial=0.4}
1868 \ctikzset{quadpoles/gyrator/width/.initial=1.5}
1869 \ctikzset{quadpoles/gyrator/height/.initial=1.5}
1870 \ctikzset{quadpoles/fourport/width/.initial=1.3}
1871 \ctikzset{quadpoles/fourport/height/.initial=1.3}
1872 \ctikzset{quadpoles/coupler/width/.initial=1.3}
1873 \ctikzset{quadpoles/coupler/height/.initial=1.3}
1874 \ctikzset{quadpoles/coupler2/width/.initial=1.3}
1875 \ctikzset{quadpoles/coupler2/height/.initial=1.3}
1876
1877 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
1878
1879 \ctikzset{quadpoles style/.is choice}
1880 \ctikzset{quadpoles style/inward/.code={% default value
1881 \ctikzset{quadpoles/transformer/inner=0.4}%
1882 \ctikzset{quadpoles/transformer/width=1.5}%
1883 \ctikzset{quadpoles/transformer core/inner=0.4}%
1884 \ctikzset{quadpoles/transformer core/width=1.5}%
1885 \ctikzset{quadpoles/gyrator/inner=0.4}%
1886 \ctikzset{quadpoles/gyrator/width=1.5}%
1887 }%
1888 }
1889 \ctikzset{quadpoles style/inline/.code={% now horizontal baffle
1890 \ctikzset{quadpoles/transformer/inner=1}%
1891 \ctikzset{quadpoles/transformer/width=0.6}%
1892 \ctikzset{quadpoles/transformer core/inner=1}%
1893 \ctikzset{quadpoles/transformer core/width=0.6}%
1894 \ctikzset{quadpoles/gyrator/inner=1} % FIXME
1895 \ctikzset{quadpoles/gyrator/width=0.6}%
1896 }%
1897 }
1898
1899 %
1900 % multipoles
1901 %
1902 \ctikzset{multipoles/thickness/.initial=2}
1903 \ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny}
1904 % DIP (dual in line package) chips
1905 \ctikzset{multipoles/dipchip/width/.initial=1.2}
1906 \ctikzset{multipoles/dipchip/num pins/.initial=8}
1907 \ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
1908 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
1909 % QFP (quad flat package) chips
1910 \ctikzset{multipoles/qfpchip/num pins/.initial=8}
1911 \ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
1912 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
1913 % chip numbers
1914 \newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
1915 \pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1916 \ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1917 \pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1918 \ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1919 \newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
1920 \pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1921 \ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1922 \pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1923 \ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1924 % external chip pins
1925 \ctikzset{multipoles/external pins thickness/.initial=1}
1926 \ctikzset{multipoles/external pins width/.initial=0.2}
1927 \ctikzset{multipoles/external pad fraction/.initial=0}
1928 \pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
1929 \pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
1930 % topmarks
1931 \newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
1932 \pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1933 \ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1934 \pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1935 \ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1936
1937 % rotary switch by Romano
1938 \ctikzset{multipoles/rotary/thickness/.initial=1}
1939 \ctikzset{multipoles/rotary/shape/.initial=ocirc}
1940 \ctikzset{multipoles/rotary/channels/.initial=5}
1941 \ctikzset{multipoles/rotary/angle/.initial=60}
1942 \ctikzset{multipoles/rotary/wiper/.initial=20}
1943 \ctikzset{multipoles/rotary/arrow/.is choice}
1944 \newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
1945 \newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
1946 \newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
1947 \ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
1948 \ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
1949 \ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
1950 \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
1951
1952 \tikzset{%
1953 rotary switch/.style args={#1in#2wiper#3}{%
1954 shape=rotaryswitch,
1955 /tikz/circuitikz/multipoles/rotary/channels=#1,
1956 /tikz/circuitikz/multipoles/rotary/angle=#2,
1957 /tikz/circuitikz/multipoles/rotary/wiper=#3,
1958 },
1959 rotary switch -/.style args={#1in#2wiper#3}{
1960 rotary switch=#1 in #2 wiper #3,
1961 /tikz/circuitikz/multipoles/rotary/arrow=none,
1962 },
1963 rotary switch <-/.style args={#1in#2wiper#3}{
1964 rotary switch=#1 in #2 wiper #3,
1965 /tikz/circuitikz/multipoles/rotary/arrow=ccw,
1966 },
1967 rotary switch ->/.style args={#1in#2wiper#3}{
1968 rotary switch=#1 in #2 wiper #3,
1969 /tikz/circuitikz/multipoles/rotary/arrow=cw,
1970 },
1971 rotary switch <->/.style args={#1in#2wiper#3}{
1972 rotary switch=#1 in #2 wiper #3,
1973 /tikz/circuitikz/multipoles/rotary/arrow=both,
1974 },
1975 % Notice that these should be the same as the initial values of the keys
1976 rotary switch/.default={5 in 60 wiper 20},
1977 rotary switch -/.default={5 in 60 wiper 20},
1978 rotary switch <-/.default={5 in 60 wiper 20},
1979 rotary switch ->/.default={5 in 60 wiper 20},
1980 rotary switch <->/.default={5 in 60 wiper 20},
1981 }
1982
1983 % %Mechanical section
1984 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
1985 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
1986 \ctikzset{bipoles/spring/height/.initial=.5}
1987 \ctikzset{bipoles/spring/width/.initial=.5}
1988 \ctikzset{bipoles/mass/height/.initial=.55}
1989 \ctikzset{bipoles/mass/box height/.initial=.4}
1990 \ctikzset{bipoles/mass/width/.initial=.5}
1991
1992 \ctikzset{bipoles/damper/height/.initial=.35}
1993 \ctikzset{bipoles/damper/length/.initial=.3}
1994 \ctikzset{bipoles/damper/width/.initial=.4}
1995
1996
1997 \ctikzset{bipole/.is family}
1998 \ctikzset{bipole/kind/.initial=}
1999 \ctikzset{bipole/name/.initial=}
2000 \newif\ifpgf@circuit@bipole@isvoltage
2001 \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
2002 \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
2003 \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
2004 \newif\ifpgf@circuit@bipole@strokedsymbol
2005 \ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
2006 \newif\ifpgf@circuit@bipole@iscurrent
2007 \ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
2008
2009 \ctikzset{bipole/voltage/.is family}
2010 \newif\ifpgf@circuit@bipole@voltage@backward
2011 \ctikzset{bipole/voltage/direction/.is choice}
2012 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
2013 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
2014 \newif\ifpgf@circuit@bipole@voltage@below
2015 \ctikzset{bipole/voltage/position/.is choice}
2016 \ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
2017 \ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
2018
2019 \ctikzset{bipole/voltage/label/unit/.initial=}
2020 \ctikzset{bipole/voltage/label/name/.initial=}
2021
2022 \ctikzset{bipole/current/.is family}
2023 \newif\ifpgf@circuit@bipole@current@backward
2024 \ctikzset{bipole/current/direction/.is choice}
2025 \ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
2026 \ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
2027 \newif\ifpgf@circuit@bipole@current@before
2028 \ctikzset{bipole/current/x position/.is choice}
2029 \ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
2030 \ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
2031 \newif\ifpgf@circuit@bipole@current@below
2032 \ctikzset{bipole/current/y position/.is choice}
2033 \ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
2034 \ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
2035 \ctikzset{bipole/current/label/unit/.initial=}
2036 \ctikzset{bipole/current/label/name/.initial=}
2037
2038 \ctikzset{bipole/flow/.is family}
2039 \newif\ifpgf@circuit@bipole@flow@backward
2040 \ctikzset{bipole/flow/direction/.is choice}
2041 \ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
2042 \ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
2043 \newif\ifpgf@circuit@bipole@flow@before
2044 \ctikzset{bipole/flow/x position/.is choice}
2045 \ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
2046 \ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
2047 \newif\ifpgf@circuit@bipole@flow@below
2048 \ctikzset{bipole/flow/y position/.is choice}
2049 \ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
2050 \ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
2051 \ctikzset{bipole/flow/label/unit/.initial=}
2052 \ctikzset{bipole/flow/label/name/.initial=}
2053 \ctikzset{flow/distance/.initial = .5}
2054 \ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
2055
2056 \ctikzset{bipole/label/.is family}
2057 \ctikzset{bipole/label/position/.initial=90}
2058 \ctikzset{bipole/label/unit/.initial=}
2059 \ctikzset{bipole/label/name/.initial=}
2060 \ctikzset{bipole/annotation/.is family}
2061 \ctikzset{bipole/annotation/position/.initial=-90}
2062 \ctikzset{bipole/annotation/unit/.initial=}
2063 \ctikzset{bipole/annotation/name/.initial=}
2064
2065 \newif\ifpgf@circuit@europeanresistor
2066 \ctikzset{resistor/.is choice}
2067 \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
2068 \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
2069
2070 \ctikzset{inductor/.is choice}
2071 \ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
2072 \ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
2073 \ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
2074
2075 \newif\ifpgf@circuit@strokediode
2076 \newif\ifpgf@circuit@fulldiode
2077 \pgf@circuit@strokediodefalse
2078 \pgf@circuit@fulldiodefalse
2079
2080 \ctikzset{diode/.is choice}
2081 \ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
2082 \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
2083 \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
2084
2085 \tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
2086 \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
2087 \tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
2088
2089 \ctikzset{thickness/.initial=2}
2090 \ctikzset{color/.initial=black}
2091 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
2092
2093 \newif\ifpgf@circ@siunitx
2094 \newif\ifpgf@circ@siunitx@res
2095
2096 \ctikzset{straight/.is choice}
2097 \ctikzset{straightvoltage value/.initial=true}
2098 \ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
2099 \ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
2100 \ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
2101 \newif\ifpgf@circuit@bipole@voltage@straight
2102 \ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
2103
2104
2105 \ctikzset{voltage/.is family}
2106 \ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
2107 \ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
2108 \ctikzset{voltage/bump a/.initial=1.2}
2109 \ctikzset{voltage/bump b/.initial=1.5}
2110 \ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
2111 \ctikzset{voltage shift/.style={voltage/shift=#1}}
2112 \tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
2113 \ctikzset{voltage/european label distance/.initial=1.4}
2114 \ctikzset{voltage/american label distance/.initial=1.1}
2115 % shaping the +/- sign, see pgfcircvoltage.tex
2116 \ctikzset{voltage/american font/.initial={}}
2117 \ctikzset{voltage/american plus/.initial={$+$}}
2118 \ctikzset{voltage/american minus/.initial={$-$}}
2119
2120 % special cases
2121 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
2122 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
2123 \ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
2124 %\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
2125 \ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
2126 \ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
2127 \ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
2128 \ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
2129 \ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
2130 \ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
2131 \ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
2132 \ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
2133 \ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
2134 \ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
2135 \ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
2136 %\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
2137 \ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
2138 \ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
2139 %\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
2140 \ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
2141 \ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
2142 %\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
2143 \ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
2144 \ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
2145 %\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
2146 \ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
2147 \ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
2148 %\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
2149 \ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
2150 %\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
2151 \ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
2152
2153 \ctikzset{current/.is family}
2154 \ctikzset{current/distance/.initial = .5}
2155
2156
2157 \tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
2158 \tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
2159 \tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
2160 \tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
2161 \tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
2162 \tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
2163
2164 \newif\ifpgf@circuit@europeangfsurgearrester
2165 \ctikzset{gas filled surge arrester choice/.is choice}
2166 \ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}}
2167 \ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}}
2168
2169 \tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
2170 \tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
2171 \tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
2172 \tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
2173 \tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
2174 \tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
2175 \tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
2176 \tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
2177 \tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
2178 \tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
2179
2180 % I should try to make the tree clearer (this voltage conflicts with the options above)
2181
2182 \newif\ifpgf@circuit@europeanvoltage
2183 \ctikzset{voltage/.is choice}
2184 \ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}}
2185 \ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}}
2186
2187 \newif\ifpgf@circuit@europeancurrent
2188 \ctikzset{current/.is choice}
2189 \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse}
2190 \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue}
2191
2192 % noise sources
2193 \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
2194
2195 \ctikzset{label/align/.is choice}
2196 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
2197 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
2198 \ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
2199
2200 % seven segment displays by RGtti
2201
2202 \newif\ifpgf@circ@sevenseg@dot
2203 \newif\ifpgf@circ@sevenseg@box
2204 \def\pgf@circ@sevenseg@dotstate{empty}
2205 \ctikzset{seven seg/.is family}
2206 \ctikzset{seven seg/dot/.is choice}
2207 % none means no dot, not space for it. Empty means no dot, but space
2208 \ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
2209 \ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
2210 \ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
2211 \ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
2212 %
2213 \ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
2214 \ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
2215 \ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
2216 \ctikzset{seven seg/box sep/.initial=1pt}% external box gap
2217 \ctikzset{seven seg/color on/.initial=red}% color for segment "on"
2218 \ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
2219 \ctikzset{seven seg/box/.is choice}
2220 \ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
2221 \ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
2222
2223 \ctikzset{seven seg/bits/.initial=0000000}
2224
2225 \ctikzset{seven seg/value/.code={%
2226 \edef\@@tmp{#1}%
2227 \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
2228 \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
2229 \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
2230 \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
2231 \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
2232 \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
2233 \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
2234 \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
2235 \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
2236 \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
2237 \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2238 \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2239 \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2240 \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2241 \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2242 \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2243 \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2244 \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2245 \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2246 \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2247 \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2248 \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2249 \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2250 \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2251 \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2252 \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2253 \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2254 \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2255 \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
2256 }}
2257
2258 \tikzset{%
2259 seven segment val/.style args={#1dot#2box#3}{%
2260 shape=bare7seg,
2261 /tikz/circuitikz/seven seg/value=#1,
2262 /tikz/circuitikz/seven seg/dot=#2,
2263 /tikz/circuitikz/seven seg/box=#3,
2264 },
2265 seven segment bits/.style args={#1dot#2box#3}{%
2266 shape=bare7seg,
2267 /tikz/circuitikz/seven seg/bits=#1,
2268 /tikz/circuitikz/seven seg/dot=#2,
2269 /tikz/circuitikz/seven seg/box=#3,
2270 },
2271 }
2272
2273
2274 %%%%%%%%%% new
2275 \pgfkeys{\circuitikzbasekey/.search also={/tikz}}
2276
2277 % Electronic tubes: diodetube, triode, tetrode and pentode
2278 \ctikzset{tubes/width/.initial=1} % relative width
2279 \ctikzset{tubes/height/.initial=1.4} % relative height
2280 \ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
2281 \ctikzset{tubes/anode distance/.initial=0.40} % distance from center
2282 \ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
2283 \ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
2284 \ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
2285 \ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
2286 \ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
2287 \ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
2288 \ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
2289 \ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
2290 \ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
2291 \ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
2292 \ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
2293
2294 \newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
2295 \pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
2296 \ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
2297 \newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
2298 \pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
2299 \ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
2300 \newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
2301 \pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
2302 \ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
2303
2304 %%%---------- close: tex/pgfcirc.defines
2305 %%%%%%%%%%% Springe nach tex/pgfcircutils
2306 %%%---------- open: tex/pgfcircutils.tex
2307 % Copyright 2018-2026 by Romano Giannetti
2308 % Copyright 2015-2026 by Stefan Lindner
2309 % Copyright 2013-2026 by Stefan Erhardt
2310 % Copyright 2007-2026 by Massimo Redaelli
2311 %
2312 % This file may be distributed and/or modified
2313 %
2314 % 1. under the LaTeX Project Public License and/or
2315 % 2. under the GNU Public License.
2316 %
2317 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2318
2319 \def\pgf@circ@handleSI#1{
2320 \noexpandarg
2321 \def\pgf@temp{}
2322 \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
2323 \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
2324
2325 \ifnum\pgf@circ@handleSI@unit@len=0
2326 \pgf@circ@siunitx@resfalse
2327 \else
2328 \IfEndWith{#1}{>}{
2329 \pgf@circ@siunitx@restrue
2330 \noexpandarg
2331 \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
2332 %\typeout{si |#1|}
2333 }{
2334 \pgf@circ@siunitx@resfalse
2335 %\typeout{no si |#1|}
2336 }
2337 \fi
2338 }
2339
2340 \def\pgf@circ@ifkeyempty#1{
2341 \pgfextra{
2342 \ctikzset{#1/.get=\pgf@circ@temp}
2343 \edef\pgf@temp{}
2344 }
2345 \ifx\pgf@circ@temp\pgf@temp
2346 }
2347
2348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2349 %% Math routines
2350
2351 \def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
2352
2353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2354 %% useful commands
2355
2356 \ifpgfutil@format@is@latex
2357 %% flipping text
2358 \def\ctikzflipx#1{\scalebox{-1}[1]{#1}}
2359 \def\ctikzflipy#1{\scalebox{1}[-1]{#1}}
2360 \def\ctikzflipxy#1{\scalebox{-1}[-1]{#1}}
2361 % text mode overbar
2362 % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
2363 \def\ctikztextnot#1{$\overline{\hbox{#1}}\m@th$}
2364 \else\ifpgfutil@format@is@plain
2365 % text mode overbar
2366 % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
2367 \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
2368 \else\ifpgfutil@format@is@context
2369 % text mode overbar
2370 % Thanks to @egreg https://tex.stackexchange.com/a/24133/38080
2371 \def\ctikztextnot#1{$\overline{\hbox{#1}}$}
2372 \fi\fi\fi
2373
2374
2375 %%%---------- close: tex/pgfcircutils
2376
2377 %%%%%%%%%%% Springe nach tex/pgfcircshapes
2378 %%%---------- open: tex/pgfcircshapes.tex
2379 % Copyright 2018-2026 by Romano Giannetti
2380 % Copyright 2015-2026 by Stefan Lindner
2381 % Copyright 2013-2026 by Stefan Erhardt
2382 % Copyright 2007-2026 by Massimo Redaelli
2383 %
2384 % This file may be distributed and/or modified
2385 %
2386 % 1. under the LaTeX Project Public License and/or
2387 % 2. under the GNU Public License.
2388 %
2389 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2390
2391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2392 %% Other shapes
2393
2394 %% Nothing
2395
2396 \pgfdeclareshape{emptyshape}{
2397 \savedanchor{\northeast}{%
2398 \pgf@x=.5\wd\pgfnodeparttextbox%
2399 \pgf@y=.5\ht\pgfnodeparttextbox%
2400 }
2401 \anchor{north}{\northeast\pgf@x=0cm\relax}
2402 \anchor{east}{\northeast\pgf@y=0cm\relax}
2403 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2404 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2405 \anchor{north east}{\northeast}
2406 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2407 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2408 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2409 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
2410 \anchor{center}{
2411 \pgfpointorigin
2412 }
2413 }
2414 %
2415 % Provision for changing opacity. Only expert use, see the manual.
2416 %
2417 \ctikzset{poles/open fill opacity/.initial=1.0}% better not touch it
2418 \tikzset{open poles opacity/.code={%
2419 \ctikzset{poles/open fill opacity=#1}%
2420 }}
2421 \ctikzset{poles/full fill opacity/.initial=1.0}% better not touch it
2422 \tikzset{full poles opacity/.code={%
2423 \ctikzset{poles/full fill opacity=#1}%
2424 }}
2425
2426 %% Full terminal
2427
2428 \pgfdeclareshape{circ}{
2429 \anchor{center}{
2430 \pgfpointorigin
2431 }
2432 \savedanchor\northwest{%
2433 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2434 \pgf@x=-\pgf@y
2435 }
2436 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2437 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2438 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2439 \anchor{west}{ \northwest \pgf@y=0pt }
2440 \anchor{w}{ \northwest \pgf@y=0pt }
2441 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2442 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2443 \anchor{north}{ \northwest \pgf@x=0pt }
2444 \anchor{n}{ \northwest \pgf@x=0pt }
2445 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2446 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2447 \anchor{north west}{ \northwest }
2448 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2449 \anchorborder{
2450 \pgf@circ@res@left=\pgf@x
2451 \pgf@circ@res@up=\pgf@y
2452 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2453 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2454 }
2455 \behindforegroundpath{
2456
2457 \pgfscope
2458 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2459 \pgfsetcolor{\ctikzvalof{color}}
2460 \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
2461 \pgfusepath{draw,fill}
2462 \endpgfscope
2463
2464 }
2465 }
2466
2467 %% Empty round terminal
2468
2469 \pgfdeclareshape{ocirc}{
2470 \anchor{center}{
2471 \pgfpointorigin
2472 }
2473 \savedanchor\northwest{%
2474 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2475 \pgf@x=-\pgf@y
2476 }
2477 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2478 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2479 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2480 \anchor{west}{ \northwest \pgf@y=0pt }
2481 \anchor{w}{ \northwest \pgf@y=0pt }
2482 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2483 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2484 \anchor{north}{ \northwest \pgf@x=0pt }
2485 \anchor{n}{ \northwest \pgf@x=0pt }
2486 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2487 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2488 \anchor{north west}{ \northwest }
2489 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2490 \anchorborder{
2491 \pgf@circ@res@left=\pgf@x
2492 \pgf@circ@res@up=\pgf@y
2493 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2494 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2495 }
2496
2497 \behindforegroundpath{
2498
2499 \pgfscope
2500 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2501 \pgfsetcolor{\ctikzvalof{color}}
2502 \ifx\tikz@fillcolor\pgfutil@empty
2503 % set the default fill color to white
2504 \pgfsetfillcolor{white}
2505 % ...but override it if the class is defined!
2506 % note that this element has no class, but will inherit it when used
2507 % into another component
2508 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2509 \else
2510 \pgfsetfillcolor{\tikz@fillcolor}
2511 \fi
2512 \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
2513 \pgfusepath{draw,fill}
2514 \endpgfscope
2515
2516 }
2517 }
2518
2519 %% Diamond terminal
2520
2521 \pgfdeclareshape{diamondpole}{
2522 \anchor{center}{
2523 \pgfpointorigin
2524 }
2525 \savedanchor\northwest{%
2526 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2527 \pgf@x=-\pgf@y
2528 }
2529 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2530 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2531 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2532 \anchor{west}{ \northwest \pgf@y=0pt }
2533 \anchor{w}{ \northwest \pgf@y=0pt }
2534 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2535 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2536 \anchor{north}{ \northwest \pgf@x=0pt }
2537 \anchor{n}{ \northwest \pgf@x=0pt }
2538 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2539 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2540 \anchor{north west}{ \northwest }
2541 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2542 \anchorborder{
2543 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2544 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2545 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2546 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2547 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2548 \pgfextracty{\pgf@circ@res@up}{\northwest}
2549 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2550 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2551 \pgfpointintersectionoflines
2552 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2553 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2554 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2555 \pgf@x=\@@switchx\pgf@x
2556 \pgf@y=\@@switchy\pgf@y
2557 }
2558 \behindforegroundpath{
2559 \pgfscope
2560 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2561 \pgftransformrotate{45}
2562 \pgfpathrectanglecorners
2563 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2564 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2565 \pgfsetcolor{\ctikzvalof{color}}
2566 \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
2567 \pgfusepath{draw,fill}
2568 \endpgfscope
2569 }
2570 }
2571
2572 %% Diamond terminal, unfilled
2573
2574 \pgfdeclareshape{odiamondpole}{
2575 \anchor{center}{
2576 \pgfpointorigin
2577 }
2578 \savedanchor\northwest{%
2579 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2580 \pgf@x=-\pgf@y
2581 }
2582 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2583 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2584 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2585 \anchor{west}{ \northwest \pgf@y=0pt }
2586 \anchor{w}{ \northwest \pgf@y=0pt }
2587 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2588 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2589 \anchor{north}{ \northwest \pgf@x=0pt }
2590 \anchor{n}{ \northwest \pgf@x=0pt }
2591 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2592 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2593 \anchor{north west}{ \northwest }
2594 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2595 \anchorborder{
2596 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2597 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2598 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2599 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2600 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2601 \pgfextracty{\pgf@circ@res@up}{\northwest}
2602 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2603 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2604 \pgfpointintersectionoflines
2605 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2606 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2607 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2608 \pgf@x=\@@switchx\pgf@x
2609 \pgf@y=\@@switchy\pgf@y
2610 }
2611 \behindforegroundpath{
2612 \pgfscope
2613 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2614 \pgftransformrotate{45}
2615 \pgfpathrectanglecorners
2616 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2617 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2618 \pgfsetcolor{\ctikzvalof{color}}
2619 \ifx\tikz@fillcolor\pgfutil@empty
2620 % set the default fill color to white
2621 \pgfsetfillcolor{white}
2622 % ...but override it if the class is defined!
2623 % note that this element has no class, but will inherit it when used
2624 % into another component
2625 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2626 \else
2627 \pgfsetfillcolor{\tikz@fillcolor}
2628 \fi
2629 \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
2630 \pgfusepath{draw,fill}
2631 \endpgfscope
2632 }
2633 }
2634
2635 %% square terminal, filled
2636
2637 \pgfdeclareshape{squarepole}{
2638 \anchor{center}{
2639 \pgfpointorigin
2640 }
2641 \savedanchor\northwest{%
2642 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2643 \pgf@x=-\pgf@y
2644 }
2645 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2646 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2647 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2648 \anchor{west}{ \northwest \pgf@y=0pt }
2649 \anchor{w}{ \northwest \pgf@y=0pt }
2650 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2651 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2652 \anchor{north}{ \northwest \pgf@x=0pt }
2653 \anchor{n}{ \northwest \pgf@x=0pt }
2654 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2655 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2656 \anchor{north west}{ \northwest }
2657 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2658 \anchorborder{
2659 \pgf@xa=\pgf@x
2660 \pgf@ya=\pgf@y
2661 \pgfextracty{\pgf@circ@res@up}{\northwest}
2662 \pgfpointborderrectangle
2663 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2664 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2665 }
2666 \behindforegroundpath{
2667 \pgfscope
2668 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2669 \pgfpathrectanglecorners
2670 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2671 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2672 \pgfsetcolor{\ctikzvalof{color}}
2673 \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
2674 \pgfusepath{draw,fill}
2675 \endpgfscope
2676 }
2677 }
2678 %% square terminal, unfilled
2679
2680 \pgfdeclareshape{osquarepole}{
2681 \anchor{center}{
2682 \pgfpointorigin
2683 }
2684 \savedanchor\northwest{%
2685 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2686 \pgf@x=-\pgf@y
2687 }
2688 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2689 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2690 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2691 \anchor{west}{ \northwest \pgf@y=0pt }
2692 \anchor{w}{ \northwest \pgf@y=0pt }
2693 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2694 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2695 \anchor{north}{ \northwest \pgf@x=0pt }
2696 \anchor{n}{ \northwest \pgf@x=0pt }
2697 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2698 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2699 \anchor{north west}{ \northwest }
2700 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2701 \anchorborder{
2702 \pgf@xa=\pgf@x
2703 \pgf@ya=\pgf@y
2704 \pgfextracty{\pgf@circ@res@up}{\northwest}
2705 \pgfpointborderrectangle
2706 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2707 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2708 }
2709 \behindforegroundpath{
2710 \pgfscope
2711 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2712 \pgfpathrectanglecorners
2713 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2714 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2715 \pgfsetcolor{\ctikzvalof{color}}
2716 \ifx\tikz@fillcolor\pgfutil@empty
2717 % set the default fill color to white
2718 \pgfsetfillcolor{white}
2719 % ...but override it if the class is defined!
2720 % note that this element has no class, but will inherit it when used
2721 % into another component
2722 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2723 \else
2724 \pgfsetfillcolor{\tikz@fillcolor}
2725 \fi
2726 \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
2727 \pgfusepath{draw,fill}
2728 \endpgfscope
2729 }
2730 }
2731 % BNC connector
2732
2733 \pgfdeclareshape{bnc}{
2734 \anchor{center}{
2735 \pgfpointorigin
2736 }
2737 % BNC size is 2.5 times the size of the internal "ocirc"
2738 \savedanchor\northwest{%
2739 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2740 \pgf@y=2.5\pgf@y
2741 \pgf@x=-\pgf@y
2742 }
2743 % center is on the opening
2744 \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2745 \anchor{zero}{ \pgfpointorigin }
2746 \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2747 \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2748 % geo-anchors
2749 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2750 \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2751 \anchor{west}{ \northwest \pgf@y=0pt }
2752 \anchor{left}{ \northwest \pgf@y=0pt }
2753 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2754 \anchor{north}{ \northwest \pgf@x=0pt }
2755 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2756 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2757 \anchor{north west}{ \northwest }
2758 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2759 % put the node text above and centered
2760 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2761 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2762 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2763 }
2764 }
2765 \anchorborder{
2766 \pgf@circ@res@left=\pgf@x
2767 \pgf@circ@res@up=\pgf@y
2768 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2769 }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2770 }
2771 \behindforegroundpath{
2772 \pgfextracty{\pgf@circ@res@other}{\northwest}
2773 \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
2774 \pgfscope
2775 \pgfstartlinewidth=\pgflinewidth
2776 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
2777 \pgfsetcolor{\ctikzvalof{color}}
2778 % external circle
2779 \pgfscope
2780 % clipping path: first a rectangle bigger then the shape
2781 % to avoid problems with the line thickness
2782 \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
2783 {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
2784 % next the opening to the right
2785 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
2786 {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
2787 % do the difference and clip before drawing
2788 \pgfseteorule
2789 \pgfusepath{clip}
2790 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
2791 \pgfusepath{draw}
2792 \endpgfscope
2793 % internal circle
2794 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
2795 \pgf@circ@draworfill
2796 % and the contact line to the right
2797 \pgfsetlinewidth{\pgfstartlinewidth}
2798 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2799 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
2800 \pgfusepath{draw}
2801 \endpgfscope
2802 }
2803 }
2804
2805 %% Fill for correct rectangular joins
2806
2807 \pgfdeclareshape{rectjoinfill}{
2808 \savedanchor{\northeast}{%
2809 \pgf@x=.5\pgflinewidth%
2810 \pgf@y=.5\pgflinewidth%
2811 }
2812 \anchor{north}{\northeast\pgf@x=0cm\relax}
2813 \anchor{east}{\northeast\pgf@y=0cm\relax}
2814 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2815 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2816 \anchor{north east}{\northeast}
2817 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2818 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2819 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2820 \anchor{center}{
2821 \pgfpointorigin
2822 }
2823 \anchorborder{
2824 \pgf@circ@res@left=\pgf@x
2825 \pgf@circ@res@up=\pgf@y
2826 }
2827 \behindforegroundpath{
2828 \pgfscope
2829 \pgfpathrectanglecorners
2830 {\pgfpoint{0}{.5\pgflinewidth}}
2831 {\pgfpoint{0}{-.5\pgflinewidth}}
2832 \pgfsetcolor{\ctikzvalof{color}}
2833 \pgfusepath{draw,fill}
2834 \endpgfscope
2835 }
2836 }
2837
2838 %% transistor arrow
2839
2840 \def\pgf@circ@find@linescale{
2841 % find the scale inverse of the scale factor: line width do not scale
2842 % with scale=..., transform shape so we have to counteract it.
2843 \iftikz@fullytransformed % this is true if `transform shape` is active
2844 % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
2845 % Note that this trick is not working inside a `spy` environment...
2846 \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
2847 \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}%
2848 \else
2849 \pgfmathsetmacro{\@@factor}{1.0}
2850 \fi
2851 }
2852
2853 \pgfdeclareshape{trarrow}{%
2854 % this arrow is only filled but grows with the linewidth, more or less
2855 % like currarrow do
2856 \savedanchor{\northeast}{%
2857 \pgf@circ@res@step = \pgf@circ@Rlen
2858 \pgf@circ@find@linescale
2859 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2860 \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth}
2861 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2862 }
2863 % The arrow size should be more or less the same of a currarrow, which is
2864 % both filled and stroke, for backward output compatibility (more or less)
2865 %
2866 % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale}
2867 % |-\__ currarrow as the tip at (W,0)
2868 % | | and the upper tail at (-0.7*W, 0.8*W)
2869 % | \__ it then "overshoot" do to the linew width L
2870 % | \__ xangle \alpha
2871 % ---0------->
2872 %
2873 % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
2874 % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
2875 % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
2876 %
2877 \savedanchor{\northwest}{%
2878 \pgf@circ@res@step = \pgf@circ@Rlen
2879 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2880 \pgf@circ@find@linescale
2881 \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth}
2882 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2883 }
2884 \savedanchor{\tip}{%
2885 \pgf@circ@res@step = \pgf@circ@Rlen
2886 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2887 \pgf@circ@find@linescale
2888 \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt}
2889 }
2890 \anchor{north}{\northeast\pgf@x=0cm\relax}
2891 \anchor{east}{\northeast\pgf@y=0cm\relax}
2892 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2893 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2894 \anchor{north east}{\northeast}
2895 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2896 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2897 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2898 \anchor{center}{
2899 \pgfpointorigin
2900 }
2901 \anchor{tip}{
2902 \tip
2903 }
2904 \anchor{btip}{% this anchor is behind the tip of half a linewidth
2905 \tip
2906 \pgf@circ@find@linescale
2907 \pgf@circ@res@temp=\@@factor\pgflinewidth
2908 \advance\pgf@x by -.5\pgf@circ@res@temp
2909 }
2910 \behindforegroundpath{
2911 \pgfscope
2912 \northwest
2913 \pgf@circ@res@up=\pgf@y
2914 \pgf@circ@res@left=\pgf@x
2915 \tip
2916 \pgf@circ@res@step = \pgf@x
2917 %
2918 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2919 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
2920 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2921 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
2922 \pgfpathclose
2923 \pgfsetcolor{\ctikzvalof{color}}
2924 \pgfusepath{fill} % just fill
2925 \endpgfscope
2926 }
2927 }
2928
2929 %% Current arrow
2930
2931 \pgfdeclareshape{currarrow}{
2932 \savedanchor{\northeast}{%
2933 \pgf@circ@res@step = \pgf@circ@Rlen
2934 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2935 \pgf@x=.5\pgf@circ@res@step
2936 \pgf@y=\pgf@x%
2937 }
2938 \anchor{north}{\northeast\pgf@x=0cm\relax}
2939 \anchor{east}{\northeast\pgf@y=0cm\relax}
2940 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2941 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2942 \anchor{north east}{\northeast}
2943 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2944 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2945 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2946 \anchor{center}{
2947 \pgfpointorigin
2948 }
2949 \anchor{tip}{
2950 \pgfpointorigin
2951 \pgf@circ@res@step = \pgf@circ@Rlen
2952 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2953 \pgf@x =\pgf@circ@res@step
2954 }
2955 \behindforegroundpath{
2956 \pgfscope
2957 \pgf@circ@res@step = \pgf@circ@Rlen
2958 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2959
2960 \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2961 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2962 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2963 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2964 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2965 \pgfsetcolor{\ctikzvalof{color}}
2966 \pgfusepath{draw,fill}
2967
2968 \endpgfscope
2969 }
2970 }
2971
2972 %% Flow arrow
2973
2974 \pgfdeclareshape{flowarrow}{
2975 \savedanchor{\northeast}{%
2976 \pgf@circ@res@step = \pgf@circ@Rlen
2977 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2978 \pgf@y=.5\pgf@circ@res@step
2979 \pgf@circ@res@step = \pgf@circ@Rlen
2980 \divide \pgf@circ@res@step by 4
2981 \pgf@x=\pgf@circ@res@step%
2982 }
2983 \anchor{north}{\northeast\pgf@x=0cm\relax}
2984 \anchor{east}{\northeast\pgf@y=0cm\relax}
2985 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2986 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2987 \anchor{north east}{\northeast}
2988 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2989 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2990 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2991 \anchor{text}{% text centered above
2992 \pgfpointorigin
2993 \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
2994 }
2995 \anchor{center}{
2996 \pgfpointorigin
2997 }
2998 \anchor{tip}{
2999 \pgfpointorigin
3000 \pgf@circ@res@step = \pgf@circ@Rlen
3001 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
3002 \pgf@x =\pgf@circ@res@step
3003 }
3004 \behindforegroundpath{
3005 \pgfscope
3006 \pgf@circ@res@step = \pgf@circ@Rlen
3007 \divide \pgf@circ@res@step by 4
3008 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
3009 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
3010 \pgfsetcolor{\ctikzvalof{color}}
3011 \pgfusepath{draw}
3012 \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
3013 \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
3014 \endpgfscope
3015 }
3016 }
3017
3018 %% Input arrow
3019
3020 \pgfdeclareshape{inputarrow}{
3021 \savedanchor{\northeast}{% this is really not northeast, really -northwest
3022 \pgf@circ@res@step = \pgf@circ@Rlen
3023 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
3024 \pgf@y=.5\pgf@circ@res@step
3025 \pgf@x=1.7\pgf@circ@res@step
3026 }
3027 \anchor{north}{\northeast\pgf@x=0cm\relax}
3028 \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
3029 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
3030 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
3031 \anchor{north east}{\northeast\pgf@x=0cm\relax}
3032 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3033 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
3034 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
3035 \savedanchor{\tip}{
3036 \pgfpointorigin
3037 }
3038 \anchor{center}{
3039 \tip
3040 }
3041 \anchor{tip}{
3042 \tip
3043 }
3044 \behindforegroundpath{
3045
3046 \pgfscope
3047 \pgf@circ@res@step = \pgf@circ@Rlen
3048 \divide \pgf@circ@res@step by 16
3049
3050 \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
3051 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3052 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
3053 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3054 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
3055 \pgfsetcolor{\ctikzvalof{color}}
3056 \pgfusepath{fill}
3057
3058 \endpgfscope
3059 }
3060 }
3061
3062
3063 %% box
3064
3065 \pgfdeclareshape{box}{
3066 \anchor{center}{
3067 \pgfpointorigin
3068 }
3069 \behindforegroundpath{
3070
3071 \pgfscope
3072 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
3073 \pgf@circ@res@step = 0.5\pgf@circ@res@step
3074 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3075 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
3076 \pgf@circ@draworfill
3077 \endpgfscope
3078 }
3079 }
3080
3081 %% box scaled with blocks
3082
3083 \pgfdeclareshape{blockbox}{
3084 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}}
3085 \anchor{center}{
3086 \pgfpointorigin
3087 }
3088 \behindforegroundpath{
3089 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
3090 \pgfscope
3091 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
3092 \pgf@circ@res@step = 0.5\pgf@circ@res@step
3093 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3094 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
3095 \pgf@circ@draworfill
3096 \endpgfscope
3097 }
3098 }
3099
3100 % full nodes for wire crossing
3101
3102 \pgfdeclareshape{jump crossing}
3103 {
3104 \savedanchor\northwest{%
3105 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
3106 \pgf@y=.5\pgf@y
3107 \pgf@x=-\pgf@y
3108 }
3109 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
3110 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
3111 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
3112 \anchor{west}{ \northwest \pgf@y=0pt }
3113 \anchor{w}{ \northwest \pgf@y=0pt }
3114 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
3115 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
3116 \anchor{north}{ \northwest \pgf@x=0pt }
3117 \anchor{n}{ \northwest \pgf@x=0pt }
3118 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
3119 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
3120 \anchor{north west}{ \northwest }
3121 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
3122 \behindbackgroundpath{
3123 \northwest
3124 \pgf@circ@res@up = \pgf@y
3125 \pgf@circ@res@down = -\pgf@y
3126 \pgf@circ@res@right = -\pgf@x
3127 \pgf@circ@res@left = \pgf@x
3128 % horizontal jumper
3129 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3130 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
3131 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
3132 \pgfsetbeveljoin
3133 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
3134 % vertical, broken path
3135 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
3136 \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
3137 \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
3138 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
3139 \pgfusepath{draw}
3140
3141 }
3142 }
3143 \pgfdeclareshape{plain crossing}
3144 {
3145 \savedanchor\northwest{%
3146 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
3147 \pgf@y=.5\pgf@y
3148 \pgf@x=-\pgf@y
3149 }
3150 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
3151 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
3152 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
3153 \anchor{west}{ \northwest \pgf@y=0pt }
3154 \anchor{w}{ \northwest \pgf@y=0pt }
3155 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
3156 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
3157 \anchor{north}{ \northwest \pgf@x=0pt }
3158 \anchor{n}{ \northwest \pgf@x=0pt }
3159 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
3160 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
3161 \anchor{north west}{ \northwest }
3162 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
3163 \behindbackgroundpath{
3164 \northwest
3165 \pgf@circ@res@up = \pgf@y
3166 \pgf@circ@res@down = -\pgf@y
3167 \pgf@circ@res@right = -\pgf@x
3168 \pgf@circ@res@left = \pgf@x
3169 % horizontal jumper
3170 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3171 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
3172 % vertical, broken path
3173 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
3174 \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
3175 \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
3176 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
3177 \pgfusepath{draw}
3178
3179 }
3180 }
3181
3182 %%%---------- close: tex/pgfcircshapes
3183 %%%%%%%%%%% Springe nach tex/pgfcircmonopoles
3184 %%%---------- open: tex/pgfcircmonopoles.tex
3185 % Copyright 2018-2026 by Romano Giannetti
3186 % Copyright 2015-2026 by Stefan Lindner
3187 % Copyright 2013-2026 by Stefan Erhardt
3188 % Copyright 2007-2026 by Massimo Redaelli
3189 %
3190 % This file may be distributed and/or modified
3191 %
3192 % 1. under the LaTeX Project Public License and/or
3193 % 2. under the GNU Public License.
3194 %
3195 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
3196
3197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3198 %% Monopoles
3199 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3200
3201 %%%%%%%%%%%%%
3202 %% Grounds
3203 %%%%%%%%%%%%%
3204
3205
3206 %% Ground symbol
3207 % #1 -> name
3208 % #2 -> width
3209 % #3 -> depth
3210 % #4 -> code
3211 \long\def\pgf@circ@declareground#1#2#3#4{
3212 \pgfdeclareshape{#1}{
3213 \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
3214 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3215 \savedanchor{\southeast}{
3216 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3217 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3218 \pgf@x=#2\pgf@x
3219 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3220 \pgf@y=-#3\pgf@y
3221 }
3222 \anchor{north}{\pgfpointorigin}
3223 \anchor{north east}{\southeast\pgf@y=0pt\relax}
3224 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
3225 \anchor{south east}{\southeast}
3226 \anchor{south}{\southeast\pgf@x=0pt\relax}
3227 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3228 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
3229 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
3230 \anchor{left}{\pgfpointorigin}
3231 \anchor{right}{\pgfpointorigin}
3232 \anchor{center}{\pgfpointorigin}
3233 \behindforegroundpath{
3234 \pgf@circ@scaled@Rlen=\scaledRlen
3235 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3236 \pgfscope
3237 \pgfstartlinewidth=\pgflinewidth
3238 #4
3239 \endpgfscope
3240 }
3241 }
3242 }
3243
3244
3245 \pgf@circ@declareground{ground}{0.6}{1.6}{
3246 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3247 \pgfpathmoveto{\pgfpointorigin}
3248 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
3249 \pgfusepath{draw}
3250 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3251 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3252 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3253 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3254 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3255 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3256 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3257 \pgfusepath{draw}
3258 }
3259
3260 \pgf@circ@declareground{tlground}{0.6}{0.4}{
3261 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3262 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
3263 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
3264 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
3265 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
3266 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
3267 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
3268 \pgfusepath{draw}
3269 }
3270
3271
3272 \pgf@circ@declareground{rground}{0.6}{1}{
3273 \pgfpathmoveto{\pgfpointorigin}
3274 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3275 \pgfusepath{draw}
3276
3277 \pgfstartlinewidth=\pgflinewidth
3278 \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
3279
3280 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3281 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3282 \pgfsetroundcap\pgfusepath{draw}
3283 }
3284
3285 \pgf@circ@declareground{tground}{0.6}{0}{
3286 \pgfpathmoveto{\pgfpointorigin}
3287 \pgfusepath{draw}
3288
3289 \pgfstartlinewidth=\pgflinewidth
3290 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3291
3292 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
3293 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
3294 \pgfusepath{draw}
3295 }
3296
3297 \pgf@circ@declareground{sground}{0.6}{1.8}{
3298 \pgfpathmoveto{\pgfpointorigin}
3299 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3300 \pgfusepath{draw}
3301
3302 \pgfstartlinewidth=\pgflinewidth
3303 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3304
3305 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3306 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3307 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
3308 \pgfpathclose
3309 \pgf@circ@draworfill
3310 }
3311
3312 % noiseless ground
3313 \pgf@circ@declareground{nground}{0.9}{1.6}{
3314 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3315 \pgfpathmoveto{\pgfpointorigin}
3316 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
3317 \pgfusepath{draw}
3318 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3319 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3320 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3321 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3322 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3323 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3324 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3325 \pgfusepath{draw}
3326 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3327 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
3328 \pgfusepath{draw}
3329 }
3330
3331 % protective ground
3332 \pgf@circ@declareground{pground}{0.9}{1.8}{
3333 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3334 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
3335 \pgf@circ@draworfill
3336 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3337 \pgfpathmoveto{\pgfpointorigin}
3338 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
3339 \pgfusepath{draw}
3340 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3341 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3342 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3343 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3344 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3345 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3346 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3347 \pgfusepath{draw}
3348 }
3349
3350 % chassis ground
3351 \pgf@circ@declareground{cground}{1}{2}{
3352 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3353 \pgfpathmoveto{\pgfpointorigin}
3354 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3355 \pgfusepath{draw}
3356 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3357 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3358 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3359 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3360 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3361 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3362 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3363 \pgfusepath{draw}
3364 }
3365
3366 % Contributed by @fotesan https://github.com/fotesan
3367 % european ground
3368 \pgf@circ@declareground{eground}{1.1}{1.7}{
3369 \pgfpathmoveto{\pgfpointorigin}
3370 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3371 \pgfusepath{draw}
3372
3373 \pgfstartlinewidth=\pgflinewidth
3374 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3375
3376 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3377 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3378 \pgfusepath{draw}
3379
3380 \pgfsetlinewidth{\pgfstartlinewidth}
3381 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3382 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3383 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3384 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3385 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3386 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3387 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3388 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3389 \pgfusepath{draw}
3390 }
3391
3392 \pgf@circ@declareground{eground2}{1.1}{1.7}{
3393 \pgfpathmoveto{\pgfpointorigin}
3394 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3395 \pgfusepath{draw}
3396
3397 \pgfstartlinewidth=\pgflinewidth
3398 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3399
3400 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3401 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3402 \pgfusepath{draw}
3403
3404 \pgfsetlinewidth{\pgfstartlinewidth}
3405 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3406 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3407 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3408 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3409 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3410 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3411 \pgfusepath{draw}
3412 }
3413
3414 %%%%%%%%%%%%%%%%%%
3415 %% Power supplies
3416 %%%%%%%%%%%%%%%%%%
3417
3418 % Vcc
3419 \pgfdeclareshape{vcc}{
3420 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
3421 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3422 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
3423 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
3424 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
3425 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
3426 }
3427 \savedanchor{\northeast}{%
3428 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3429 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3430 \pgf@x=.5\pgf@circ@res@step
3431 \pgf@y=3\pgf@x%
3432 }
3433 \anchor{north}{\northeast\pgf@x=0cm\relax}
3434 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3435 \anchor{south}{\pgfpointorigin}
3436 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3437 \anchor{north east}{\northeast}
3438 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3439 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3440 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3441 \anchor{center}{\pgfpointorigin}
3442 \anchor{left}{\pgfpointorigin}
3443 \anchor{right}{\pgfpointorigin}
3444 \anchor{text}{
3445 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3446 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3447 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3448 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3449 \pgf@x=0pt
3450 \pgf@y=2\pgf@circ@res@step
3451 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
3452 \pgf@x=-.5\wd\pgfnodeparttextbox
3453 }
3454 \behindforegroundpath{
3455 \pgf@circ@scaled@Rlen=\scaledRlen
3456 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3457 \pgfscope
3458 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
3459 \ifx\pgf@temp\pgf@circ@temp
3460 \pgfstartlinewidth=\pgflinewidth
3461 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3462
3463 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3464 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
3465 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3466 \pgfusepath{draw}
3467
3468 \pgfsetlinewidth{\pgfstartlinewidth}
3469 \else
3470 \pgfsetarrowsend{\pgf@circ@temp}
3471 \fi
3472 \pgfpathmoveto{\pgfpointorigin}
3473 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
3474 \pgfusepath{draw}
3475 \endpgfscope
3476 }
3477 }
3478
3479 % Vee
3480 \pgfdeclareshape{vee}{
3481 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
3482 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3483 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
3484 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
3485 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
3486 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
3487 }
3488 \savedanchor{\northeast}{%
3489 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3490 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3491 \pgf@x=.5\pgf@circ@res@step
3492 \pgf@y=-3\pgf@x%
3493 }
3494 \anchor{south}{\northeast\pgf@x=0cm\relax}
3495 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3496 \anchor{north}{\pgfpointorigin}
3497 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3498 \anchor{south east}{\northeast}
3499 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
3500 \anchor{north east}{\northeast\pgf@y=0pt\relax}
3501 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3502 \anchor{center}{\pgfpointorigin}
3503 \anchor{left}{\pgfpointorigin}
3504 \anchor{right}{\pgfpointorigin}
3505 \anchor{text}{
3506 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3507 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3508 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3509 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3510 \pgf@x=0pt
3511 \pgf@y=-2\pgf@circ@res@step
3512 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
3513 \pgf@x=-.5\wd\pgfnodeparttextbox
3514 }
3515
3516 \behindforegroundpath{
3517 \pgf@circ@scaled@Rlen=\scaledRlen
3518 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3519 \pgfscope
3520 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
3521 \ifx\pgf@temp\pgf@circ@temp
3522
3523 \pgfstartlinewidth=\pgflinewidth
3524 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3525
3526 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3527 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
3528 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3529 \pgfusepath{draw}
3530 \pgfsetlinewidth{\pgfstartlinewidth}
3531 \else
3532 \pgfsetarrowsend{\pgf@circ@temp}
3533 \fi
3534 \pgfpathmoveto{\pgfpointorigin}
3535 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3536 \pgfusepath{draw}
3537 \endpgfscope
3538 }
3539 }
3540
3541 %%%%%%%%%%%%%%%%
3542 %% RF elements
3543 %%%%%%%%%%%%%%%%
3544
3545 % Legacy tlinestub
3546 % Contributed by Leonardo Azzinnari
3547 \pgfdeclareshape{tlinestub}{
3548 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3549 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3550 \savedanchor{\northeast}{%
3551 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3552 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3553 \pgf@x=1.2\pgf@circ@res@step
3554 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3555 \pgf@y=.2\pgf@circ@res@step%
3556 }
3557 % the center is on the left side of the shape for facility of usage
3558 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3559 \anchor{east}{\northeast\pgf@y=0cm\relax}
3560 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
3561 \anchor{west}{\pgfpointorigin}
3562 \anchor{north east}{\northeast}
3563 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3564 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3565 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
3566 \anchor{center}{\pgfpointorigin}
3567 \behindforegroundpath{
3568 \pgfstartlinewidth=\pgflinewidth
3569
3570 \pgf@circ@scaled@Rlen=\scaledRlen
3571 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3572 \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
3573
3574 \pgfscope\begin{pgftransparencygroup}
3575 \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}}
3576 \pgf@circ@maybefill
3577 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3578 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3579 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
3580 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
3581 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3582 \pgf@circ@draworfill
3583 \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}}
3584 \pgfusepath{draw}
3585 \end{pgftransparencygroup} \endpgfscope
3586 \pgfpathmoveto{\pgfpointorigin}
3587 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
3588 \pgfusepath{draw}
3589 }
3590 }
3591
3592 %% New antennas without tails
3593
3594 % main body of antennas
3595 \def\pgf@circ@antennabody{%
3596 \pgfstartlinewidth=\pgflinewidth
3597 \pgf@circ@scaled@Rlen=\scaledRlen
3598 \pgfsetcolor{\ctikzvalof{color}}
3599 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3600 \pgfscope
3601 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3602 \pgfpathmoveto{\pgfpointorigin}
3603 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
3604 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
3605 \pgfsetbeveljoin
3606 \pgfpathclose
3607 \pgf@circ@draworfill
3608 \endpgfscope
3609 \pgfsetlinewidth{\pgfstartlinewidth}
3610 \pgfpathmoveto{\pgfpointorigin}
3611 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
3612 \pgfusepath{draw}
3613 }
3614
3615 % Waves for the antennas.
3616 \def\pgf@circ@antennawaves{%
3617 \pgfscope
3618 % define a triangle for clipping the waves
3619 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3620 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
3621 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3622 \pgfpathclose
3623 \pgfusepath{clip}
3624 % ...and build the waves as clipped circles
3625 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3626 \pgfmathloop%
3627 \ifnum\pgf@circ@count@a>2
3628 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
3629 \advance\pgf@circ@count@a-1\relax%
3630 \repeatpgfmathloop
3631 \pgfusepath{draw}
3632 \endpgfscope
3633 }
3634
3635 % additional shape with the waves
3636 \pgfdeclareshape{waves}{
3637 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3638 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3639 \anchor{center}{\pgfpointorigin}
3640 \savedanchor{\northeast}{
3641 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3642 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3643 \pgf@x=\pgf@circ@res@step
3644 \pgf@y=\pgf@circ@res@step
3645 }
3646 \anchor{text}{
3647 \northeast
3648 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3649 }
3650 \anchor{top}{\northeast\pgf@x=0pt}
3651 \anchor{right}{\northeast\pgf@y=0pt}
3652 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3653 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3654 \anchor{north}{\northeast\pgf@x=0pt}
3655 \anchor{north east}{\northeast}
3656 \anchor{east}{\northeast\pgf@y=0pt}
3657 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3658 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3659 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
3660 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3661 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3662 \behindforegroundpath{
3663 \pgf@circ@scaled@Rlen=\scaledRlen
3664 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3665 \pgf@circ@res@step=0.5\pgf@circ@res@step
3666 \pgfsetcolor{\ctikzvalof{color}}
3667 \pgfscope
3668 % define a triangle for clipping the waves
3669 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
3670 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
3671 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
3672 \pgfpathclose
3673 \pgfusepath{clip}
3674 % ...and build the waves as clipped circles
3675 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3676 \pgfmathloop%
3677 \ifnum\c@pgf@counta>1
3678 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
3679 \advance\c@pgf@counta-1\relax%
3680 \repeatpgfmathloop
3681 \pgfusepath{draw}
3682 \endpgfscope
3683 }
3684 }
3685
3686 % the three types of antennas: simple, TX, RX. Notice that you can flip them...
3687
3688 \pgfdeclareshape{bareantenna}{
3689 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3690 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3691 \anchor{center}{\pgfpointorigin}
3692 \savedanchor{\northeast}{
3693 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3694 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3695 \pgf@x=\pgf@circ@res@step
3696 \pgf@y=2\pgf@circ@res@step
3697 }
3698 \anchor{text}{
3699 \northeast
3700 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3701 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3702 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3703 }
3704 \anchor{top}{\northeast\pgf@x=0pt}
3705 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3706 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3707 \anchor{bottom}{\pgfpointorigin}
3708 \anchor{north}{\northeast\pgf@x=0pt}
3709 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3710 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3711 \anchor{south}{\pgfpointorigin}
3712 \anchor{north east}{\northeast}
3713 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3714 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3715 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3716 \behindforegroundpath{
3717 \pgf@circ@antennabody
3718 }
3719 }
3720
3721 \pgfdeclareshape{bareTXantenna}{
3722 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3723 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3724 \anchor{center}{\pgfpointorigin}
3725 \savedanchor{\northeast}{
3726 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3727 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3728 \pgf@x=\pgf@circ@res@step
3729 \pgf@y=2\pgf@circ@res@step
3730 }
3731 \savedanchor{\savedwaves}{
3732 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3733 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3734 \pgf@x=4.2\pgf@circ@res@step
3735 \pgf@y=\pgf@circ@res@step
3736 }
3737 \anchor{text}{
3738 \northeast
3739 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3740 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3741 \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
3742 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3743 }
3744 \anchor{waves}{\savedwaves}
3745 \anchor{top}{\northeast\pgf@x=0pt}
3746 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3747 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3748 \anchor{bottom}{\pgfpointorigin}
3749 \anchor{north}{\northeast\pgf@x=0pt}
3750 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3751 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3752 \anchor{south}{\pgfpointorigin}
3753 \anchor{north east}{\northeast}
3754 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3755 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3756 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3757 \behindforegroundpath{
3758 \pgf@circ@antennabody
3759 \pgf@circ@antennawaves
3760 }
3761 }
3762
3763 \pgfdeclareshape{bareRXantenna}{
3764 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3765 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3766 \anchor{center}{\pgfpointorigin}
3767 \savedanchor{\northeast}{
3768 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3769 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3770 \pgf@x=\pgf@circ@res@step
3771 \pgf@y=2\pgf@circ@res@step
3772 }
3773 \savedanchor{\savedwaves}{
3774 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3775 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3776 \pgf@x=-4.2\pgf@circ@res@step
3777 \pgf@y=\pgf@circ@res@step
3778 }
3779 \anchor{text}{
3780 \northeast
3781 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3782 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3783 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3784 }
3785 \anchor{waves}{\savedwaves}
3786 \anchor{top}{\northeast\pgf@x=0pt}
3787 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3788 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3789 \anchor{bottom}{\pgfpointorigin}
3790 \anchor{north}{\northeast\pgf@x=0pt}
3791 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3792 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3793 \anchor{south}{\pgfpointorigin}
3794 \anchor{north east}{\northeast}
3795 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3796 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3797 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3798 \behindforegroundpath{
3799 \pgf@circ@antennabody
3800 \pgftransformxshift{-5.2\pgf@circ@res@step}
3801 \pgf@circ@antennawaves
3802 }
3803 }
3804
3805 % Microstrip monopoles
3806
3807 \pgfdeclareshape{mslstub}{
3808 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3809 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3810 \savedanchor{\southeast}{
3811 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3812 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3813 \pgf@x=.5\pgf@x
3814 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3815 \pgf@y=-.5\pgf@y
3816 }
3817 \savedanchor{\northwest}{
3818 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3819 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3820 \pgf@x=-.5\pgf@x
3821 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3822 \pgf@y=.5\pgf@y
3823 }
3824 \anchor{north}{\northwest\pgf@x=0pt\relax}
3825 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3826 \anchor{east}{\southeast\pgf@y=0pt\relax}
3827 \anchor{south east}{\southeast}
3828 \anchor{south}{\southeast\pgf@x=0pt\relax}
3829 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3830 \anchor{west}{\northwest\pgf@y=0pt\relax}
3831 \anchor{north west}{\northwest}
3832 %
3833 \anchor{center}{\northwest\pgf@y=0pt\relax}
3834 \anchor{left}{\northwest\pgf@y=0pt\relax}
3835 \anchor{right}{\southeast\pgf@y=0pt\relax}
3836 % put the node text above and centered
3837 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3838 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3839 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3840 }
3841 }
3842 \behindbackgroundpath{
3843 \pgfextracty{\pgf@circ@res@up}{\northwest}
3844 \pgfextractx{\pgf@circ@res@right}{\southeast}
3845 \pgfextractx{\pgf@circ@res@left}{\northwest}
3846 \pgfextracty{\pgf@circ@res@down}{\southeast}
3847 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3848 \pgfstartlinewidth=\pgflinewidth
3849 \pgfscope
3850 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3851 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3852 \pgf@circ@draworfill
3853 \endpgfscope
3854 }
3855 }
3856
3857 \pgfdeclareshape{msrstub}{
3858 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3859 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3860 \savedanchor{\southeast}{
3861 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3862 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3863 \pgf@x=.5\pgf@x
3864 \pgf@y=0pt\relax
3865 }
3866 \savedanchor{\northwest}{
3867 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3868 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3869 \pgf@x=-.5\pgf@x
3870 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
3871 \pgf@y=.5\pgf@y
3872 }
3873 \anchor{north}{\northwest\pgf@x=0pt\relax}
3874 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3875 \anchor{east}{\southeast\pgf@y=0pt\relax}
3876 \anchor{south east}{\southeast}
3877 \anchor{south}{\southeast\pgf@x=0pt\relax}
3878 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3879 \anchor{west}{\northwest\pgf@y=0pt\relax}
3880 \anchor{north west}{\northwest}
3881 %
3882 \anchor{center}{\pgfpointorigin}
3883 \anchor{left}{\pgfpointorigin}
3884 \anchor{right}{\pgfpointorigin}
3885 % put the node text above and centered
3886 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3887 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3888 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3889 }
3890 }
3891 \behindbackgroundpath{
3892 \pgfextracty{\pgf@circ@res@up}{\northwest}
3893 \pgfextractx{\pgf@circ@res@right}{\southeast}
3894 \pgfextractx{\pgf@circ@res@left}{\northwest}
3895 \pgfextracty{\pgf@circ@res@down}{\southeast}
3896 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3897 \pgfstartlinewidth=\pgflinewidth
3898 \pgfscope
3899 \pgfpathmoveto{\pgfpointorigin}
3900 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3901 \pgfusepath{draw}
3902 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3903 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
3904 \pgfpatharc{135}{45}{\pgf@circ@res@step}
3905 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
3906 \pgfpatharc{45}{135}{\pgf@circ@res@up}
3907 \pgfclosepath
3908 \pgf@circ@draworfill
3909 \endpgfscope
3910 }
3911 }
3912
3913 \pgfdeclareshape{msport}{
3914 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3915 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3916 \savedanchor{\southeast}{
3917 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3918 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3919 \pgf@x=.5\pgf@x
3920 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3921 \pgf@y=-.5\pgf@y
3922 }
3923 \savedanchor{\northwest}{
3924 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3925 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3926 \pgf@x=-.5\pgf@x
3927 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3928 \pgf@y=.5\pgf@y
3929 }
3930 \anchor{north}{\northwest\pgf@x=0pt\relax}
3931 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3932 \anchor{east}{\southeast\pgf@y=0pt\relax}
3933 \anchor{south east}{\southeast}
3934 \anchor{south}{\southeast\pgf@x=0pt\relax}
3935 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3936 \anchor{west}{\northwest\pgf@y=0pt\relax}
3937 \anchor{north west}{\northwest}
3938 %
3939 \anchor{center}{\northwest\pgf@y=0pt\relax}
3940 \anchor{left}{\northwest\pgf@y=0pt\relax}
3941 \anchor{right}{\southeast\pgf@y=0pt\relax}
3942 % put the node text above and centered
3943 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3944 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3945 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3946 }
3947 }
3948 \behindbackgroundpath{
3949 \pgfextracty{\pgf@circ@res@up}{\northwest}
3950 \pgfextractx{\pgf@circ@res@right}{\southeast}
3951 \pgfextractx{\pgf@circ@res@left}{\northwest}
3952 \pgfextracty{\pgf@circ@res@down}{\southeast}
3953 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
3954 \pgfstartlinewidth=\pgflinewidth
3955 \pgfscope
3956 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3957 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3958 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
3959 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3960 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3961 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
3962 \pgfpathclose
3963 \pgf@circ@draworfill
3964 \endpgfscope
3965 }
3966 }
3967
3968 % Legacy antennas (with tails)
3969 \def\pgf@circ@shift@antenna@xy#1#2{%
3970 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
3971 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
3972 \relax}
3973
3974 % Legacy antenna
3975 \pgfdeclareshape{antenna}{
3976 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3977 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3978 \anchor{center}{\pgfpointorigin}
3979 \savedanchor{\northeast}{
3980 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3981 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3982 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3983 \pgf@y=4\pgf@circ@res@step
3984 }
3985 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
3986 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
3987 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
3988 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
3989 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3990 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3991 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
3992 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
3993 \anchor{text}{
3994 \northeast
3995 \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
3996 \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
3997 }
3998 \behindforegroundpath{
3999 \pgfstartlinewidth=\pgflinewidth
4000 \pgf@circ@scaled@Rlen=\scaledRlen
4001 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
4002
4003 \pgftransformxshift{ -4\pgf@circ@res@step }
4004
4005 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
4006 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4007
4008 \pgfusepath{draw}
4009
4010 \pgfscope
4011 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4012 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4013 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
4014 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4015 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4016 \pgfsetcolor{\ctikzvalof{color}}
4017 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4018 \pgfusepath{draw}
4019 \endpgfscope
4020 \pgfsetlinewidth{\pgfstartlinewidth}
4021
4022 }
4023 }
4024
4025 % Legacy TX antenna
4026 \pgfdeclareshape{txantenna}{
4027 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
4028 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
4029 \anchor{center}{\pgfpointorigin}
4030 \savedanchor{\northeast}{
4031 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
4032 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
4033 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
4034 \pgf@y=4\pgf@circ@res@step
4035 }
4036 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
4037 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
4038 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
4039 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
4040 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
4041 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
4042 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
4043 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
4044 \anchor{text}{
4045 \northeast
4046 \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
4047 \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
4048 }
4049 \behindforegroundpath{
4050 \pgfstartlinewidth=\pgflinewidth
4051 \pgf@circ@scaled@Rlen=\scaledRlen
4052 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
4053
4054 \pgfpathmoveto{\pgfpointorigin}
4055 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
4056 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
4057 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4058
4059 \pgfusepath{draw}
4060
4061 \pgfscope
4062 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4063 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4064 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
4065 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4066 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4067 \pgfsetcolor{\ctikzvalof{color}}
4068 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4069 \pgfusepath{draw}
4070 \endpgfscope
4071 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
4072 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
4073 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
4074 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
4075 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
4076 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
4077 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
4078 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
4079 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
4080 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
4081 \pgfusepath{draw}
4082 \pgfsetlinewidth{\pgfstartlinewidth}
4083
4084 }
4085 }
4086
4087 % Legacy RX antenna
4088 \pgfdeclareshape{rxantenna}{
4089 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
4090 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
4091 \anchor{center}{\pgfpointorigin}
4092 \savedanchor{\northeast}{
4093 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
4094 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
4095 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
4096 \pgf@y=4\pgf@circ@res@step
4097 }
4098 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
4099 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
4100 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
4101 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
4102 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
4103 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
4104 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
4105 \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
4106 \anchor{text}{
4107 \northeast
4108 \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
4109 \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
4110 }
4111 \behindforegroundpath{
4112 \pgfstartlinewidth=\pgflinewidth
4113 \pgf@circ@scaled@Rlen=\scaledRlen
4114 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
4115
4116 \pgfpathmoveto{\pgfpointorigin}
4117 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
4118 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
4119 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4120
4121 \pgfusepath{draw}
4122
4123 \pgfscope
4124 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4125 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4126 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
4127 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4128 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
4129 \pgfsetcolor{\ctikzvalof{color}}
4130 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4131 \pgfusepath{draw}
4132 \endpgfscope
4133
4134 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
4135 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
4136 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
4137 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
4138 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
4139 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
4140 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
4141 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
4142 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
4143 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
4144 \pgfusepath{draw}
4145 \pgfsetlinewidth{\pgfstartlinewidth}
4146 }
4147 }
4148
4149 % Legacy match
4150 \pgfdeclareshape{match}{
4151 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
4152 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
4153 \savedanchor{\northeast}{%
4154 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
4155 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
4156 \pgf@x=2\pgf@circ@res@step
4157 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
4158 \pgf@y=.5\pgf@circ@res@step%
4159 }
4160 % the center is on the left side of the shape for facility of usage
4161 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
4162 \anchor{east}{\northeast\pgf@y=0cm\relax}
4163 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
4164 \anchor{west}{\pgfpointorigin}
4165 \anchor{north east}{\northeast}
4166 \anchor{north west}{\northeast\pgf@x=0cm\relax}
4167 \anchor{south east}{\northeast\pgf@y=0pt\relax}
4168 \anchor{south west}{\pgfpointorigin}
4169 \anchor{center}{
4170 \pgfpointorigin
4171 }
4172 \anchor{text}{
4173 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
4174 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
4175 \pgf@x=1.5\pgf@x
4176 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
4177 \pgf@y=-1.5\ht\pgfnodeparttextbox
4178 }
4179 \behindforegroundpath{
4180 \pgf@circ@scaled@Rlen=\scaledRlen
4181 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
4182
4183 \pgfscope
4184 \pgfpathmoveto{\pgfpointorigin}
4185 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
4186 \pgfusepath{draw}
4187
4188 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
4189 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
4190 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
4191 \pgfusepath{fill}
4192
4193 \pgfsetlinewidth{\pgfstartlinewidth}
4194 \endpgfscope
4195 }
4196 }
4197
4198 %%%---------- close: tex/pgfcircmonopoles
4199 %%%%%%%%%%% Springe nach tex/pgfcircbipoles
4200 %%%---------- open: tex/pgfcircbipoles.tex
4201 % Copyright 2018-2026 by Romano Giannetti
4202 % Copyright 2015-2026 by Stefan Lindner
4203 % Copyright 2013-2026 by Stefan Erhardt
4204 % Copyright 2007-2026 by Massimo Redaelli
4205 %
4206 % This file may be distributed and/or modified
4207 %
4208 % 1. under the LaTeX Project Public License and/or
4209 % 2. under the GNU Public License.
4210 %
4211 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
4212
4213 %% Generic macro for defining a bipole shape
4214 % #1 - additional anchors
4215 % #2 - lower y-size of the bipole (from the center).
4216 % #3 - #shape is the name of the shape
4217 % #4 - upper y-size of the bipole (from the center)
4218 % #5 - width of the bipole
4219 % #6 - macros drawing the bipole
4220 %
4221 \long\def\pgfcircdeclarebipole{%
4222 \pgfcircdeclarebipolescaled{default}}
4223
4224 %% Generic macro for defining a bipole shape
4225 % #1 - scale factor
4226 % #2 - additional anchors
4227 % #3 - lower y-size of the bipole (from the center).
4228 % #4 - #shape is the name of the shape
4229 % #5 - upper y-size of the bipole (from the center)
4230 % #6 - width of the bipole
4231 % #7 - macros drawing the bipole
4232 %
4233 \long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
4234 \pgfdeclareshape{#4shape}{
4235 \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
4236 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
4237 \savedanchor{\northeast}{
4238 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4239 \pgf@y=#5\pgf@circ@scaled@Rlen
4240 \pgf@y=.5\pgf@y
4241 \pgf@x=#6\pgf@circ@scaled@Rlen
4242 \pgf@x=.5\pgf@x
4243 }
4244 \savedanchor{\northeastborder}{
4245 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4246 \pgf@y=#5\pgf@circ@scaled@Rlen
4247 \pgf@y=.5\pgf@y
4248 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
4249 \pgf@x=#6\pgf@circ@scaled@Rlen
4250 \pgf@x=.5\pgf@x
4251 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
4252 }
4253 \savedanchor{\southwestborder}{
4254 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4255 \pgf@y=-#3\pgf@circ@scaled@Rlen
4256 \pgf@y=.5\pgf@y
4257 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
4258 \pgf@x=-#6\pgf@circ@scaled@Rlen
4259 \pgf@x=.5\pgf@x
4260 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
4261 }
4262 \savedanchor{\southwest}{
4263 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4264 \pgf@y=-#3\pgf@circ@scaled@Rlen
4265 \pgf@y=.5\pgf@y
4266 \pgf@x=-#6\pgf@circ@scaled@Rlen
4267 \pgf@x=.5\pgf@x
4268 }
4269 \savedanchor{\centerpoint}{
4270 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4271 \pgf@circ@res@down=-#3\pgf@circ@scaled@Rlen
4272 \pgf@circ@res@up=#5\pgf@circ@scaled@Rlen
4273 \pgfpointorigin
4274 \pgf@y=\pgf@circ@res@up
4275 \advance\pgf@y by\pgf@circ@res@down
4276 \pgf@y=.5\pgf@y
4277 }
4278 \anchor{center}{\pgfpointorigin}
4279 \anchor{n}{
4280 \northeast
4281 \pgf@x=0cm
4282 }
4283 \anchor{north east}{
4284 \northeast
4285 }
4286 \anchor{north west}{
4287 \northeast
4288 \pgf@x=-\pgf@x
4289 }
4290 \anchor{ne}{
4291 \northeast
4292 }
4293 \anchor{nw}{
4294 \northeast
4295 \pgf@x=-\pgf@x
4296 }
4297 \anchor{e}{
4298 \northeast
4299 \pgf@y=0cm
4300 }
4301 \anchor{s}{
4302 \southwest
4303 \pgf@x=0cm
4304 }
4305 \anchor{south east}{
4306 \southwest
4307 \pgf@x=-\pgf@x
4308 }
4309 \anchor{south west}{
4310 \southwest
4311 }
4312 \anchor{se}{
4313 \southwest
4314 \pgf@x=-\pgf@x
4315 }
4316 \anchor{sw}{
4317 \southwest
4318 }
4319 \anchor{w}{
4320 \southwest
4321 \pgf@y=0cm
4322 }
4323 \anchor{north}{
4324 \northeast
4325 \pgf@x=0cm
4326 }
4327 \anchor{east}{
4328 \northeast
4329 \pgf@y=0cm
4330 }
4331 \anchor{south}{
4332 \southwest
4333 \pgf@x=0cm
4334 }
4335 \anchor{west}{
4336 \southwest
4337 \pgf@y=0cm
4338 }
4339 \anchor{right}{
4340 \northeast
4341 \pgf@y=0cm
4342 }
4343 \anchor{above}{
4344 \northeast
4345 \pgf@x=0cm
4346 }
4347 \anchor{left}{
4348 \southwest
4349 \pgf@y=0cm
4350 }
4351 \anchor{below}{
4352 \southwest
4353 \pgf@x=0cm
4354 }
4355 \anchor{a}{
4356 \northeast
4357 \pgf@y=0cm
4358 }
4359 \anchor{b}{
4360 \southwest
4361 \pgf@y=0cm
4362 }
4363 \savedanchor{\textanchor}{%
4364 \pgf@y=\ht\pgfnodeparttextbox
4365 \pgf@x=-.5\wd\pgfnodeparttextbox
4366 }
4367 \anchor{text}{
4368 \textanchor
4369 }
4370 \anchorborder{%
4371 \ifpgf@circuit@bipole@inverted
4372 \pgf@circ@res@left=-\pgf@x
4373 \pgf@circ@res@right=-\pgf@y
4374 \else
4375 \pgf@circ@res@left=\pgf@x
4376 \pgf@circ@res@right=\pgf@y
4377 \fi
4378 \ifdim\pgf@circ@res@right>0cm
4379 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
4380 \else
4381 \southwestborder
4382 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
4383 \fi
4384 }
4385
4386 #2
4387
4388 \backgroundpath{
4389 \pgfsetcolor{\ctikzvalof{color}}
4390
4391 \northeast
4392 \pgf@circ@res@up = \pgf@y
4393 \pgf@circ@res@zero = 0cm
4394 \pgf@circ@res@left = -\pgf@x
4395 \pgf@circ@res@right = \pgf@x
4396 \southwest
4397 \pgf@circ@res@down = \pgf@y
4398 \pgf@circ@scaled@Rlen=\scaledRlen
4399 \pgfstartlinewidth=\pgflinewidth
4400 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
4401 #7
4402
4403 \pgfsetlinewidth{\pgfstartlinewidth}
4404 }
4405 }
4406 }
4407
4408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4409 %% Standard bipole shapes declarations
4410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4411
4412 %%%%%%%%%%%%%%%%%%%%%%%%
4413 % Resistive components
4414 %%%%%%%%%%%%%%%%%%%%%%%%
4415
4416 %% Short circuit
4417
4418 %%% NOTICE that the short is really NOT drawn; we trust the fact that its
4419 %%% natural length is zero.
4420 \pgfcircdeclarebipole
4421 {}
4422 {0}
4423 {short}
4424 {0}
4425 {0}
4426 { }
4427
4428 %% Open circuit
4429 \pgfcircdeclarebipole
4430 {}
4431 {\ctikzvalof{bipoles/open/height}}
4432 {open}
4433 {\ctikzvalof{bipoles/open/height}}
4434 {\ctikzvalof{bipoles/open/width}}
4435 { }
4436
4437 % multiwire(s)
4438 \pgfcircdeclarebipole
4439 {}
4440 {\ctikzvalof{bipoles/multiwire/height}}
4441 {multiwire}
4442 {\ctikzvalof{bipoles/multiwire/height}}
4443 {\ctikzvalof{bipoles/multiwire/width}}
4444 {
4445 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4446 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4447 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4448 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
4449 \pgfusepath{draw}
4450 }
4451
4452 \pgfcircdeclarebipole
4453 {}
4454 {\ctikzvalof{bipoles/multiwire/height}}
4455 {bmultiwire}
4456 {\ctikzvalof{bipoles/multiwire/height}}
4457 {\ctikzvalof{bipoles/multiwire/width}}
4458 {
4459 \pgf@circ@res@other=\ctikzvalof{bipoles/multiwire/spacing}\pgf@circ@Rlen
4460 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4461 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
4462 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@other}{\pgf@circ@res@down}}
4463 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4464 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4465 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
4466 \pgfusepath{draw}
4467 }
4468 %% Generic bipole - used as resistor by some (bleah)
4469 \pgfcircdeclarebipolescaled{resistors}
4470 {}
4471 {\ctikzvalof{bipoles/generic/height}}
4472 {generic}
4473 {\ctikzvalof{bipoles/generic/height}}
4474 {\ctikzvalof{bipoles/generic/width}}
4475 {
4476 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4477 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4478 \pgf@circ@draworfill
4479 }
4480
4481 %% Generic empty tunable
4482 \pgfcircdeclarebipolescaled{resistors}
4483 {}
4484 {\ctikzvalof{bipoles/tgeneric/height}}
4485 {tgeneric}
4486 {\ctikzvalof{bipoles/tgeneric/height}}
4487 {\ctikzvalof{bipoles/tgeneric/width}}
4488 {
4489 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
4490 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4491 \pgf@circ@draworfill
4492 \pgfscope
4493 \pgfsetarrowsend{latexslim}
4494 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
4495 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
4496 \pgfusepath{draw}
4497 \endpgfscope
4498 }
4499
4500 %% Generic asymmetric bipole
4501 \pgfcircdeclarebipolescaled{resistors}
4502 {}
4503 {\ctikzvalof{bipoles/ageneric/height}}
4504 {ageneric}
4505 {\ctikzvalof{bipoles/ageneric/height}}
4506 {\ctikzvalof{bipoles/ageneric/width}}
4507 {
4508 \pgfscope
4509 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4510 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4511 \pgf@circ@draworfill
4512 \endpgfscope
4513
4514 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4515 \pgfusepath{stroke,fill}
4516 }
4517
4518 %% Memristor
4519 \pgfcircdeclarebipolescaled{resistors}
4520 {}
4521 {\ctikzvalof{bipoles/memristor/height}}
4522 {memristor}
4523 {\ctikzvalof{bipoles/memristor/height}}
4524 {\ctikzvalof{bipoles/memristor/width}}
4525 {
4526 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4527 \divide \pgf@circ@res@step by 14
4528
4529 \pgfscope
4530 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4531 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4532 \pgf@circ@draworfill
4533 \endpgfscope
4534 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4535 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
4536 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4537 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4538 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4539 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4540 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4541 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4542 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
4543 \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
4544
4545 \pgfusepath{draw}
4546
4547 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4548 \pgfusepath{stroke,fill}
4549 }
4550
4551 %% Photoresistor
4552 \pgfcircdeclarebipolescaled{resistors}
4553 {}
4554 {\ctikzvalof{bipoles/photoresistor/height 2}}
4555 {photoresistor}
4556 {\ctikzvalof{bipoles/photoresistor/height}}
4557 {\ctikzvalof{bipoles/photoresistor/width}}
4558 {
4559 \pgfscope
4560 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
4561 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4562 \pgf@circ@draworfill
4563 \endpgfscope
4564
4565 \pgfscope
4566 \pgfsetarrowsend{latexslim}
4567 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
4568 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4569 \pgfusepath{draw}
4570 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
4571 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4572 \pgfusepath{draw}
4573 \endpgfscope
4574 }
4575
4576 %% Thermistor
4577 \pgfcircdeclarebipolescaled{resistors}
4578 {{% anchor for labelling the type of dependency
4579 \anchor{label}{%
4580 \southwest
4581 \pgf@x=0.4\pgf@x
4582 \pgf@y=1.2\pgf@y
4583 }%
4584 }}
4585 {\ctikzvalof{bipoles/thermistor/height}}
4586 {thermistor}
4587 {\ctikzvalof{bipoles/thermistor/height}}
4588 {\ctikzvalof{bipoles/thermistor/width}}
4589 {
4590 \pgfscope
4591 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}
4592 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4593 \pgf@circ@draworfill
4594 \endpgfscope
4595
4596 %\pgfscope
4597 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
4598 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4599 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4600 \pgfusepath{draw}
4601 %\endpgfscope
4602 }
4603
4604 %% Thermistor PTC
4605 \pgfcircdeclarebipolescaled{resistors}
4606 {}
4607 {\ctikzvalof{bipoles/thermistorptc/height 2}}
4608 {thermistorptc}
4609 {\ctikzvalof{bipoles/thermistorptc/height}}
4610 {\ctikzvalof{bipoles/thermistorptc/width}}
4611 {
4612 \pgfscope
4613 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}
4614 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4615 \pgf@circ@draworfill
4616 \endpgfscope
4617 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4618 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4619 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4620 \pgfusepath{draw}
4621
4622 \pgfsetlinewidth{\pgfstartlinewidth}
4623 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4624 \pgfsetarrowsend{latexslim}
4625 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4626 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4627 \pgfusepath{draw}
4628 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4629 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4630 \pgfusepath{draw}
4631 }
4632
4633 %% Thermistor NTC
4634 \pgfcircdeclarebipolescaled{resistors}
4635 {}
4636 {\ctikzvalof{bipoles/thermistorntc/height 2}}
4637 {thermistorntc}
4638 {\ctikzvalof{bipoles/thermistorntc/height}}
4639 {\ctikzvalof{bipoles/thermistorntc/width}}
4640 {
4641 \pgfscope
4642 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}
4643 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4644 \pgf@circ@draworfill
4645 \endpgfscope
4646
4647 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4648 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4649 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4650 \pgfusepath{draw}
4651
4652 \pgfsetlinewidth{\pgfstartlinewidth}
4653 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4654 \pgfsetarrowsend{latexslim}
4655 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4656 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4657 \pgfusepath{draw}
4658 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4659 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4660 \pgfusepath{draw}
4661 }
4662
4663 %% Generic tunable
4664 \pgfcircdeclarebipolescaled{resistors}
4665 {
4666 \savedanchor{\wiper}{
4667 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4668 \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
4669 \pgf@y=.5\pgf@ya
4670 \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
4671 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
4672 }
4673 \anchor{wiper}{\wiper}
4674 \anchor{W}{\wiper}
4675 }
4676 {\ctikzvalof{bipoles/generic potentiometer/height 2}}
4677 {genericpotentiometer}
4678 {\ctikzvalof{bipoles/generic potentiometer/height}}
4679 {\ctikzvalof{bipoles/generic potentiometer/width}}
4680 {
4681
4682 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4683 \divide \pgf@circ@res@step by 14
4684
4685 \pgfscope
4686 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4687 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4688 \pgf@circ@draworfill
4689 \endpgfscope
4690 \pgfscope
4691 %\pgfsetlinewidth{\pgfstartlinewidth}
4692 \pgfsetarrowsend{latexslim}
4693 \pgfextractx{\pgf@circ@res@other}{\wiper}
4694 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4695 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4696 \pgfusepath{draw}
4697 \endpgfscope
4698 }
4699
4700 %% Zig zag resistores
4701 \def\pgf@circ@zigzag#1{%
4702 \divide \pgf@circ@res@step by \numexpr4*\zigs\relax
4703
4704 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
4705 \pgf@circ@res@other = \pgf@circ@res@left
4706 \pgf@circ@count@a=\zigs\relax
4707 % first half zig
4708 \advance\pgf@circ@res@other by \pgf@circ@res@step
4709 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4710 \pgfmathloop%
4711 \advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times
4712 \ifnum\pgf@circ@count@a>0
4713 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4714 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4715 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4716 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4717 \repeatpgfmathloop%
4718 % last zig and a half
4719 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4720 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4721 \advance\pgf@circ@res@other by \pgf@circ@res@step
4722 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
4723 \pgfsetbeveljoin
4724 \pgfusepath{draw}
4725 }
4726
4727 %% Resistor
4728 \pgfcircdeclarebipolescaled{resistors}
4729 {
4730 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4731 }
4732 {\ctikzvalof{bipoles/resistor/height}}
4733 {resistor}
4734 {\ctikzvalof{bipoles/resistor/height}}
4735 {\ctikzvalof{bipoles/resistor/width}}
4736 {
4737 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4738 \pgftransformationadjustments
4739 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4740 \pgf@circ@zigzag{1}
4741 }
4742
4743
4744 %% Variable resistor
4745 \pgfcircdeclarebipolescaled{resistors}
4746 {
4747 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4748 }
4749 {\ctikzvalof{bipoles/vresistor/height}}
4750 {vresistor}
4751 {\ctikzvalof{bipoles/vresistor/height}}
4752 {\ctikzvalof{bipoles/vresistor/width}}
4753 {
4754 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4755 \pgftransformationadjustments
4756 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4757 \pgf@circ@zigzag{.5}
4758
4759 \pgfscope
4760 \pgfsetarrowsend{latexslim}
4761 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4762 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4763 \pgfusepath{draw}
4764 \endpgfscope
4765 }
4766
4767 %% Potentiometer
4768 \pgfcircdeclarebipolescaled{resistors}
4769 {
4770 \savedanchor{\wiper}{
4771 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4772 \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
4773 \pgf@y=.5\pgf@ya
4774 \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
4775 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
4776 }
4777 \anchor{wiper}{\wiper}
4778 \anchor{W}{\wiper}
4779 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4780 }
4781 {\ctikzvalof{bipoles/potentiometer/height 2}}
4782 {potentiometer}
4783 {\ctikzvalof{bipoles/potentiometer/height}}
4784 {\ctikzvalof{bipoles/potentiometer/width}}
4785 {
4786 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4787 \pgftransformationadjustments
4788 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4789 \pgf@circ@zigzag{1}
4790
4791 \pgfscope
4792 %\pgfsetlinewidth{\pgfstartlinewidth}
4793 \pgfsetarrowsend{latexslim}
4794 \pgfextractx{\pgf@circ@res@other}{\wiper}
4795 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4796 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4797 \pgfusepath{draw}
4798 \endpgfscope
4799 }
4800
4801 %% Resistive sensor
4802 \pgfcircdeclarebipolescaled{resistors}
4803 {% anchor for labelling the type of dependency
4804 \anchor{label}{\southwest\pgf@x=0.4\pgf@x}%
4805 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4806 }
4807 {\ctikzvalof{bipoles/resistivesens/height}}
4808 {resistivesens}
4809 {\ctikzvalof{bipoles/resistivesens/height}}
4810 {\ctikzvalof{bipoles/resistivesens/width}}
4811 {%
4812 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4813 \pgftransformationadjustments
4814 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4815 \pgf@circ@zigzag{.5}
4816
4817 \pgfscope
4818 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4819 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4820 \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
4821 \pgfusepath{draw}
4822 \endpgfscope
4823 }
4824
4825 %%%%%%%%%%%%%%
4826 %% Capacitors
4827 %%%%%%%%%%%%%
4828
4829 %% Plain Capacitor
4830 \pgfcircdeclarebipolescaled{capacitors}
4831 {}
4832 {\ctikzvalof{bipoles/capacitor/height}}
4833 {capacitor}
4834 {\ctikzvalof{bipoles/capacitor/height}}
4835 {\ctikzvalof{bipoles/capacitor/width}}
4836 {
4837 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4838 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4839 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4840
4841 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4842 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4843 \pgfusepath{draw}
4844
4845 }
4846
4847 %% Capacitive sensor
4848 \pgfcircdeclarebipolescaled{capacitors}
4849 {
4850 \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}%
4851 }
4852 {\ctikzvalof{bipoles/capacitor/height}}
4853 {capacitivesens}
4854 {\ctikzvalof{bipoles/capacitor/height}}
4855 {\ctikzvalof{bipoles/capacitor/width}}
4856 {
4857 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4858 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4859 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4860
4861 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4862 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4863 \pgfusepath{draw}
4864 \pgfscope
4865 \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
4866 \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4867 \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4868 \pgfusepath{draw}
4869 \endpgfscope
4870 }
4871
4872 %% Polar Capacitor (DEPRECATED)
4873 \pgfcircdeclarebipolescaled{capacitors}
4874 {}
4875 {\ctikzvalof{bipoles/pcapacitor/height}}
4876 {polarcapacitor}
4877 {\ctikzvalof{bipoles/pcapacitor/height}}
4878 {\ctikzvalof{bipoles/pcapacitor/width}}
4879 {
4880 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4881
4882 \pgfscope
4883 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
4884 \pgftransformrotate{-90}
4885 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4886 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4887 \pgfusepath{draw}
4888 \endpgfscope
4889
4890 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4891 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4892 \pgfusepath{draw}
4893 }
4894
4895
4896 %% Curved capacitor
4897 % see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
4898 % for a rationale
4899 %
4900 \pgfcircdeclarebipolescaled{capacitors}
4901 {}
4902 {\ctikzvalof{bipoles/ccapacitor/height}}
4903 {ccapacitor}
4904 {\ctikzvalof{bipoles/ccapacitor/height}}
4905 {\ctikzvalof{bipoles/ccapacitor/width}}
4906 {
4907 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4908
4909 \pgfscope
4910 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
4911 \pgftransformrotate{-90}
4912 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4913 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4914 \pgfusepath{draw}
4915 \endpgfscope
4916
4917 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4918 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4919 \pgfusepath{draw}
4920 }
4921
4922
4923
4924
4925 %% Electrolytic Capacitor
4926 \pgfcircdeclarebipolescaled{capacitors}
4927 {}
4928 {\ctikzvalof{bipoles/ecapacitor/height}}
4929 {ecapacitor}
4930 {\ctikzvalof{bipoles/ecapacitor/height}}
4931 {\ctikzvalof{bipoles/ecapacitor/width}}
4932 {
4933 \pgfsetrectcap
4934 % % % Draw plus pole
4935 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4936 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4937 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
4938 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4939 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4940 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4941 \pgf@circ@draworfill
4942 % % Draw minus pole
4943 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4944 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4945 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
4946 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4947 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4948 \pgfsetfillcolor{\ctikzvalof{color}}
4949 \pgfusepath{draw,fill}
4950 \pgfsetfillcolor{\ctikzvalof{color}}
4951 % % plus pole annotation
4952 \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
4953 {\ctikzvalof{bipoles/ecapacitor/font} $+$}
4954 }
4955
4956 %% Variable Capacitor
4957 \pgfcircdeclarebipolescaled{capacitors}
4958 {}
4959 {\ctikzvalof{bipoles/vcapacitor/height}}
4960 {vcapacitor}
4961 {\ctikzvalof{bipoles/vcapacitor/height}}
4962 {\ctikzvalof{bipoles/vcapacitor/width}}
4963 {
4964 \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
4965
4966 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4967 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
4968 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
4969
4970 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4971 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4972 \pgfusepath{draw}
4973
4974 \pgfscope
4975 \pgfsetarrowsend{latexslim}
4976 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4977 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4978 \pgfusepath{draw}
4979 \endpgfscope
4980
4981 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4982 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
4983 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
4984 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
4985 \pgfsetlinewidth{\pgfstartlinewidth}
4986 \pgfusepath{draw}
4987 }
4988
4989
4990 %% Piezoelectric Element
4991
4992 \pgfcircdeclarebipolescaled{capacitors}
4993 {}
4994 {\ctikzvalof{bipoles/piezoelectric/height}}
4995 {piezoelectric}
4996 {\ctikzvalof{bipoles/piezoelectric/height}}
4997 {\ctikzvalof{bipoles/piezoelectric/width}}
4998 {
4999 % \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
5000 % \divide \pgf@circ@res@step by 5
5001
5002 %% Outer markings
5003 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5004 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5005 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5006
5007 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5008 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5009 \pgfusepath{draw}
5010
5011 %% Inner Box
5012 \pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10
5013 \pgfscope
5014 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5015 \pgfpathrectanglecorners
5016 {\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}}
5017 {\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}}
5018 \pgf@circ@draworfill
5019 \endpgfscope
5020 }
5021
5022 %%%%%%%%%%%%%%%
5023 %% Inductors
5024 %%%%%%%%%%%%%%%
5025
5026 %% cute inductor
5027 \pgfcircdeclarebipolescaled{inductors}
5028 {
5029 \savedanchor{\midtap}{%
5030 \pgf@x=0pt\relax
5031 \pgfmathsetlength{\pgf@y}{%
5032 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
5033 \ctikzvalof{bipoles/cuteinductor/height} :% even
5034 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
5035 *\pgf@circ@scaled@Rlen/2
5036 }
5037 }
5038 \anchor{midtap}{\midtap}
5039 }
5040 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
5041 {cuteinductor}
5042 {\ctikzvalof{bipoles/cuteinductor/height}}
5043 {\ctikzvalof{bipoles/cuteinductor/width}}
5044 {
5045 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5046 \pgftransformationadjustments
5047
5048 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
5049 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
5050
5051
5052 \pgfmathsetlength{\pgf@circ@res@step}
5053 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
5054
5055 \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
5056 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
5057 {
5058 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5059 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
5060 }
5061 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5062 \pgfsetbuttcap
5063 \pgfsetbeveljoin
5064 \pgfusepath{stroke}
5065 }
5066
5067 %% cute inductive sensor
5068 \pgfcircdeclarebipolescaled{inductors}
5069 {% anchor for labelling the type of dependency
5070 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
5071 \savedanchor{\midtap}{%
5072 \pgf@x=0pt\relax
5073 \pgfmathsetlength{\pgf@y}{%
5074 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
5075 \ctikzvalof{bipoles/cuteinductor/height} :% even
5076 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
5077 *\pgf@circ@scaled@Rlen/2
5078 }
5079 }
5080 \anchor{midtap}{\midtap}
5081 }
5082 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
5083 {scuteinductor}
5084 {\ctikzvalof{bipoles/cuteinductor/height}}
5085 {\ctikzvalof{bipoles/cuteinductor/width}}
5086 {
5087 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5088 \pgftransformationadjustments
5089
5090 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
5091 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
5092
5093
5094 \pgfmathsetlength{\pgf@circ@res@step}
5095 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
5096
5097 \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
5098 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
5099 {
5100 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5101 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
5102 }
5103 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5104 \pgfsetbuttcap
5105 \pgfsetbeveljoin
5106 \pgfusepath{stroke}
5107 \pgfscope
5108 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
5109 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5110 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5111 \pgfusepath{draw}
5112 \endpgfscope
5113 }
5114
5115 %% cute choke
5116 \pgfcircdeclarebipolescaled{inductors}
5117 {
5118 \savedanchor{\midtap}{%
5119 \pgf@x=0pt\relax
5120 \pgfmathsetlength{\pgf@y}{%
5121 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
5122 \ctikzvalof{bipoles/cuteinductor/height} :% even
5123 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
5124 *\pgf@circ@scaled@Rlen/2
5125 }
5126 }
5127 \anchor{midtap}{\midtap}
5128 }
5129 {\ctikzvalof{bipoles/cutechoke/lower coil height}}
5130 {cutechoke}
5131 {\ctikzvalof{bipoles/cutechoke/height}}
5132 {\ctikzvalof{bipoles/cutechoke/width}}
5133 {
5134 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5135 \pgftransformationadjustments
5136
5137 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
5138 {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
5139
5140
5141 \pgfmathsetlength{\pgf@circ@res@step}
5142 {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
5143
5144 \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
5145 \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
5146 {
5147 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5148 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
5149 }
5150 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
5151 \pgfsetbuttcap
5152 \pgfsetbeveljoin
5153 \pgfusepath{stroke}
5154
5155 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
5156 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
5157 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5158 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
5159 \pgfusepath{stroke}
5160
5161 \ifpgf@circuit@bipole@twolineschoke
5162 \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}}
5163 \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}}
5164 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5165 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
5166 \pgfusepath{stroke}
5167 \fi
5168 }
5169
5170 %% variable cute inductor
5171 \pgfcircdeclarebipolescaled{inductors}
5172 {
5173 \savedanchor{\midtap}{%
5174 \pgf@x=0pt\relax
5175 \pgfmathsetlength{\pgf@y}{%
5176 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
5177 \ctikzvalof{bipoles/cuteinductor/height} :% even
5178 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
5179 *\pgf@circ@scaled@Rlen/2
5180 }
5181 }
5182 \anchor{midtap}{\midtap}
5183 }
5184 {\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
5185 {vcuteinductor}
5186 {\ctikzvalof{bipoles/vcuteinductor/height}}
5187 {\ctikzvalof{bipoles/vcuteinductor/width}}
5188 {
5189 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5190 \pgftransformationadjustments
5191
5192 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
5193 {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
5194
5195
5196 \pgfmathsetlength{\pgf@circ@res@step}
5197 {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
5198
5199 \pgfscope
5200 \pgfsetarrowsend{latexslim}
5201 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
5202 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5203 \pgfusepath{draw}
5204 \endpgfscope
5205
5206 \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
5207 \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
5208 {
5209 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
5210 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
5211 }
5212 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
5213 \pgfsetbuttcap
5214 \pgfsetbeveljoin
5215 \pgfusepath{stroke}
5216 }
5217
5218 %% american inductor
5219 \pgfcircdeclarebipolescaled{inductors}
5220 {
5221 \savedanchor{\midtap}{%
5222 \pgf@x=0pt\relax
5223 \pgfmathsetlength{\pgf@y}{%
5224 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
5225 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
5226 0) %odd
5227 *\pgf@circ@scaled@Rlen/2
5228 }
5229 }
5230 \anchor{midtap}{\midtap}
5231 }
5232 {\ctikzvalof{bipoles/americaninductor/height 2}}
5233 {americaninductor}
5234 {\ctikzvalof{bipoles/americaninductor/height}}
5235 {\ctikzvalof{bipoles/americaninductor/width}}
5236 {
5237 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
5238 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5239 \pgftransformationadjustments
5240 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5241 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
5242 \divide \pgf@circ@res@step by 2
5243 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
5244
5245 \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
5246 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
5247 {
5248 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5249 }
5250 \pgfsetbuttcap
5251 \pgfsetbeveljoin
5252 \pgfusepath{stroke}
5253 }
5254
5255
5256 %% american inductive sensor
5257 \pgfcircdeclarebipolescaled{inductors}
5258 {% anchor for labelling the type of dependency
5259 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
5260 \savedanchor{\midtap}{%
5261 \pgf@x=0pt\relax
5262 \pgfmathsetlength{\pgf@y}{%
5263 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
5264 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
5265 0) %odd
5266 *\pgf@circ@scaled@Rlen/2
5267 }
5268 }
5269 \anchor{midtap}{\midtap}
5270 }
5271 {\ctikzvalof{bipoles/americaninductor/height 2}}
5272 {samericaninductor}
5273 {\ctikzvalof{bipoles/americaninductor/height}}
5274 {\ctikzvalof{bipoles/americaninductor/width}}
5275 {
5276 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
5277 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5278 \pgftransformationadjustments
5279 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5280 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
5281 \divide \pgf@circ@res@step by 2
5282 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
5283
5284 \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
5285 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
5286 {
5287 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5288 }
5289 \pgfsetbuttcap
5290 \pgfsetbeveljoin
5291 \pgfusepath{stroke}
5292 \pgfscope
5293 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
5294 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5295 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5296 \pgfusepath{draw}
5297 \endpgfscope
5298 }
5299
5300 %% variable american inductor
5301 \pgfcircdeclarebipolescaled{inductors}
5302 {
5303 \savedanchor{\midtap}{%
5304 \pgf@x=0pt\relax
5305 \pgfmathsetlength{\pgf@y}{%
5306 (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
5307 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
5308 0) %odd
5309 *\pgf@circ@scaled@Rlen/2
5310 }
5311 }
5312 \anchor{midtap}{\midtap}
5313 }
5314 {\ctikzvalof{bipoles/vamericaninductor/height 2}}
5315 {vamericaninductor}
5316 {\ctikzvalof{bipoles/vamericaninductor/height}}
5317 {\ctikzvalof{bipoles/vamericaninductor/width}}
5318 {
5319 \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen
5320 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5321 \pgftransformationadjustments
5322 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5323 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
5324 \divide \pgf@circ@res@step by 2
5325 \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen
5326
5327 \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
5328 \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
5329 {
5330 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5331 }
5332 \pgfsetbuttcap
5333 \pgfsetbeveljoin
5334 \pgfusepath{stroke}
5335
5336 \pgfscope
5337 \pgfsetarrowsend{latexslim}
5338 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
5339 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
5340 \pgfusepath{draw}
5341 \endpgfscope
5342 }
5343
5344 %% Generic bipole, filled - used as inductor by some
5345 \pgfcircdeclarebipolescaled{inductors}
5346 {
5347 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5348 }
5349 {\ctikzvalof{bipoles/fullgeneric/height}}
5350 {fullgeneric}
5351 {\ctikzvalof{bipoles/fullgeneric/height}}
5352 {\ctikzvalof{bipoles/fullgeneric/width}}
5353 {
5354 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5355 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5356
5357 \pgfusepath{draw,fill}
5358 }
5359
5360 %% Generic sensor, filled - used as inductive sensor by some
5361 \pgfcircdeclarebipolescaled{inductors}
5362 {% anchor for labelling the type of dependency
5363 \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
5364 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5365 }
5366 {\ctikzvalof{bipoles/fullgeneric/height}}
5367 {sfullgeneric}
5368 {\ctikzvalof{bipoles/fullgeneric/height}}
5369 {\ctikzvalof{bipoles/fullgeneric/width}}
5370 {
5371
5372 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5373 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5374 \pgfusepath{draw,fill}
5375 %\pgfscope
5376 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
5377 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
5378 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
5379 \pgfusepath{draw}
5380 %\endpgfscope
5381 }
5382
5383 %% Generic full tunable
5384 \pgfcircdeclarebipolescaled{inductors}
5385 {
5386 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5387 }
5388 {\ctikzvalof{bipoles/tfullgeneric/height}}
5389 {tfullgeneric}
5390 {\ctikzvalof{bipoles/tfullgeneric/height}}
5391 {\ctikzvalof{bipoles/tfullgeneric/width}}
5392 {
5393 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
5394 \divide \pgf@circ@res@step by 14
5395
5396 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
5397 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5398 \pgfusepath{draw,fill}
5399
5400 \pgfscope
5401 \pgfsetarrowsend{latexslim}
5402 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
5403 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
5404 \pgfusepath{draw}
5405 \endpgfscope
5406 }
5407
5408 %%%%%%%%%%%
5409 %% Battery
5410 %%%%%%%%%%%
5411
5412 %% Battery
5413 \pgfcircdeclarebipolescaled{batteries}
5414 {}
5415 {\ctikzvalof{bipoles/battery/height}}
5416 {battery}
5417 {\ctikzvalof{bipoles/battery/height}}
5418 {\ctikzvalof{bipoles/battery/width}}
5419 {
5420 \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen
5421 \divide \pgf@circ@res@step by 6
5422
5423 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5424
5425 \ifpgf@circ@fixbatteries
5426 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5427 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5428
5429 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
5430 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
5431
5432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
5433 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
5434
5435 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5436 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5437 \else
5438 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5439 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5440
5441 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
5442 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
5443
5444 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5445 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5446
5447 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5448 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5449 \fi
5450 \pgfusepath{draw}
5451 }
5452
5453
5454 %% Battery 1 % poles with equl thickness
5455
5456 \pgfcircdeclarebipolescaled{batteries}
5457 {}
5458 {\ctikzvalof{bipoles/battery1/height}}
5459 {battery1}
5460 {\ctikzvalof{bipoles/battery1/height}}
5461 {\ctikzvalof{bipoles/battery1/width}}
5462 {
5463 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
5464 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5465 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
5466 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5467 \pgfusepath{draw}
5468
5469 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5470 \ifpgf@circ@fixbatteries
5471 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
5472 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
5473
5474 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5475 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5476 \else
5477 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5478 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5479
5480 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
5481 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
5482 \fi
5483 \pgfusepath{draw}
5484 }
5485
5486 %% Battery 2 % negative pole thicker
5487
5488 \pgfcircdeclarebipolescaled{batteries}
5489 {}
5490 {\ctikzvalof{bipoles/battery2/height}}
5491 {battery2}
5492 {\ctikzvalof{bipoles/battery2/height}}
5493 {\ctikzvalof{bipoles/battery2/width}}
5494 {
5495 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
5496 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5497 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
5498 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5499 \pgfusepath{draw}
5500
5501 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5502 \ifpgf@circ@fixbatteries
5503 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
5504 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
5505 \pgfusepath{draw}
5506 \pgfsetlinewidth{3\pgflinewidth}
5507 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5508 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5509 \else
5510 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
5511 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
5512 \pgfusepath{draw}
5513 \pgfsetlinewidth{3\pgflinewidth}
5514 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5515 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5516 \fi
5517 \pgfusepath{draw}
5518 }
5519
5520 %%%%%%%%%%%
5521 %% Round and diamond sources
5522 %%%%%%%%%%%
5523
5524 %% Independent voltage source
5525 \pgfcircdeclarebipolescaled{sources}
5526 {}
5527 {\ctikzvalof{bipoles/vsource/height}}
5528 {vsource}
5529 {\ctikzvalof{bipoles/vsource/height}}
5530 {\ctikzvalof{bipoles/vsource/width}}
5531 {
5532
5533 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5534
5535 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5536 \pgf@circ@draworfill
5537 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5538 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5539 \pgfusepath{draw}
5540 }
5541
5542 %% Independent voltage source - American style
5543 \pgfcircdeclarebipolescaled{sources}
5544 {}
5545 {\ctikzvalof{bipoles/vsourceam/height}}
5546 {vsourceAM}
5547 {\ctikzvalof{bipoles/vsourceam/height}}
5548 {\ctikzvalof{bipoles/vsourceam/width}}
5549 {
5550
5551 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5552 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5553 \pgf@circ@draworfill
5554 \pgfsetcolor{\ctikzvalof{color}}
5555 \ifpgf@circ@oldvoltagedirection
5556 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
5557 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
5558 \else
5559 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
5560 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
5561 \fi
5562 }
5563
5564 %% Independent sinusoidal voltage source
5565 \pgfcircdeclarebipolescaled{sources}
5566 {}
5567 {\ctikzvalof{bipoles/vsourcesin/height}}
5568 {vsourcesin}
5569 {\ctikzvalof{bipoles/vsourcesin/height}}
5570 {\ctikzvalof{bipoles/vsourcesin/width}}
5571 {
5572
5573 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5574 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5575 \pgf@circ@draworfill
5576
5577 \pgf@circ@res@up = .5\pgf@circ@res@up
5578 \pgfscope
5579 \pgftransformrotate{90}
5580 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5581 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5582 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5583 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5584 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5585 \pgfusepath{draw}
5586 \endpgfscope
5587 }
5588
5589 % Square Voltage source - contributed by Alistair Kwan
5590 \pgfcircdeclarebipolescaled{sources}
5591 {}
5592 {\ctikzvalof{bipoles/vsourcesquare/height}}
5593 {vsourcesquare}
5594 {\ctikzvalof{bipoles/vsourcesquare/height}}
5595 {\ctikzvalof{bipoles/vsourcesquare/width}}
5596 {
5597 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5598 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5599 \pgf@circ@draworfill
5600 \pgf@circ@res@up = .5\pgf@circ@res@up
5601 \pgfscope
5602 \pgftransformrotate{90}
5603 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5604 \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
5605 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
5606 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5607 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5608 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5609 \pgfusepath{draw}
5610 \endpgfscope
5611 }
5612
5613 % Triangle Voltage source - contributed by Ralf Farkas
5614 \pgfcircdeclarebipolescaled{sources}
5615 {}
5616 {\ctikzvalof{bipoles/vsourcetri/height}}
5617 {vsourcetri}
5618 {\ctikzvalof{bipoles/vsourcetri/height}}
5619 {\ctikzvalof{bipoles/vsourcetri/width}}
5620 {
5621
5622 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5623 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5624 \pgf@circ@draworfill
5625
5626 \pgf@circ@res@up = .5\pgf@circ@res@up
5627 \pgfscope
5628 \pgftransformrotate{90}
5629 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5630 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
5631 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
5632 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5633 \pgfusepath{draw}
5634 \endpgfscope
5635 }
5636
5637
5638 %% PV Source
5639 \pgfcircdeclarebipolescaled{sources}
5640 {}
5641 {\ctikzvalof{bipoles/pvsource/height}}
5642 {pvsource}
5643 {\ctikzvalof{bipoles/pvsource/height}}
5644 {\ctikzvalof{bipoles/pvsource/width}}
5645 {
5646 \pgfpointorigin
5647 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5648 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5649 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5650 \pgf@circ@draworfill
5651
5652 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
5653 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5654 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
5655 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5656 \pgfusepath{draw}
5657
5658 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5659 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
5660 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
5661
5662 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
5663 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
5664 \pgfusepath{draw}
5665
5666 %Arrow Part
5667 \pgfscope
5668 \pgfsetarrowsend{latex}
5669 \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5670 \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5671 \pgfusepath{draw}
5672 \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5673 \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5674 \pgfusepath{draw}
5675 \endpgfscope
5676
5677 }
5678
5679 %% Empty Source
5680 \pgfcircdeclarebipolescaled{sources}
5681 {}
5682 {\ctikzvalof{bipoles/esource/height}}
5683 {esource}
5684 {\ctikzvalof{bipoles/esource/height}}
5685 {\ctikzvalof{bipoles/esource/width}}
5686 {
5687 \pgfpointorigin
5688 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5689 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5690 \pgf@circ@draworfill
5691 }
5692
5693 %% DC Current Source with open shape
5694 \pgfcircdeclarebipolescaled{sources}
5695 {}
5696 {\ctikzvalof{bipoles/dcisource/height}}
5697 {dcisource}
5698 {\ctikzvalof{bipoles/dcisource/height}}
5699 {\ctikzvalof{bipoles/dcisource/width}}
5700 {
5701 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5702 \pgfpathmoveto{\pgfpointorigin}
5703 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5704 \pgf@circ@maybefill
5705 \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
5706 \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
5707 \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
5708 \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
5709 \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
5710 \pgfusepath{draw}
5711
5712 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5713 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5714 \pgfusepath{draw}
5715 \pgfscope
5716 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5717 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5718 \endpgfscope
5719 }
5720
5721 %% DC-Voltage source
5722 \pgfcircdeclarebipolescaled{sources}
5723 {}
5724 {\ctikzvalof{bipoles/dcvsource/height}}
5725 {dcvsource}
5726 {\ctikzvalof{bipoles/dcvsource/height}}
5727 {\ctikzvalof{bipoles/dcvsource/width}}
5728 {
5729 \pgfpointorigin
5730 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5731 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5732 \pgf@circ@draworfill
5733 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
5734 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
5735 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
5736 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
5737 \pgfusepath{draw}
5738 }
5739
5740 %% Independent current source
5741 \pgfcircdeclarebipolescaled{sources}
5742 {}
5743 {\ctikzvalof{bipoles/isource/height}}
5744 {isource}
5745 {\ctikzvalof{bipoles/isource/height}}
5746 {\ctikzvalof{bipoles/isource/width}}
5747 {
5748 \pgfpointorigin
5749 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5750 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5751 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5752 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5753 \pgf@circ@draworfill
5754 }
5755
5756 %% Independent double oo source
5757 \pgfcircdeclarebipolescaled{sources}
5758 {}
5759 {\ctikzvalof{bipoles/oosource/height}}
5760 {oosource}
5761 {\ctikzvalof{bipoles/oosource/height}}
5762 {\ctikzvalof{bipoles/oosource/width}}
5763 {
5764 \pgfpointorigin
5765 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5766 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5767 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5768 \pgf@circ@maybefill
5769 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
5770 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
5771 \pgf@circ@draworfill
5772 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5773 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5774 \pgfusepath{draw}
5775 }
5776
5777 %% Independent current source - American
5778 \pgfcircdeclarebipolescaled{sources}
5779 {}
5780 {\ctikzvalof{bipoles/isourceam/height}}
5781 {isourceAM}
5782 {\ctikzvalof{bipoles/isourceam/height}}
5783 {\ctikzvalof{bipoles/isourceam/width}}
5784 {
5785 \pgfpointorigin
5786 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5787 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5788 \pgf@circ@draworfill
5789
5790 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5791 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5792 \pgfusepath{draw}
5793 \pgfscope
5794 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5795 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5796 \endpgfscope
5797 }
5798
5799 %% Independent sinusoidal current source
5800 \pgfcircdeclarebipolescaled{sources}
5801 {}
5802 {\ctikzvalof{bipoles/isource/height}}
5803 {isourcesin}
5804 {\ctikzvalof{bipoles/isource/height}}
5805 {\ctikzvalof{bipoles/isource/width}}
5806 {
5807 \pgfpointorigin
5808 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5809 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5810 \pgf@circ@draworfill
5811
5812 \pgf@circ@res@up = .5\pgf@circ@res@up
5813 \pgfscope
5814 \pgftransformrotate{90}
5815 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5816 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5817 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5818 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5819 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5820 \pgfusepath{draw}
5821 \endpgfscope
5822 }
5823
5824 %% Empty controlled source
5825 \pgfcircdeclarebipolescaled{csources}
5826 {}
5827 {\ctikzvalof{bipoles/ecsource/height}}
5828 {ecsource}
5829 {\ctikzvalof{bipoles/ecsource/height}}
5830 {\ctikzvalof{bipoles/ecsource/width}}
5831 {
5832
5833 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5834
5835 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5836 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5837 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5838 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5839 \pgfpathclose
5840 \pgf@circ@draworfill
5841 }
5842
5843 %% Controlled voltage source
5844 \pgfcircdeclarebipolescaled{csources}
5845 {}
5846 {\ctikzvalof{bipoles/cvsource/height}}
5847 {cvsource}
5848 {\ctikzvalof{bipoles/cvsource/height}}
5849 {\ctikzvalof{bipoles/cvsource/width}}
5850 {
5851
5852 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5853
5854 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5855 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5856 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5857 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5858 \pgfpathclose
5859 \pgf@circ@draworfill
5860
5861 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5862 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5863 \pgfusepath{draw}
5864 }
5865
5866 %% Controlled voltage source - American
5867 \pgfcircdeclarebipolescaled{csources}
5868 {}
5869 {\ctikzvalof{bipoles/cvsourceam/height}}
5870 {cvsourceAM}
5871 {\ctikzvalof{bipoles/cvsourceam/height}}
5872 {\ctikzvalof{bipoles/cvsourceam/width}}
5873 {
5874 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5875 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5876 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5877 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5878 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5879 \pgfpathclose
5880 \pgf@circ@draworfill
5881
5882 \pgfsetcolor{\ctikzvalof{color}}
5883 \ifpgf@circ@oldvoltagedirection
5884 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
5885 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
5886 \else
5887 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
5888 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
5889 \fi
5890 }
5891
5892 %% Controlled sinusoidal voltage source
5893 \pgfcircdeclarebipolescaled{csources}
5894 {}
5895 {\ctikzvalof{bipoles/cvsourcesin/height}}
5896 {cvsourcesin}
5897 {\ctikzvalof{bipoles/cvsourcesin/height}}
5898 {\ctikzvalof{bipoles/cvsourcesin/width}}
5899 {
5900
5901 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5902
5903 \pgfscope
5904 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5905 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5906 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5907 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5908 \pgfpathclose
5909 \pgf@circ@draworfill
5910 \endpgfscope
5911
5912 \pgf@circ@res@up = .5\pgf@circ@res@up
5913 \pgfscope
5914 \pgftransformrotate{90}
5915 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5916 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5917 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5918 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5919 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5920 \pgfusepath{draw}
5921 \endpgfscope
5922 }
5923
5924 %% Controlled sinusoidal current source
5925 \pgfcircdeclarebipolescaled{csources}
5926 {}
5927 {\ctikzvalof{bipoles/cvsourcesin/height}}
5928 {cisourcesin}
5929 {\ctikzvalof{bipoles/cvsourcesin/height}}
5930 {\ctikzvalof{bipoles/cvsourcesin/width}}
5931 {
5932
5933 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5934
5935 \pgfscope
5936 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5937 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5938 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5939 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5940 \pgfpathclose
5941 \pgf@circ@draworfill
5942 \endpgfscope
5943
5944 \pgf@circ@res@up = .5\pgf@circ@res@up
5945 \pgfscope
5946 \pgftransformrotate{90}
5947 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5948 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5949 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5950 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5951 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5952 \pgfusepath{draw}
5953 \endpgfscope
5954 }
5955
5956 %% Controlled current source
5957 \pgfcircdeclarebipolescaled{csources}
5958 {}
5959 {\ctikzvalof{bipoles/cisource/height}}
5960 {cisource}
5961 {\ctikzvalof{bipoles/cisource/height}}
5962 {\ctikzvalof{bipoles/cisource/width}}
5963 {
5964
5965 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5966
5967 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5968 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5969 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5970 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5971 \pgfpathclose
5972 \pgf@circ@draworfill
5973
5974 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5975 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5976 \pgfusepath{draw}
5977 }
5978
5979 %% Controlled current source - American
5980 \pgfcircdeclarebipolescaled{csources}
5981 {}
5982 {\ctikzvalof{bipoles/cisourceam/height}}
5983 {cisourceAM}
5984 {\ctikzvalof{bipoles/cisourceam/height}}
5985 {\ctikzvalof{bipoles/cisourceam/width}}
5986 {
5987 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5988
5989 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5990 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5991 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5992 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5993 \pgfpathclose
5994 \pgf@circ@draworfill
5995 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5996 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5997 \pgfusepath{draw}
5998 \pgfscope
5999 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
6000 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
6001 \endpgfscope
6002 }
6003
6004 %% Cute Independent voltage source
6005 \pgfcircdeclarebipolescaled{sources}
6006 {}
6007 {\ctikzvalof{bipoles/vsource/height}}
6008 {vsourceC}
6009 {\ctikzvalof{bipoles/vsource/height}}
6010 {\ctikzvalof{bipoles/vsource/width}}
6011 {
6012 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6013 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6014 \pgf@circ@draworfill
6015 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6016 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6017 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
6018 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
6019 \pgfsetroundcap\pgfusepath{draw}
6020 }
6021
6022 %% Cute Independent current source
6023 \pgfcircdeclarebipolescaled{sources}
6024 {}
6025 {\ctikzvalof{bipoles/isource/height}}
6026 {isourceC}
6027 {\ctikzvalof{bipoles/isource/height}}
6028 {\ctikzvalof{bipoles/isource/width}}
6029 {
6030 \pgfpointorigin
6031 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6032 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6033 \pgf@circ@draworfill
6034 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6035 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6036 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
6037 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
6038 \pgfsetroundcap\pgfusepath{draw}
6039 }
6040
6041 %% Cute Controlled voltage source
6042 \pgfcircdeclarebipolescaled{csources}
6043 {}
6044 {\ctikzvalof{bipoles/cvsource/height}}
6045 {cvsourceC}
6046 {\ctikzvalof{bipoles/cvsource/height}}
6047 {\ctikzvalof{bipoles/cvsource/width}}
6048 {
6049 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6050 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6051 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
6052 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
6053 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
6054 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6055 \pgf@circ@draworfill
6056 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6057 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6058 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
6059 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
6060 \pgfsetroundcap\pgfusepath{draw}
6061 }
6062
6063 %% Cute Controlled current source
6064 \pgfcircdeclarebipolescaled{csources}
6065 {}
6066 {\ctikzvalof{bipoles/cisource/height}}
6067 {cisourceC}
6068 {\ctikzvalof{bipoles/cisource/height}}
6069 {\ctikzvalof{bipoles/cisource/width}}
6070 {
6071 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6072 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6073 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
6074 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
6075 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
6076 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6077 \pgf@circ@draworfill
6078 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6079 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6080 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
6081 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
6082 \pgfsetroundcap\pgfusepath{draw}
6083 }
6084
6085 %% Noise voltage source
6086 \pgfcircdeclarebipolescaled{sources}
6087 {}
6088 {\ctikzvalof{bipoles/vsource/height}}
6089 {vsourceN}
6090 {\ctikzvalof{bipoles/vsource/height}}
6091 {\ctikzvalof{bipoles/vsource/width}}
6092 {
6093 \pgfscope
6094 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6095 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6096 %
6097 \pgf@circ@scaled@Rlen=\scaledRlen
6098 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
6099 \edef\pgf@noise@temp{dashed}
6100 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
6101 \ifx\pgf@noise@temp\pgf@noise@fill
6102 % fillable in this case
6103 \pgf@circ@draworfillandclip
6104 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
6105 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
6106 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6107 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6108 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6109 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6110 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6111 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6112 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6113 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6114 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6115 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6116 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6117 %
6118 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
6119 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6120 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6121 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
6122 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6123 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6124 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
6125 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6126 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6127 \pgfusepath{draw}
6128 \else
6129 \pgfsetfillcolor{\pgf@noise@fill}
6130 \pgfusepath{draw,fill}
6131 \fi
6132 \endpgfscope
6133 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6134 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6135 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
6136 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
6137 \pgfsetroundcap\pgfusepath{draw}
6138 }
6139 %% Noise current source
6140
6141 \pgfcircdeclarebipolescaled{sources}
6142 {}
6143 {\ctikzvalof{bipoles/isource/height}}
6144 {isourceN}
6145 {\ctikzvalof{bipoles/isource/height}}
6146 {\ctikzvalof{bipoles/isource/width}}
6147 {
6148 \pgfpointorigin
6149 \pgfscope
6150 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6151 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6152 %
6153 \pgf@circ@scaled@Rlen=\scaledRlen
6154 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
6155 \edef\pgf@noise@temp{dashed}
6156 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
6157 \ifx\pgf@noise@temp\pgf@noise@fill
6158 % fillable in this case
6159 \pgf@circ@draworfillandclip
6160 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
6161 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
6162 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6163 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6164 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6165 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6166 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6167 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6168 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6169 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6170 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
6171 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6172 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6173 %
6174 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
6175 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6176 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6177 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
6178 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6179 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6180 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
6181 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6182 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6183 \pgfusepath{draw}
6184 \else
6185 \pgfsetfillcolor{\pgf@noise@fill}
6186 \pgfusepath{draw,fill}
6187 \fi
6188 \endpgfscope
6189 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
6190 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
6191 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
6192 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
6193 \pgfsetroundcap\pgfusepath{draw}
6194 }
6195
6196 %%%%%%%%%%%%%%
6197 %% Diodes
6198 %%%%%%%%%%%%%%
6199
6200 %% Black generic diode
6201 \pgfcircdeclarebipolescaled{diodes}
6202 {}
6203 {\ctikzvalof{bipoles/diode/height}}
6204 {fulldiode}
6205 {\ctikzvalof{bipoles/diode/height}}
6206 {\ctikzvalof{bipoles/diode/width}}
6207 {
6208
6209 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6210
6211 \pgfscope
6212 \pgftransformxshift{\pgf@circ@res@left}
6213 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6214 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6215 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6216 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6217 \pgfusepath{draw,fill}
6218 \endpgfscope
6219 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6220 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6221 \pgfusepath{draw}
6222 }
6223
6224 %% Black Zener diode
6225 \pgfcircdeclarebipolescaled{diodes}
6226 {}
6227 {\ctikzvalof{bipoles/diode/height}}
6228 {fullzdiode}
6229 {\ctikzvalof{bipoles/diode/height}}
6230 {\ctikzvalof{bipoles/diode/width}}
6231 {
6232
6233 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6234
6235 \pgfscope
6236 \pgftransformxshift{\pgf@circ@res@left}
6237 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6238 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6239 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6240 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6241 \pgfusepath{draw,fill}
6242 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6243 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6244 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6245 \pgfusepath{draw}
6246 \endpgfscope
6247 }
6248
6249 %% Black alternative zigzag Zener diode
6250 \pgfcircdeclarebipolescaled{diodes}
6251 {}
6252 {\ctikzvalof{bipoles/diode/height}}
6253 {fullzzdiode}
6254 {\ctikzvalof{bipoles/diode/height}}
6255 {\ctikzvalof{bipoles/diode/width}}
6256 {
6257
6258 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6259
6260 \pgfscope
6261 \pgftransformxshift{\pgf@circ@res@left}
6262 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6263 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6264 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6265 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6266 \pgfusepath{draw,fill}
6267 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
6268 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6269 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6270 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
6271 \pgfusepath{draw}
6272 \endpgfscope
6273 }
6274
6275 %% Black Schottky diode
6276 \pgfcircdeclarebipolescaled{diodes}
6277 {}
6278 {\ctikzvalof{bipoles/diode/height}}
6279 {fullsdiode}
6280 {\ctikzvalof{bipoles/diode/height}}
6281 {\ctikzvalof{bipoles/diode/width}}
6282 {
6283
6284 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6285 \pgfscope
6286 \pgftransformxshift{\pgf@circ@res@left}
6287 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6288 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6289 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6290 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6291 \pgfusepath{draw,fill}
6292
6293 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
6294 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6295 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6296 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6297 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6298 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6299 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
6300 \pgfusepath{draw}
6301 \endpgfscope
6302
6303 }
6304
6305 %% Black tunnel diode
6306 \pgfcircdeclarebipolescaled{diodes}
6307 {}
6308 {\ctikzvalof{bipoles/diode/height}}
6309 {fulltdiode}
6310 {\ctikzvalof{bipoles/diode/height}}
6311 {\ctikzvalof{bipoles/diode/width}}
6312 {
6313
6314 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6315 \pgfscope
6316 \pgftransformxshift{\pgf@circ@res@left}
6317 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6318 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6319 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6320 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6321 \pgfusepath{draw,fill}
6322
6323 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6324 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6325 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6326 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6327 \pgfusepath{draw}
6328 \endpgfscope
6329 }
6330
6331 %% Black light emitting diode
6332 \pgfcircdeclarebipolescaled{diodes}
6333 {}
6334 {\ctikzvalof{bipoles/diode/height}}
6335 {fulllediode}
6336 {\ctikzvalof{bipoles/diode/height}}
6337 {\ctikzvalof{bipoles/diode/width}}
6338 {
6339
6340 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6341 \pgfscope
6342 \pgftransformxshift{\pgf@circ@res@left}
6343 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6344 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6345 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6346 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6347 \pgfusepath{draw,fill}
6348 \endpgfscope
6349 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6350 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6351 \pgfusepath{draw}
6352
6353 \pgfsetlinewidth{\pgfstartlinewidth}
6354 \pgfsetarrowsend{latexslim}
6355 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6356 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6357 \pgfusepath{draw}
6358 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6359 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6360 \pgfusepath{draw}
6361
6362 }
6363
6364 %% Black photodiode
6365 \pgfcircdeclarebipolescaled{diodes}
6366 {}
6367 {\ctikzvalof{bipoles/diode/height}}
6368 {fullpdiode}
6369 {\ctikzvalof{bipoles/diode/height}}
6370 {\ctikzvalof{bipoles/diode/width}}
6371 {
6372
6373 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6374 \pgfscope
6375 \pgftransformxshift{\pgf@circ@res@left}
6376 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6377 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6378 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6379 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6380 \pgfusepath{draw,fill}
6381 \endpgfscope
6382 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6383 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6384 \pgfusepath{draw}
6385
6386 \pgfsetlinewidth{\pgfstartlinewidth}
6387 \pgfsetarrowsstart{latexslim}
6388 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6389 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6390 \pgfusepath{draw}
6391 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6392 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6393 \pgfusepath{draw}
6394 }
6395
6396 %% Black varcap
6397 \pgfcircdeclarebipolescaled{diodes}
6398 {}
6399 {\ctikzvalof{bipoles/varcap/height}}
6400 {fullvarcap}
6401 {\ctikzvalof{bipoles/varcap/height}}
6402 {\ctikzvalof{bipoles/varcap/width}}
6403 {
6404 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
6405 \pgfsetlinewidth{\pgf@circ@res@temp}
6406 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6407 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6408 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6409 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6410 \pgfusepath{draw,fill}
6411 %
6412 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
6413 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
6414 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6415 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6416 \pgfusepath{draw}
6417 }
6418
6419 %% Code for the diode triangle
6420 \def\pgf@circ@basicdiodeshape{
6421 % \pgfscope
6422 \pgftransformxshift{\pgf@circ@res@left}
6423 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6424 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6425 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6426 \pgfpathclose
6427 \pgf@circ@draworfill
6428 \pgfscope
6429 % to allow filling, we need to draw explicitly the stroke here.
6430 \pgfsetlinewidth{\pgfstartlinewidth}
6431 \ifpgf@circuit@bipole@strokedsymbol
6432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6433 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
6434 \pgfusepath{draw}
6435 \fi
6436 \endpgfscope
6437 % \endpgfscope
6438 }
6439
6440 %% Empty generic diode
6441 \pgfcircdeclarebipolescaled{diodes}
6442 {}
6443 {\ctikzvalof{bipoles/diode/height}}
6444 {emptydiode}
6445 {\ctikzvalof{bipoles/diode/height}}
6446 {\ctikzvalof{bipoles/diode/width}}
6447 {
6448 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6449 \pgfscope
6450 \pgf@circ@basicdiodeshape
6451 \endpgfscope
6452 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6453 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6454 \pgfusepath{draw}
6455 }
6456
6457 %% Empty Zener diode
6458 \pgfcircdeclarebipolescaled{diodes}
6459 {}
6460 {\ctikzvalof{bipoles/diode/height}}
6461 {emptyzdiode}
6462 {\ctikzvalof{bipoles/diode/height}}
6463 {\ctikzvalof{bipoles/diode/width}}
6464 {
6465
6466 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6467
6468 \pgfscope
6469 \pgf@circ@basicdiodeshape
6470 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6471 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6472 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6473 \pgfusepath{draw}
6474 \endpgfscope
6475 }
6476
6477 %% Empty alternative zigzag Zener diode
6478 \pgfcircdeclarebipolescaled{diodes}
6479 {}
6480 {\ctikzvalof{bipoles/diode/height}}
6481 {emptyzzdiode}
6482 {\ctikzvalof{bipoles/diode/height}}
6483 {\ctikzvalof{bipoles/diode/width}}
6484 {
6485
6486 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6487
6488 \pgfscope
6489 \pgf@circ@basicdiodeshape
6490 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
6491 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6492 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6493 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
6494 \pgfusepath{draw}
6495 \endpgfscope
6496 }
6497 %% Empty Schottky diode
6498 \pgfcircdeclarebipolescaled{diodes}
6499 {}
6500 {\ctikzvalof{bipoles/diode/height}}
6501 {emptysdiode}
6502 {\ctikzvalof{bipoles/diode/height}}
6503 {\ctikzvalof{bipoles/diode/width}}
6504 {
6505
6506 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6507 \pgfscope
6508 \pgf@circ@basicdiodeshape
6509 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
6510 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6511 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6512 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6513 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6514 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6515 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
6516 \pgfusepath{draw}
6517 \endpgfscope
6518
6519 }
6520
6521 %% Empty tunnel diode
6522 \pgfcircdeclarebipolescaled{diodes}
6523 {}
6524 {\ctikzvalof{bipoles/diode/height}}
6525 {emptytdiode}
6526 {\ctikzvalof{bipoles/diode/height}}
6527 {\ctikzvalof{bipoles/diode/width}}
6528 {
6529
6530 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6531 \pgfscope
6532 \pgf@circ@basicdiodeshape
6533 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6534 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6535 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6536 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6537 \pgfusepath{draw}
6538 \endpgfscope
6539 }
6540
6541 %% Empty light emitting diode
6542 \pgfcircdeclarebipolescaled{diodes}
6543 {}
6544 {\ctikzvalof{bipoles/diode/height}}
6545 {emptylediode}
6546 {\ctikzvalof{bipoles/diode/height}}
6547 {\ctikzvalof{bipoles/diode/width}}
6548 {
6549
6550 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6551 \pgfscope
6552 \pgf@circ@basicdiodeshape
6553 \endpgfscope
6554 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6555 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6556 \pgfusepath{draw}
6557
6558 \pgfsetlinewidth{\pgfstartlinewidth}
6559 \pgfsetarrowsend{latexslim}
6560 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6561 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6562 \pgfusepath{draw}
6563 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6564 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6565 \pgfusepath{draw}
6566 }
6567
6568 %% Empty photodiode
6569 \pgfcircdeclarebipolescaled{diodes}
6570 {}
6571 {\ctikzvalof{bipoles/diode/height}}
6572 {emptypdiode}
6573 {\ctikzvalof{bipoles/diode/height}}
6574 {\ctikzvalof{bipoles/diode/width}}
6575 {
6576
6577 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6578 \pgfscope
6579 \pgf@circ@basicdiodeshape
6580 \endpgfscope
6581 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6582 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6583 \pgfusepath{draw}
6584
6585 \pgfsetlinewidth{\pgfstartlinewidth}
6586 \pgfsetarrowsstart{latexslim}
6587 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6588 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6589 \pgfusepath{draw}
6590 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6591 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6592 \pgfusepath{draw}
6593 }
6594
6595 %% Empty varcap
6596 \pgfcircdeclarebipolescaled{diodes}
6597 {}
6598 {\ctikzvalof{bipoles/varcap/height}}
6599 {emptyvarcap}
6600 {\ctikzvalof{bipoles/varcap/height}}
6601 {\ctikzvalof{bipoles/varcap/width}}
6602 {
6603 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
6604 \pgfsetlinewidth{\pgf@circ@res@temp}
6605 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6606 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6607 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6608 % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6609 \pgfpathclose
6610 \pgf@circ@draworfill
6611 \pgfscope
6612 % to allow filling, we need to draw explicitily the stroke here.
6613 \pgfsetlinewidth{\pgfstartlinewidth}
6614 \ifpgf@circuit@bipole@strokedsymbol
6615 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6616 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6617 \pgfusepath{draw}
6618 \fi
6619 \endpgfscope
6620 %
6621 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
6622 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
6623 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6624 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6625 \pgfusepath{draw}
6626 }
6627
6628 %% Empty bidirectionaldiode
6629 \pgfcircdeclarebipolescaled{diodes}
6630 {}
6631 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6632 {emptybidirectionaldiode}
6633 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6634 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6635 {
6636
6637 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6638
6639 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6640 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6641
6642 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6643 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6644 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6645 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6646
6647 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6648 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6649 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6650 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6651
6652 \pgf@circ@draworfill
6653
6654 \pgfsetlinewidth{\pgfstartlinewidth}
6655
6656 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6657 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6658
6659 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6660 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6661
6662 \pgfusepath{draw}
6663 }
6664
6665 %% Full bidirectionaldiode
6666 \pgfcircdeclarebipolescaled{diodes}
6667 {}
6668 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6669 {fullbidirectionaldiode}
6670 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6671 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6672 {
6673
6674 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6675
6676 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6677 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6678
6679 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6680 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6681 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6682 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6683
6684 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6685 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6686 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6687 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6688
6689 \pgfusepath{draw, fill}
6690
6691 \pgfsetlinewidth{\pgfstartlinewidth}
6692
6693 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6694 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6695
6696 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6697 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6698
6699 \pgfusepath{draw}
6700 }
6701
6702 %% Black thyristor
6703 \pgfcircdeclarebipolescaled{diodes}
6704 {
6705 \anchor{gate}{\northeast}
6706 \anchor{anode}{\southwest\pgf@y=0cm}
6707 \anchor{G}{\northeast}
6708 \anchor{cathode}{\northeast\pgf@y=0cm }
6709 }
6710 {\ctikzvalof{tripoles/thyristor/height 2}}
6711 {fullthyristor}
6712 {\ctikzvalof{tripoles/thyristor/height}}
6713 {\ctikzvalof{tripoles/thyristor/width}}
6714 {
6715
6716 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6717
6718 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6719 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6720
6721 \pgfscope
6722 \pgftransformxshift{\pgf@circ@res@other}
6723 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6724
6725 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6726 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6727 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6728 \pgfusepath{draw,fill}
6729
6730 \pgfsetlinewidth{\pgfstartlinewidth}
6731
6732 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6733 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6734 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6735 \pgfusepath{draw}
6736 \endpgfscope
6737
6738 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6739 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6740
6741 \pgfusepath{draw}
6742
6743 \pgfsetlinewidth{\pgfstartlinewidth}
6744
6745 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6746 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6747
6748 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6749 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6750
6751 \pgfusepath{draw}
6752
6753 }
6754
6755 %% Empty thyristor
6756
6757 \pgfcircdeclarebipolescaled{diodes}
6758 {
6759 \anchor{gate}{\northeast}
6760 \anchor{anode}{\southwest\pgf@y=0cm}
6761 \anchor{G}{\northeast}
6762 \anchor{cathode}{\northeast\pgf@y=0cm }
6763 }
6764 {\ctikzvalof{tripoles/thyristor/height 2}}
6765 {emptythyristor}
6766 {\ctikzvalof{tripoles/thyristor/height}}
6767 {\ctikzvalof{tripoles/thyristor/width}}
6768 {
6769
6770 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6771
6772 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6773 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6774
6775 \pgfscope
6776 \pgftransformxshift{\pgf@circ@res@other}
6777 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6778
6779 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6780 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6781 \pgfpathclose
6782 \pgf@circ@draworfill
6783 \pgfscope
6784 % to allow filling, we need to draw explicitily the stroke here.
6785 \pgfsetlinewidth{\pgfstartlinewidth}
6786 \ifpgf@circuit@bipole@strokedsymbol
6787 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6788 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
6789 \pgfusepath{draw}
6790 \fi
6791 \endpgfscope
6792
6793 \pgfsetlinewidth{\pgfstartlinewidth}
6794
6795 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6796 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6797 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6798 \pgfusepath{draw}
6799 \endpgfscope
6800
6801 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6802 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6803
6804 \pgfusepath{draw}
6805
6806 \pgfsetlinewidth{\pgfstartlinewidth}
6807
6808 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6809 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6810
6811 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6812 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6813
6814 \pgfusepath{draw}
6815 }
6816
6817 %% Empty triac
6818 \pgfcircdeclarebipolescaled{diodes}
6819 {
6820 \anchor{gate}{\northeast}
6821 \anchor{anode}{\southwest\pgf@y=0cm}
6822 \anchor{G}{\northeast}
6823 \anchor{cathode}{\northeast\pgf@y=0cm }
6824 }
6825 {\ctikzvalof{tripoles/triac/height}}
6826 {emptytriac}
6827 {\ctikzvalof{tripoles/triac/height}}
6828 {\ctikzvalof{tripoles/triac/width}}
6829 {
6830
6831 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6832
6833 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6834 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6835
6836 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6837 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6838 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6839 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6840
6841 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6842 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6843 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6844 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6845
6846 \pgf@circ@draworfill
6847
6848 \pgfsetlinewidth{\pgfstartlinewidth}
6849
6850 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6851 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6852 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6853
6854 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6855 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6856
6857 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6858 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6859
6860 \pgfusepath{draw}
6861 }
6862
6863 %% Full triac
6864 \pgfcircdeclarebipolescaled{diodes}
6865 {
6866 \anchor{gate}{\northeast}
6867 \anchor{anode}{\southwest\pgf@y=0cm}
6868 \anchor{G}{\northeast}
6869 \anchor{cathode}{\northeast\pgf@y=0cm }
6870 }
6871 {\ctikzvalof{tripoles/triac/height}}
6872 {fulltriac}
6873 {\ctikzvalof{tripoles/triac/height}}
6874 {\ctikzvalof{tripoles/triac/width}}
6875 {
6876 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6877
6878 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6879 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6880
6881 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6882 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6883 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6884 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6885
6886 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6887 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6888 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6889 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6890
6891 \pgfusepath{draw,fill}
6892
6893 \pgfsetlinewidth{\pgfstartlinewidth}
6894
6895 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6896 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6897 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6898
6899 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6900 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6901
6902 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6903 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6904
6905 \pgfusepath{draw}
6906 }
6907
6908 %%%%%%%%%%%%%
6909 %% switches
6910 %%%%%%%%%%%%%
6911
6912 %% (Closing) SPST
6913 \pgfcircdeclarebipolescaled{switches}
6914 {}
6915 {\ctikzvalof{bipoles/spst/depth}}
6916 {cspst}
6917 {\ctikzvalof{bipoles/spst/height}}
6918 {\ctikzvalof{bipoles/spst/width}}
6919 {
6920 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6921 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6922 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6923 \pgfusepath{draw}
6924
6925 \pgfscope
6926 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6927 \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
6928 \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
6929 \pgfsetarrowsend{latexslim}
6930 \pgfsetbeveljoin
6931 \pgfusepath{draw}
6932 \endpgfscope
6933 }
6934
6935 %% Opening SPST
6936 \pgfcircdeclarebipolescaled{switches}
6937 {}
6938 {\ctikzvalof{bipoles/spst/depth}}
6939 {ospst}
6940 {\ctikzvalof{bipoles/spst/height}}
6941 {\ctikzvalof{bipoles/spst/width}}
6942 {
6943
6944 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6945 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6946 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6947 \pgfusepath{draw}
6948
6949 \pgfscope
6950 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6951 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
6952 \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
6953 \pgfsetarrowsend{latexslim}
6954 \pgfsetbeveljoin
6955 \pgfusepath{draw}
6956 \endpgfscope
6957 }
6958
6959 %% Normal open Switch
6960 \pgfcircdeclarebipolescaled{switches}
6961 {}
6962 {\ctikzvalof{bipoles/nos/depth}}
6963 {nos}
6964 {\ctikzvalof{bipoles/nos/height}}
6965 {\ctikzvalof{bipoles/nos/width}}
6966 {
6967
6968 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6969 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6970 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6971 \pgfsetbuttcap
6972 \pgfusepath{draw}
6973 }
6974
6975 %% Normal closed Switch
6976 \pgfcircdeclarebipolescaled{switches}
6977 {}
6978 {\ctikzvalof{bipoles/ncs/depth}}
6979 {ncs}
6980 {\ctikzvalof{bipoles/ncs/height}}
6981 {\ctikzvalof{bipoles/ncs/width}}
6982 {
6983 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6984 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6985 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6986 \pgfusepath{draw}
6987 \pgfsetlinewidth{\pgfstartlinewidth}
6988 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6989 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
6990 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
6991 \pgfusepath{draw}
6992 }
6993
6994 %% Push Button
6995 \pgfcircdeclarebipolescaled{switches}
6996 {}
6997 {\ctikzvalof{bipoles/pushbutton/height 2}}
6998 {pushbutton}
6999 {\ctikzvalof{bipoles/pushbutton/height}}
7000 {\ctikzvalof{bipoles/pushbutton/width}}
7001 {
7002 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7003 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
7004 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
7005 \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
7006 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
7007 \pgfusepath{draw}
7008
7009 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7010 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
7011 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
7012 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
7013 }
7014
7015 %% Normally closed Push Button
7016 \pgfcircdeclarebipolescaled{switches}
7017 {}
7018 {\ctikzvalof{bipoles/pushbutton/height 2}}
7019 {ncpushbutton}
7020 {\ctikzvalof{bipoles/pushbutton/height}}
7021 {\ctikzvalof{bipoles/pushbutton/width}}
7022 {
7023 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7024 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
7025 % Warning, if the nodes will have a class, we have to touch this.
7026 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
7027 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
7028 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
7029 \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
7030 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
7031 \pgfusepath{draw}
7032 %
7033 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7034 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
7035 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
7036 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
7037 }
7038 %%% reed switches
7039 \pgfcircdeclarebipolescaled{switches}
7040 {}
7041 {\ctikzvalof{bipoles/reed/depth}}
7042 {reed}
7043 {\ctikzvalof{bipoles/reed/height}}
7044 {\ctikzvalof{bipoles/reed/width}}
7045 {
7046 % this is designed to be the same as a "nos".
7047 \pgfmathsetmacro{\@@tmpx}{0.9*\ctikzvalof{bipoles/nos/width}/\ctikzvalof{bipoles/reed/width}}
7048 \pgfmathsetmacro{\@@tmpy}{\ctikzvalof{bipoles/nos/height}/\ctikzvalof{bipoles/reed/height}}
7049 \pgfscope
7050 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7051 % eclosure
7052 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}}
7053 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
7054 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{-\pgf@circ@res@up}}
7055 \pgfpatharc{270}{90}{\pgf@circ@res@up}
7056 \pgfpathclose
7057 \pgf@circ@draworfill
7058 % switch
7059 \pgfpathmoveto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
7060 \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{\@@tmpy\pgf@circ@res@up}}
7061 % connection lines
7062 \pgfsetbuttcap
7063 \pgfusepath{draw}
7064 \endpgfscope
7065 % connection lines
7066 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7067 \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}}
7068 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7069 \pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{0pt}}
7070 \pgfusepath{draw}
7071 }
7072
7073 % cute switch "to" shapes help function
7074 % #1 -> name
7075 % #2 -> barposition
7076 % #3 -> arrowcode
7077 \long\def\pgfcircdeclarecutesw#1#2#3{
7078 \pgfcircdeclarebipolescaled{switches}
7079 {
7080 \savedanchor\midlever{
7081 % these values are calculated when we create the definition of the shape.
7082 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
7083 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
7084 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
7085 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
7086 \pgf@circ@res@down = -.5\pgf@y
7087 \pgf@circ@res@up = .5\pgf@y
7088 \pgfextracty{\pgf@circ@res@other}{#2}
7089 \pgf@x=0pt
7090 \pgf@y=.5\pgf@circ@res@other
7091 }
7092 % radius of the connector
7093 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
7094 % If cnnecting nodes are scaled, we have to modify this
7095 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
7096 % shapename
7097 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
7098 % shape type
7099 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
7100 % mid of the lever, to stack switches
7101 \anchor{mid}{\midlever}
7102 \anchor{cout}{\northeast \pgf@y=0cm}
7103 \anchor{cin}{\southwest\pgf@y=0cm}
7104 \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
7105 \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
7106 }
7107 {\ctikzvalof{bipoles/cuteswitch/height 2}}
7108 {#1}
7109 {\ctikzvalof{bipoles/cuteswitch/height}}
7110 {\ctikzvalof{bipoles/cuteswitch/width}}{
7111 \pgfscope
7112 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
7113 % If cnnecting nodes are scaled, we have to modify this
7114 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
7115 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
7116 \pgfsetlinewidth{2\pgf@circ@res@temp}
7117 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7118 \pgfpathlineto{#2}
7119 \pgfsetroundcap\pgfusepath{draw}
7120 \endpgfscope
7121 \pgfscope % arrow
7122 #3
7123 \endpgfscope
7124 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7125 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
7126 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
7127 \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
7128 }
7129 }
7130
7131 %% closed cute switch
7132 \pgfcircdeclarecutesw{cuteclosedswitch}
7133 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
7134 {}
7135
7136 %% open cute switch
7137 \pgfcircdeclarecutesw{cuteopenswitch}
7138 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7139 {}
7140
7141 %% closing cute switch
7142 \pgfcircdeclarecutesw{cuteclosingswitch}
7143 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7144 {
7145 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7146 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
7147 \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
7148 \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
7149 \pgfsetarrowsend{latexslim}
7150 \pgfusepath{draw}
7151 }
7152
7153 %% opening cute switch
7154 \pgfcircdeclarecutesw{cuteopeningswitch}
7155 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
7156 {
7157 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7158 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
7159 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
7160 \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
7161 \pgfsetarrowsend{latexslim}
7162 \pgfusepath{draw}
7163 }
7164
7165 %%%%%%%%%%%%%%%%%
7166 %% Instruments
7167 %%%%%%%%%%%%%%%%%
7168
7169 % % METERINGSHAPE
7170 \long\def\drawmeteringcircle{
7171 \def\pgf@circ@temp{right}
7172 \ifx\tikz@res@label@pos\pgf@circ@temp
7173 \pgf@circ@res@step=-1.2\pgf@circ@res@up
7174 \else
7175 \def\pgf@circ@temp{below}
7176 \ifx\tikz@res@label@pos\pgf@circ@temp
7177 \pgf@circ@res@step=-1.2\pgf@circ@res@up
7178 \else
7179 \pgf@circ@res@step=1.2\pgf@circ@res@up
7180 \fi
7181 \fi
7182 %draw connections to circle
7183 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7184 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
7185 \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
7186 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
7187 \pgfusepath{draw}
7188 %draw circle
7189 \pgfscope
7190 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7191 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
7192 \pgf@circ@draworfill
7193 \endpgfscope
7194 %draw arrow
7195 \pgfscope
7196 \pgfsetarrowsend{latex}
7197 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7198 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
7199 \pgfusepath{draw}
7200 \endpgfscope
7201 }
7202
7203 %AMPEREMETER
7204 \pgfcircdeclarebipolescaled{instruments}
7205 {}
7206 {\ctikzvalof{bipoles/ammeter/height}}
7207 {ammeter}
7208 {\ctikzvalof{bipoles/ammeter/height}}
7209 {\ctikzvalof{bipoles/ammeter/width}}
7210 {
7211 \drawmeteringcircle
7212 \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
7213 }
7214 %OHMMETER
7215 \pgfcircdeclarebipolescaled{instruments}
7216 {}
7217 {\ctikzvalof{bipoles/ohmmeter/height}}
7218 {ohmmeter}
7219 {\ctikzvalof{bipoles/ohmmeter/height}}
7220 {\ctikzvalof{bipoles/ohmmeter/width}}
7221 {
7222 \drawmeteringcircle
7223 \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
7224 }
7225 %VOLTMETER
7226 \pgfcircdeclarebipolescaled{instruments}
7227 {}
7228 {\ctikzvalof{bipoles/voltmeter/height}}
7229 {voltmeter}
7230 {\ctikzvalof{bipoles/voltmeter/height}}
7231 {\ctikzvalof{bipoles/voltmeter/width}}
7232 {
7233 \drawmeteringcircle
7234 \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
7235
7236 }
7237
7238 % oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
7239 \pgfcircdeclarebipolescaled{instruments}
7240 {
7241 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
7242 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
7243 % put the node text above and centered
7244 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7245 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7246 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7247 }
7248 }
7249 }
7250 {\ctikzvalof{bipoles/oscope/height}}
7251 {oscope}
7252 {\ctikzvalof{bipoles/oscope/height}}
7253 {\ctikzvalof{bipoles/oscope/width}}
7254 {
7255 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7256 \pgfextracty{\pgf@circ@res@up}{\northeast}
7257 \pgfextractx{\pgf@circ@res@right}{\northeast}
7258 \pgfextractx{\pgf@circ@res@left}{\southwest}
7259 \pgfextracty{\pgf@circ@res@down}{\southwest}
7260 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7261 \pgfscope
7262 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7263 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7264 % this would create a round (analog?) scope...
7265 % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7266 \pgf@circ@draworfill
7267 \endpgfscope
7268 % get the rotation
7269 \ifpgf@circuit@straightinstruments
7270 \pgfgettransformentries\a\b\temp\temp\temp\temp
7271 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7272 \else
7273 \edef\rot{0}
7274 \fi
7275 % and unrotate the scope
7276 \pgfscope
7277 \pgftransformrotate{\rot}
7278 % grid
7279 \pgfscope
7280 \pgfsetlinewidth{0.5\pgfstartlinewidth}
7281 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7282 \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
7283 {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7284 {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
7285 \pgfsetstrokeopacity{0.5}
7286 \pgfusepath{draw}
7287 \endpgfscope
7288 % function displayed, thanks to
7289 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7290 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7291 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
7292 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7293 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
7294 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
7295 \pgfusepath{draw}
7296 \endpgfscope
7297 }
7298
7299 % generic round meter with always horizontal text, no arrow
7300 \pgfcircdeclarebipolescaled{instruments}
7301 {}
7302 {\ctikzvalof{bipoles/esource/height}}
7303 {rmeter}
7304 {\ctikzvalof{bipoles/esource/height}}
7305 {\ctikzvalof{bipoles/esource/width}}
7306 {
7307 \pgfpointorigin
7308 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7309 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7310 \pgf@circ@draworfill
7311 % draw the text label
7312 % get the rotation
7313 \ifpgf@circuit@straightinstruments
7314 \pgfgettransformentries\a\b\temp\temp\temp\temp
7315 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7316 \else
7317 \edef\rot{0}
7318 \fi
7319 % and unrotate the scope
7320 \pgfscope
7321 \pgfsetcolor{\ctikzvalof{color}}
7322 \pgftransformrotate{\rot}
7323 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7324 \endpgfscope
7325 }
7326
7327 % generic round meter with always horizontal text, with arrow
7328 \pgfcircdeclarebipolescaled{instruments}
7329 {}
7330 {\ctikzvalof{bipoles/esource/height}}
7331 {rmeterwa}
7332 {\ctikzvalof{bipoles/esource/height}}
7333 {\ctikzvalof{bipoles/esource/width}}
7334 {
7335 \pgfpointorigin
7336 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7337 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7338 \pgf@circ@draworfill
7339 % draw the text label
7340 % get the rotation
7341 \ifpgf@circuit@straightinstruments
7342 \pgfgettransformentries\a\b\temp\temp\temp\temp
7343 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7344 \else
7345 \edef\rot{0}
7346 \fi
7347 % and unrotate the scope
7348 \pgfscope
7349 \pgftransformrotate{\rot}
7350 \pgfsetcolor{\ctikzvalof{color}}
7351 \pgfsetlinewidth{\pgfstartlinewidth}
7352 % arrow: create a center hole to have better visual
7353 \pgfscope
7354 % clipping path: first a rectangle bigger then the shape
7355 % to avoid problems with the line thickness
7356 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7357 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7358 % next open a circle into it
7359 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
7360 % do the difference and clip before drawing
7361 \pgfseteorule
7362 \pgfusepath{clip}
7363 \pgfsetarrowsend{latexslim}
7364 % the arrow is better if it has a bit of breath and it's not 45º
7365 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
7366 \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
7367 \pgfusepath{draw}
7368 \endpgfscope
7369 \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
7370 \endpgfscope
7371 }
7372
7373 % generic square meter with always horizontal text
7374 \pgfcircdeclarebipolescaled{instruments}
7375 {
7376 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
7377 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
7378 % put the node text above and centered
7379 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7380 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7381 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7382 }
7383 }
7384 }
7385 {\ctikzvalof{bipoles/smeter/height}}
7386 {smeter}
7387 {\ctikzvalof{bipoles/smeter/height}}
7388 {\ctikzvalof{bipoles/smeter/width}}
7389 {
7390 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7391 \pgfextracty{\pgf@circ@res@up}{\northeast}
7392 \pgfextractx{\pgf@circ@res@right}{\northeast}
7393 \pgfextractx{\pgf@circ@res@left}{\southwest}
7394 \pgfextracty{\pgf@circ@res@down}{\southwest}
7395 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7396 \pgfscope
7397 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7398 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7399 \pgf@circ@draworfill
7400 \endpgfscope
7401 % get the rotation
7402 \ifpgf@circuit@straightinstruments
7403 \pgfgettransformentries\a\b\temp\temp\temp\temp
7404 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7405 \else
7406 \edef\rot{0}
7407 \fi
7408 % and unrotate the scope
7409 \pgfscope
7410 \pgftransformrotate{\rot}
7411 % the metering window
7412 \pgfscope
7413 \def\@starta{105}\def\@stopa{75}
7414 \pgfsetlinewidth{\pgfstartlinewidth}
7415 \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
7416 \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
7417 \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
7418 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7419 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7420 \pgfclosepath
7421 \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
7422 \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
7423 \pgfusepath{draw}
7424 \endpgfscope
7425 \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
7426 \endpgfscope
7427 }
7428
7429 % probes qucs style:
7430 % #1 : name
7431 % #2 : extra code
7432 \long\def\pgfcirc@qucsprobe#1#2{
7433 \pgfcircdeclarebipolescaled{instruments}
7434 {
7435 \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
7436 \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
7437 % put the node text above and centered
7438 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7439 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7440 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7441 }
7442 }
7443 }
7444 {\ctikzvalof{bipoles/qmeter/depth}}
7445 {#1}
7446 {\ctikzvalof{bipoles/qmeter/height}}
7447 {\ctikzvalof{bipoles/qmeter/width}}
7448 {
7449 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7450 \pgfextracty{\pgf@circ@res@up}{\northeast}
7451 \pgfextractx{\pgf@circ@res@right}{\northeast}
7452 \pgfextractx{\pgf@circ@res@left}{\southwest}
7453 \pgfextracty{\pgf@circ@res@down}{\southwest}
7454 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7455 \pgfscope
7456 \pgfscope
7457 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7458 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7459 \pgf@circ@draworfill
7460 \endpgfscope
7461 \def\@starta{103}\def\@stopa{77}
7462 \pgfsetlinewidth{\pgfstartlinewidth}
7463 \pgfscope
7464 \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
7465 \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
7466 \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
7467 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7468 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7469 \pgfclosepath
7470 \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
7471 \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
7472 \pgfusepath{draw}
7473 \pgf@circ@draworfill
7474 \endpgfscope
7475 #2
7476 \endpgfscope
7477 }
7478 }
7479
7480 \pgfcirc@qucsprobe{qiprobe}{
7481 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7482 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7483 \pgfusepath{draw}
7484 \pgfnode{currarrow}{center}{}{}{}
7485 }
7486
7487 \pgfcirc@qucsprobe{qvprobe}{
7488 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
7489 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7490 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
7491 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7492 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
7493 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7494 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7495 \pgfusepath{draw}
7496 \pgfscope
7497 % "+" and "-", drawn so that they scale correctly
7498 \pgfsetlinewidth{2\pgfstartlinewidth}
7499 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
7500 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
7501 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7502 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7503 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7504 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7505 \pgfusepath{draw}
7506 \endpgfscope
7507 }
7508
7509 \pgfcirc@qucsprobe{qpprobe}{
7510 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7511 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7512 \pgfusepath{draw}
7513 \pgfnode{currarrow}{center}{}{}{}
7514 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
7515 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7516 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
7517 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
7518 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7519 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
7520 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
7521 \pgfusepath{draw}
7522 \pgfscope
7523 % "+" and "-", drawn so that they scale correctly
7524 \pgfsetlinewidth{2\pgfstartlinewidth}
7525 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
7526 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
7527 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7528 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7529 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7530 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7531 \pgfusepath{draw}
7532 \endpgfscope
7533 }
7534
7535 % current loop for oscope and similar: stylized
7536 \pgfcircdeclarebipolescaled{instruments}
7537 {
7538 \anchor{i}{\northeast\pgf@x=0pt\relax}
7539 \anchor{text}{
7540 \pgfextracty{\pgf@circ@res@up}{\northeast}
7541 \pgfextractx{\pgf@circ@res@left}{\northeast}
7542 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7543 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7544 }
7545 }
7546 }
7547 {\ctikzvalof{bipoles/iloop/height}}
7548 {iloop}
7549 {\ctikzvalof{bipoles/iloop/height}}
7550 {\ctikzvalof{bipoles/iloop/width}}
7551 {
7552 \pgfextracty{\pgf@circ@res@up}{\northeast}
7553 \pgfextractx{\pgf@circ@res@right}{\northeast}
7554 \pgf@circ@res@down=-\pgf@circ@res@up
7555 \pgf@circ@res@left=-\pgf@circ@res@right
7556 \pgfscope
7557 \pgfstartlinewidth=\pgflinewidth
7558 \pgfsetcolor{\ctikzvalof{color}}
7559 % external ellipse
7560 \pgfscope
7561 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7562 % clipping path: first a rectangle bigger then the shape
7563 % to avoid problems with the line thickness
7564 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7565 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7566 % next the opening to the left
7567 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7568 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7569 % do the difference and clip before drawing
7570 \pgfseteorule
7571 \pgfusepath{clip}
7572 \pgfpathellipse{\pgfpointorigin}{
7573 \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
7574 \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
7575 \pgfusepath{draw}
7576 \endpgfscope
7577 % internal wire
7578 \pgfsetlinewidth{\pgfstartlinewidth}
7579 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7580 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7581 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7582 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7583 % and the contact line up
7584 \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
7585 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
7586 \pgfusepath{draw}
7587 \endpgfscope
7588 }
7589
7590 % current loop for oscope and similar: real (double connection)
7591 \pgfcircdeclarebipolescaled{instruments}
7592 {
7593 \anchor{i+}{
7594 \pgfextracty{\pgf@circ@res@up}{\northeast}
7595 \pgfextractx{\pgf@circ@res@right}{\northeast}
7596 \pgf@circ@res@step=0.4\pgf@circ@res@right
7597 \pgf@circ@res@other=0.8\pgf@circ@res@up
7598 \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
7599 \pgf@y=\pgf@circ@res@up
7600 }
7601 \anchor{i-}{
7602 \pgfextracty{\pgf@circ@res@up}{\northeast}
7603 \pgfextractx{\pgf@circ@res@right}{\northeast}
7604 \pgf@circ@res@step=0.4\pgf@circ@res@right
7605 \pgf@circ@res@other=0.8\pgf@circ@res@up
7606 \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
7607 \pgf@y=\pgf@circ@res@up
7608 }
7609 \anchor{text}{
7610 \pgfextracty{\pgf@circ@res@up}{\northeast}
7611 \pgfextractx{\pgf@circ@res@left}{\northeast}
7612 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7613 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7614 }
7615 }
7616 }
7617 {\ctikzvalof{bipoles/iloop/height}}
7618 {iloop2}
7619 {\ctikzvalof{bipoles/iloop/height}}
7620 {\ctikzvalof{bipoles/iloop/width}}
7621 {
7622 \pgfextracty{\pgf@circ@res@up}{\northeast}
7623 \pgfextractx{\pgf@circ@res@right}{\northeast}
7624 \pgf@circ@res@down=-\pgf@circ@res@up
7625 \pgf@circ@res@left=-\pgf@circ@res@right
7626 % must be the same than internal i+ and i- anchors definition
7627 \pgf@circ@res@step=0.4\pgf@circ@res@right
7628 \pgf@circ@res@other=0.8\pgf@circ@res@up
7629 \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
7630 \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
7631 \pgfscope
7632 \pgfstartlinewidth=\pgflinewidth
7633 \pgfsetcolor{\ctikzvalof{color}}
7634 % external ellipse
7635 \pgfscope
7636 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7637 % clipping path: first a rectangle bigger then the shape
7638 % to avoid problems with the line thickness
7639 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7640 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7641 % next the opening to the left
7642 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7643 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7644 % do the difference and clip before drawing
7645 \pgfseteorule
7646 \pgfusepath{clip}
7647 \pgfpathmoveto{\@plus}
7648 \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
7649 \pgfusepath{draw}
7650 \endpgfscope
7651 % internal wire
7652 \pgfsetlinewidth{\pgfstartlinewidth}
7653 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7654 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7655 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7656 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7657 % and the contact line up
7658 % I use ...left and ---right as temporal lengths here to avoid defining more
7659 \pgfextractx{\pgf@circ@res@left}{\@plus}
7660 \pgfextractx{\pgf@circ@res@right}{\@minus}
7661 \pgfpathmoveto{\@plus}
7662 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7663 \pgfpathmoveto{\@minus}
7664 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7665 \pgfusepath{draw}
7666 \endpgfscope
7667 }
7668
7669
7670 %% Varistor
7671 \pgfcircdeclarebipolescaled{resistors}
7672 {}
7673 {\ctikzvalof{bipoles/varistor/height}}
7674 {varistor}
7675 {\ctikzvalof{bipoles/varistor/height}}
7676 {\ctikzvalof{bipoles/varistor/width}}
7677 {
7678 \pgfscope
7679 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}
7680 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7681 \pgf@circ@draworfill
7682 \endpgfscope
7683
7684 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
7685 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
7686 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7687 \pgfusepath{draw}
7688
7689 \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
7690 }
7691
7692 %%%%%%%%%%%%%%
7693 %% RF bipoles
7694 %%%%%%%%%%%%%%
7695
7696 % transmission line
7697 \pgfcircdeclarebipolescaled{RF}
7698 {}
7699 {\ctikzvalof{bipoles/tline/height}}
7700 {tline}
7701 {\ctikzvalof{bipoles/tline/height}}
7702 {\ctikzvalof{bipoles/tline/width}}
7703 {
7704 \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
7705 \begin{pgftransparencygroup}
7706 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7707 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
7708 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
7709 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
7710 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
7711 \pgf@circ@draworfill
7712 \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7713 {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
7714 \pgf@circ@draworfill
7715 \end{pgftransparencygroup}
7716 \pgfsetlinewidth{\pgfstartlinewidth}
7717 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7718 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7719 \pgfusepath{stroke}
7720 }
7721
7722 % microstrip transmission line
7723 \pgfcircdeclarebipolescaled{RF}
7724 {}
7725 {\ctikzvalof{bipoles/mstline/height}}
7726 {mstline}
7727 {\ctikzvalof{bipoles/mstline/height}}
7728 {\ctikzvalof{bipoles/mstline/width}}
7729 {
7730 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7731 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7732 \pgf@circ@draworfill
7733 }
7734
7735 %%%%%%%%%%%%%%%%%%%
7736 %% Block diagrams
7737 %%%%%%%%%%%%%%%%%%%
7738
7739 %% Draw the two-port fillable box
7740 \def\pgf@circ@twoportbox{
7741 \pgfscope
7742 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7743 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7744 \pgf@circ@draworfill
7745 \endpgfscope
7746 }
7747
7748 %% Generic two port box
7749 \pgfcircdeclarebipolescaled{blocks}
7750 {}
7751 {\ctikzvalof{bipoles/twoport/height}}
7752 {twoport}
7753 {\ctikzvalof{bipoles/twoport/height}}
7754 {\ctikzvalof{bipoles/twoport/width}}
7755 {
7756 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
7757 \divide \pgf@circ@res@step by 2
7758
7759 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7760 \pgf@circ@res@other = \pgf@circ@res@left
7761 \advance\pgf@circ@res@other by \pgf@circ@res@step
7762 \ifpgf@circuit@dashed
7763 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7764 \fi
7765 % draw outer box
7766 \pgf@circ@twoportbox
7767 \ifpgf@circuit@inputarrow
7768 {
7769 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7770 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7771 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7772 }
7773 \fi
7774
7775 % rotate inner symbol
7776 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7777 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7778 \pgftransformrotate{270}
7779 \fi\fi
7780 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7781 \pgftransformrotate{180}
7782 \fi\fi
7783 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7784 \pgftransformrotate{90}
7785 \fi\fi
7786
7787 % draw inner symbol
7788 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7789
7790 }
7791
7792 %% voltage controled oscillator
7793 \pgfcircdeclarebipolescaled{blocks}
7794 {}
7795 {\ctikzvalof{bipoles/vco/width}}
7796 {vco}
7797 {\ctikzvalof{bipoles/twoport/width}}
7798 {\ctikzvalof{bipoles/vco/width}}
7799 {
7800 \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@Rlen
7801 \divide \pgf@circ@res@step by 2
7802
7803 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7804 \pgf@circ@res@other = \pgf@circ@res@left
7805 \advance\pgf@circ@res@other by \pgf@circ@res@step
7806
7807 \ifpgf@circuit@dashed
7808 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7809 \fi
7810 % draw circle
7811 \pgfscope
7812 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7813 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
7814 \pgf@circ@draworfill
7815 \endpgfscope
7816 \ifpgf@circuit@inputarrow
7817 {
7818 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7819 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7820 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7821 }
7822 \fi
7823
7824 % rotate inner symbol
7825 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7826 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7827 \pgftransformrotate{270}
7828 \fi\fi
7829 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7830 \pgftransformrotate{180}
7831 \fi\fi
7832 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7833 \pgftransformrotate{90}
7834 \fi\fi
7835
7836 % draw inner sine waves
7837 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7838 \pgfsetlinewidth{\pgfstartlinewidth}
7839 \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
7840 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7841 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7842 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7843 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7844 \pgfusepath{draw}
7845 }
7846
7847 %% bandpass filter
7848 \pgfcircdeclarebipolescaled{blocks}
7849 {}
7850 {\ctikzvalof{bipoles/bandpass/width}}
7851 {bandpass}
7852 {\ctikzvalof{bipoles/bandpass/width}}
7853 {\ctikzvalof{bipoles/bandpass/width}}
7854 {
7855
7856 \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@Rlen
7857 \divide \pgf@circ@res@step by 2
7858
7859 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7860 \pgf@circ@res@other = \pgf@circ@res@left
7861 \advance\pgf@circ@res@other by \pgf@circ@res@step
7862
7863 \ifpgf@circuit@dashed
7864 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7865 \fi
7866
7867 % draw outer box
7868 \pgf@circ@twoportbox
7869
7870 \ifpgf@circuit@inputarrow
7871 {
7872 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7873 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7874 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7875 }
7876 \fi
7877
7878 % rotate inner symbol
7879 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7880 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7881 \pgftransformrotate{270}
7882 \fi\fi
7883 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7884 \pgftransformrotate{180}
7885 \fi\fi
7886 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7887 \pgftransformrotate{90}
7888 \fi\fi
7889
7890 % draw inner symbol
7891 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7892 \pgfsetarrows{-} %never draw arrows
7893 \pgfsetlinewidth{\pgfstartlinewidth}
7894 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7895 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7896 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7897 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7898 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7899 \pgfusepath{draw}
7900 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
7901 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
7902 \pgfusepath{draw}
7903
7904 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7905 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7906 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7907 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7908 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7909 \pgfusepath{draw}
7910
7911 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7912 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7913 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7914 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7915 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7916 \pgfusepath{draw}
7917 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
7918 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
7919 \pgfusepath{draw}
7920 }
7921
7922 %% bandstop filter
7923 \pgfcircdeclarebipolescaled{blocks}
7924 {}
7925 {\ctikzvalof{bipoles/bandstop/width}}
7926 {bandstop}
7927 {\ctikzvalof{bipoles/bandstop/width}}
7928 {\ctikzvalof{bipoles/bandstop/width}}
7929 {
7930 \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@Rlen
7931 \divide \pgf@circ@res@step by 2
7932
7933 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7934 \pgf@circ@res@other = \pgf@circ@res@left
7935 \advance\pgf@circ@res@other by \pgf@circ@res@step
7936
7937 \ifpgf@circuit@dashed
7938 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7939 \fi
7940
7941 % draw outer box
7942 \pgf@circ@twoportbox
7943
7944 \ifpgf@circuit@inputarrow
7945 {
7946 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7947 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7948 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7949 }
7950 \fi
7951
7952 % rotate inner symbol
7953 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7954 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7955 \pgftransformrotate{270}
7956 \fi\fi
7957 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
7958 \pgftransformrotate{180}
7959 \fi\fi
7960 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7961 \pgftransformrotate{90}
7962 \fi\fi
7963
7964 % draw inner symbol
7965 \pgfsetdash{}{0pt}% always draw solid line for inner symbol
7966 \pgfsetarrows{-}%never draw arrows
7967 \pgfsetlinewidth{\pgfstartlinewidth}
7968 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7969 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7970 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7971 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7972 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7973 \pgfusepath{draw}
7974
7975 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7976 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7977 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7978 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7979 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7980 \pgfusepath{draw}
7981 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7982 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7983 \pgfusepath{draw}
7984
7985 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7986 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7987 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7988 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7989 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7990 \pgfusepath{draw}
7991 }
7992
7993 %% highpass filter
7994 \pgfcircdeclarebipolescaled{blocks}
7995 {}
7996 {\ctikzvalof{bipoles/highpass/width}}
7997 {highpass}
7998 {\ctikzvalof{bipoles/highpass/width}}
7999 {\ctikzvalof{bipoles/highpass/width}}
8000 {
8001 \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@Rlen
8002 \divide \pgf@circ@res@step by 2
8003
8004 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8005 \pgf@circ@res@other = \pgf@circ@res@left
8006 \advance\pgf@circ@res@other by \pgf@circ@res@step
8007
8008 \ifpgf@circuit@dashed
8009 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8010 \fi
8011
8012 % draw outer box
8013 \pgf@circ@twoportbox
8014
8015 \ifpgf@circuit@inputarrow
8016 {
8017 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8018 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8019 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8020 }
8021 \fi
8022
8023 % rotate inner symbol
8024 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8025 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8026 \pgftransformrotate{270}
8027 \fi\fi
8028 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
8029 \pgftransformrotate{180}
8030 \fi\fi
8031 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
8032 \pgftransformrotate{90}
8033 \fi\fi
8034
8035 % draw inner symbol
8036 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8037 \pgfsetarrows{-} %never draw arrows
8038 \pgfsetlinewidth{\pgfstartlinewidth}
8039 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
8040 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8041 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8042 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8043 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8044 \pgfusepath{draw}
8045
8046 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
8047 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8048 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8049 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8050 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8051 \pgfusepath{draw}
8052 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
8053 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
8054 \pgfusepath{draw}
8055
8056 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
8057 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8058 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8059 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8060 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8061 \pgfusepath{draw}
8062 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
8063 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
8064 \pgfusepath{draw}
8065 }
8066
8067 %% lowpass filter
8068 \pgfcircdeclarebipolescaled{blocks}
8069 {}
8070 {\ctikzvalof{bipoles/lowpass/width}}
8071 {lowpass}
8072 {\ctikzvalof{bipoles/lowpass/width}}
8073 {\ctikzvalof{bipoles/lowpass/width}}
8074 {
8075 \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@Rlen
8076 \divide \pgf@circ@res@step by 2
8077
8078 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8079 \pgf@circ@res@other = \pgf@circ@res@left
8080 \advance\pgf@circ@res@other by \pgf@circ@res@step
8081
8082 \ifpgf@circuit@dashed
8083 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8084 \fi
8085
8086 % draw outer box
8087 \pgf@circ@twoportbox
8088
8089 \ifpgf@circuit@inputarrow
8090 {
8091 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8092 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8093 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8094 }
8095 \fi
8096
8097 % rotate inner symbol
8098 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8099 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8100 \pgftransformrotate{270}
8101 \fi\fi
8102 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
8103 \pgftransformrotate{180}
8104 \fi\fi
8105 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
8106 \pgftransformrotate{90}
8107 \fi\fi
8108
8109 % draw inner symbol
8110 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8111 \pgfsetarrows{-} %never draw arrows
8112 \pgfsetlinewidth{\pgfstartlinewidth}
8113 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
8114 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8115 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8116 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8117 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8118 \pgfusepath{draw}
8119 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
8120 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
8121 \pgfusepath{draw}
8122
8123 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
8124 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8125 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8126 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8127 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8128 \pgfusepath{draw}
8129 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
8130 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
8131 \pgfusepath{draw}
8132
8133 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
8134 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8135 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8136 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
8137 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
8138 \pgfusepath{draw}
8139 }
8140
8141 %% ADC
8142 \pgfcircdeclarebipolescaled{blocks}
8143 {}
8144 {\ctikzvalof{bipoles/adc/width}}
8145 {adc}
8146 {\ctikzvalof{bipoles/adc/width}}
8147 {\ctikzvalof{bipoles/adc/width}}
8148 {
8149 \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@Rlen
8150 \divide \pgf@circ@res@step by 2
8151
8152 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8153 \pgf@circ@res@other = \pgf@circ@res@left
8154 \advance\pgf@circ@res@other by \pgf@circ@res@step
8155
8156 \ifpgf@circuit@dashed
8157 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8158 \fi
8159
8160 % draw outer box
8161 \pgf@circ@twoportbox
8162
8163 \ifpgf@circuit@inputarrow
8164 {
8165 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8166 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8167 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8168 }
8169 \fi
8170
8171 % rotate inner symbol
8172 \def\texti{A}
8173 \def\textii{D}
8174 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8175 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8176 \def\texti{D}
8177 \def\textii{A}
8178 \pgftransformrotate{270}
8179 \fi\fi
8180 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
8181 \def\texti{D}
8182 \def\textii{A}
8183 \pgftransformrotate{180}
8184 \fi\fi
8185 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8186 \pgftransformrotate{90}
8187 \def\texti{A}
8188 \def\textii{D}
8189 \fi\fi
8190
8191 % draw inner symbol
8192 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8193 \pgfsetarrows{-} %never draw arrows
8194 \pgfsetlinewidth{\pgfstartlinewidth}
8195 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8196 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8197 \pgfusepath{draw}
8198
8199 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
8200 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
8201 }
8202
8203 %% DAC
8204 \pgfcircdeclarebipolescaled{blocks}
8205 {}
8206 {\ctikzvalof{bipoles/dac/width}}
8207 {dac}
8208 {\ctikzvalof{bipoles/dac/width}}
8209 {\ctikzvalof{bipoles/dac/width}}
8210 {
8211 \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@Rlen
8212 \divide \pgf@circ@res@step by 2
8213
8214 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8215 \pgf@circ@res@other = \pgf@circ@res@left
8216 \advance\pgf@circ@res@other by \pgf@circ@res@step
8217
8218 \ifpgf@circuit@dashed
8219 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8220 \fi
8221
8222 % draw outer box
8223 \pgf@circ@twoportbox
8224
8225 \ifpgf@circuit@inputarrow
8226 {
8227 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8228 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8229 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8230 }
8231 \fi
8232
8233 % rotate inner symbol
8234 \def\texti{D}
8235 \def\textii{A}
8236 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8237 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8238 \def\texti{A}
8239 \def\textii{D}
8240 \pgftransformrotate{270}
8241 \fi\fi
8242 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
8243 \def\texti{A}
8244 \def\textii{D}
8245 \pgftransformrotate{180}
8246 \fi\fi
8247 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8248 \pgftransformrotate{90}
8249 \def\texti{D}
8250 \def\textii{A}
8251 \fi\fi
8252
8253 % draw inner symbol
8254 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8255 \pgfsetarrows{-} %never draw arrows
8256 \pgfsetlinewidth{\pgfstartlinewidth}
8257 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8258 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8259 \pgfusepath{draw}
8260
8261 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
8262 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
8263 }
8264
8265 %% DSP
8266 \pgfcircdeclarebipolescaled{blocks}
8267 {}
8268 {\ctikzvalof{bipoles/dsp/width}}
8269 {dsp}
8270 {\ctikzvalof{bipoles/dsp/width}}
8271 {\ctikzvalof{bipoles/dsp/width}}
8272 {
8273 \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@Rlen
8274 \divide \pgf@circ@res@step by 2
8275
8276 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8277 \pgf@circ@res@other = \pgf@circ@res@left
8278 \advance\pgf@circ@res@other by \pgf@circ@res@step
8279
8280 \ifpgf@circuit@dashed
8281 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8282 \fi
8283
8284 % draw outer box
8285 \pgf@circ@twoportbox
8286
8287 \ifpgf@circuit@inputarrow
8288 {
8289 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8290 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8291 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8292 }
8293 \fi
8294
8295 % rotate inner symbol
8296 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8297 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8298 \pgftransformrotate{270}
8299 \fi\fi
8300 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8301 \pgftransformrotate{180}
8302 \fi\fi
8303 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8304 \pgftransformrotate{90}
8305 \fi\fi
8306
8307 % draw inner symbol
8308 \pgftext[center,x=0,y=0]{\textsf{DSP}}
8309 }
8310
8311 %% FFT
8312 \pgfcircdeclarebipolescaled{blocks}
8313 {}
8314 {\ctikzvalof{bipoles/fft/width}}
8315 {fft}
8316 {\ctikzvalof{bipoles/fft/width}}
8317 {\ctikzvalof{bipoles/fft/width}}
8318 {
8319 \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@Rlen
8320 \divide \pgf@circ@res@step by 2
8321
8322 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8323 \pgf@circ@res@other = \pgf@circ@res@left
8324 \advance\pgf@circ@res@other by \pgf@circ@res@step
8325
8326 \ifpgf@circuit@dashed
8327 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8328 \fi
8329
8330 % draw outer box
8331 \pgf@circ@twoportbox
8332
8333 \ifpgf@circuit@inputarrow
8334 {
8335 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8336 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8337 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8338 }
8339 \fi
8340
8341 % rotate inner symbol
8342 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8343 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8344 \pgftransformrotate{270}
8345 \fi\fi
8346 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8347 \pgftransformrotate{180}
8348 \fi\fi
8349 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8350 \pgftransformrotate{90}
8351 \fi\fi
8352
8353 % draw inner symbol
8354 \pgftext[center,x=0,y=0]{\textsf{FFT}}
8355 }
8356
8357 %% Amplifier
8358 \pgfcircdeclarebipolescaled{blocks}
8359 {}
8360 {
8361 \ifpgf@circuit@boxed
8362 \ctikzvalof{bipoles/twoport/width}
8363 \else
8364 \ctikzvalof{bipoles/amp/width}
8365 \fi
8366 }
8367 {amp}
8368 {
8369 \ifpgf@circuit@boxed
8370 \ctikzvalof{bipoles/twoport/width}
8371 \else
8372 \ctikzvalof{bipoles/amp/width}
8373 \fi
8374 }
8375 {
8376 \ifpgf@circuit@boxed
8377 \ctikzvalof{bipoles/twoport/width}
8378 \else
8379 \ctikzvalof{bipoles/amp/width}
8380 \fi
8381 }
8382 {
8383 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
8384
8385 \ifpgf@circuit@dashed
8386 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8387 \fi
8388
8389 % draw outer box
8390 \ifpgf@circuit@boxed
8391 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8392 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
8393 \pgf@circ@draworfill
8394 \fi
8395
8396 % draw input arrow
8397 \ifpgf@circuit@inputarrow
8398 {
8399 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8400 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8401 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8402 }
8403 \fi
8404
8405 \ifpgf@circuit@boxed
8406 \pgfsetlinewidth{\pgfstartlinewidth}
8407 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
8408 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
8409 \else
8410 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8411 \fi
8412
8413 \pgfsetarrows{-} %never draw arrows
8414
8415 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
8416 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
8417 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
8418
8419 \pgfpathclose
8420 \pgf@circ@draworfill
8421
8422 % draw inner text
8423 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
8424 }
8425
8426
8427 %% variable amplifier
8428 \pgfcircdeclarebipolescaled{blocks}
8429 {}
8430 {
8431 \ifpgf@circuit@boxed
8432 \ctikzvalof{bipoles/twoport/width}
8433 \else
8434 \ctikzvalof{bipoles/amp/width}
8435 \fi
8436 }
8437 {vamp}
8438 {
8439 \ifpgf@circuit@boxed
8440 \ctikzvalof{bipoles/twoport/width}
8441 \else
8442 \ctikzvalof{bipoles/amp/width}
8443 \fi
8444 }
8445 {
8446 \ifpgf@circuit@boxed
8447 \ctikzvalof{bipoles/twoport/width}
8448 \else
8449 \ctikzvalof{bipoles/amp/width}
8450 \fi
8451 }
8452 {
8453 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
8454
8455 \ifpgf@circuit@dashed
8456 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8457 \fi
8458
8459 % draw outer box
8460 \ifpgf@circuit@boxed
8461 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
8462 \fi
8463
8464 % draw input arrow
8465 \ifpgf@circuit@inputarrow
8466 {
8467 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8468 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8469 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8470 }
8471 \fi
8472
8473 \ifpgf@circuit@boxed
8474 \pgfsetlinewidth{\pgfstartlinewidth}
8475 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
8476 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
8477 \else
8478 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8479 \fi
8480
8481
8482 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8483 \pgfsetarrows{-} %never draw arrows
8484
8485 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
8486 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
8487 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
8488
8489 \pgfpathclose
8490 \pgf@circ@draworfill
8491
8492 % draw inner text
8493 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
8494
8495 % draw arrow
8496 \pgfsetlinewidth{\pgfstartlinewidth}
8497 \pgfsetarrowsend{latex}
8498 \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
8499 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
8500 \pgfusepath{draw}
8501 }
8502
8503 %% pi attenuator
8504 \pgfcircdeclarebipolescaled{blocks}
8505 {}
8506 {\ctikzvalof{bipoles/piattenuator/width}}
8507 {piattenuator}
8508 {\ctikzvalof{bipoles/piattenuator/width}}
8509 {\ctikzvalof{bipoles/piattenuator/width}}
8510 {
8511 \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@Rlen
8512 \divide \pgf@circ@res@step by 2
8513
8514 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8515 \pgf@circ@res@other = \pgf@circ@res@left
8516 \advance\pgf@circ@res@other by \pgf@circ@res@step
8517
8518 \ifpgf@circuit@dashed
8519 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8520 \fi
8521
8522 % draw outer box
8523 \pgf@circ@twoportbox
8524
8525 \ifpgf@circuit@inputarrow
8526 {
8527 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8528 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8529 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8530 }
8531 \fi
8532
8533 % rotate inner symbol
8534 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8535 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8536 \pgftransformrotate{270}
8537 \fi\fi
8538 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8539 \pgftransformrotate{90}
8540 \fi\fi
8541
8542 % draw inner symbol
8543 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8544 \pgfsetarrows{-} %never draw arrows
8545 \pgfsetlinewidth{\pgfstartlinewidth}
8546 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
8547 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8548 \pgfusepath{draw}
8549 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
8550 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8551 \pgfusepath{draw}
8552 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8553 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8554 \pgfusepath{draw}
8555 }
8556
8557 %% variable pi attenuator
8558 \pgfcircdeclarebipolescaled{blocks}
8559 {}
8560 {\ctikzvalof{bipoles/vpiattenuator/width}}
8561 {vpiattenuator}
8562 {\ctikzvalof{bipoles/vpiattenuator/width}}
8563 {\ctikzvalof{bipoles/vpiattenuator/width}}
8564 {
8565 \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@Rlen
8566 \divide \pgf@circ@res@step by 2
8567
8568 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8569 \pgf@circ@res@other = \pgf@circ@res@left
8570 \advance\pgf@circ@res@other by \pgf@circ@res@step
8571
8572 \ifpgf@circuit@dashed
8573 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8574 \fi
8575
8576 % draw outer box
8577 \pgf@circ@twoportbox
8578
8579 \ifpgf@circuit@inputarrow
8580 {
8581 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8582 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8583 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8584 }
8585 \fi
8586
8587 % rotate inner symbol
8588 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8589 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8590 \pgftransformrotate{270}
8591 \fi\fi
8592 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8593 \pgftransformrotate{90}
8594 \fi\fi
8595
8596 % draw inner symbol
8597 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8598 \pgfsetarrows{-} %never draw arrows
8599 \pgfsetlinewidth{\pgfstartlinewidth}
8600 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
8601 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8602 \pgfusepath{draw}
8603 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
8604 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8605 \pgfusepath{draw}
8606 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8607 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8608 \pgfusepath{draw}
8609
8610 \pgfsetarrowsend{latex}
8611 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8612 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8613 \pgfusepath{draw}
8614 }
8615
8616 %% T attenuator
8617 \pgfcircdeclarebipolescaled{blocks}
8618 {}
8619 {\ctikzvalof{bipoles/tattenuator/width}}
8620 {tattenuator}
8621 {\ctikzvalof{bipoles/tattenuator/width}}
8622 {\ctikzvalof{bipoles/tattenuator/width}}
8623 {
8624 \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@Rlen
8625 \divide \pgf@circ@res@step by 2
8626
8627 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8628 \pgf@circ@res@other = \pgf@circ@res@left
8629 \advance\pgf@circ@res@other by \pgf@circ@res@step
8630
8631 \ifpgf@circuit@dashed
8632 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8633 \fi
8634
8635 % draw outer box
8636 \pgf@circ@twoportbox
8637
8638 \ifpgf@circuit@inputarrow
8639 {
8640 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8641 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8642 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8643 }
8644 \fi
8645
8646 % rotate inner symbol
8647 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8648 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8649 \pgftransformrotate{270}
8650 \fi\fi
8651 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8652 \pgftransformrotate{90}
8653 \fi\fi
8654
8655 % draw inner symbol
8656 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8657 \pgfsetarrows{-} %never draw arrows
8658 \pgfsetlinewidth{\pgfstartlinewidth}
8659 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8660 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8661 \pgfusepath{draw}
8662 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8663 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8664 \pgfusepath{draw}
8665 }
8666
8667 %% variable T attenuator
8668 \pgfcircdeclarebipolescaled{blocks}
8669 {}
8670 {\ctikzvalof{bipoles/vtattenuator/width}}
8671 {vtattenuator}
8672 {\ctikzvalof{bipoles/vtattenuator/width}}
8673 {\ctikzvalof{bipoles/vtattenuator/width}}
8674 {
8675 \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@Rlen
8676 \divide \pgf@circ@res@step by 2
8677
8678 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8679 \pgf@circ@res@other = \pgf@circ@res@left
8680 \advance\pgf@circ@res@other by \pgf@circ@res@step
8681
8682 \ifpgf@circuit@dashed
8683 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8684 \fi
8685
8686 % draw outer box
8687 \pgf@circ@twoportbox
8688
8689 \ifpgf@circuit@inputarrow
8690 {
8691 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8692 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8693 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8694 }
8695 \fi
8696
8697 % rotate inner symbol
8698 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8699 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8700 \pgftransformrotate{270}
8701 \fi\fi
8702 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8703 \pgftransformrotate{90}
8704 \fi\fi
8705
8706 % draw inner symbol
8707 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8708 \pgfsetarrows{-} %never draw arrows
8709 \pgfsetlinewidth{\pgfstartlinewidth}
8710 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8711 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8712 \pgfusepath{draw}
8713 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8714 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8715 \pgfusepath{draw}
8716
8717 \pgfsetarrowsend{latex}
8718 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8719 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8720 \pgfusepath{draw}
8721 }
8722
8723 %% phase shifter
8724 \pgfcircdeclarebipolescaled{blocks}
8725 {}
8726 {\ctikzvalof{bipoles/phaseshifter/width}}
8727 {phaseshifter}
8728 {\ctikzvalof{bipoles/phaseshifter/width}}
8729 {\ctikzvalof{bipoles/phaseshifter/width}}
8730 {
8731 \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@Rlen
8732 \divide \pgf@circ@res@step by 2
8733
8734 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8735 \pgf@circ@res@other = \pgf@circ@res@left
8736 \advance\pgf@circ@res@other by \pgf@circ@res@step
8737
8738 \ifpgf@circuit@dashed
8739 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8740 \fi
8741
8742 % draw outer box
8743 \pgf@circ@twoportbox
8744
8745 \ifpgf@circuit@inputarrow
8746 {
8747 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8748 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8749 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8750 }
8751 \fi
8752
8753 % rotate inner symbol
8754 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8755 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8756 \pgftransformrotate{270}
8757 \fi\fi
8758 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8759 \pgftransformrotate{180}
8760 \fi\fi
8761 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8762 \pgftransformrotate{90}
8763 \fi\fi
8764
8765 % inner symbol
8766 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8767 }
8768
8769 %% variable phase shifter
8770 \pgfcircdeclarebipolescaled{blocks}
8771 {}
8772 {\ctikzvalof{bipoles/phaseshifter/width}}
8773 {vphaseshifter}
8774 {\ctikzvalof{bipoles/vphaseshifter/width}}
8775 {\ctikzvalof{bipoles/vphaseshifter/width}}
8776 {
8777 \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@Rlen
8778 \divide \pgf@circ@res@step by 2
8779
8780 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8781 \pgf@circ@res@other = \pgf@circ@res@left
8782 \advance\pgf@circ@res@other by \pgf@circ@res@step
8783
8784 \ifpgf@circuit@dashed
8785 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8786 \fi
8787
8788 % draw outer box
8789 \pgf@circ@twoportbox
8790
8791 \ifpgf@circuit@inputarrow
8792 {
8793 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8794 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8795 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8796 }
8797 \fi
8798
8799 % rotate inner symbol
8800 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8801 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8802 \pgftransformrotate{270}
8803 \fi\fi
8804 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8805 \pgftransformrotate{180}
8806 \fi\fi
8807 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8808 \pgftransformrotate{90}
8809 \fi\fi
8810
8811 % inner symbol
8812 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8813
8814 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8815 \pgfsetlinewidth{\pgfstartlinewidth}
8816 \pgfsetarrowsend{latex}
8817 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
8818 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
8819 \pgfusepath{draw}
8820 }
8821
8822 %% detector
8823 \pgfcircdeclarebipolescaled{blocks}
8824 {}
8825 {\ctikzvalof{bipoles/detector/width}}
8826 {detector}
8827 {\ctikzvalof{bipoles/detector/width}}
8828 {\ctikzvalof{bipoles/detector/width}}
8829 {
8830 \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@Rlen
8831 \divide \pgf@circ@res@step by 2
8832
8833 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8834 \pgf@circ@res@other = \pgf@circ@res@left
8835 \advance\pgf@circ@res@other by \pgf@circ@res@step
8836
8837 \ifpgf@circuit@dashed
8838 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8839 \fi
8840
8841 % draw outer box
8842 \pgf@circ@twoportbox
8843
8844 \ifpgf@circuit@inputarrow
8845 {
8846 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8847 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8848 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8849 }
8850 \fi
8851
8852 % draw inner stuff
8853 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8854 \pgfsetarrows{-} %never draw arrows
8855 \pgfsetlinewidth{0.8\pgfstartlinewidth}
8856 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
8857 \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
8858 \pgfusepath{draw}
8859
8860 \ifpgf@circuit@fulldiode
8861 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width}}
8862 \pgftransformscale{\pgfmathresult}
8863 \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
8864 \else
8865 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width}}
8866 \pgftransformscale{\pgfmathresult}
8867 \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
8868 \fi
8869
8870 }
8871
8872 %%%%%%%%%%%%%%%%%%%%%%%
8873 %% MECHANICAL SYMBOLS
8874 %%%%%%%%%%%%%%%%%%%%%%%
8875
8876 %% mechanical capacitance - stiffness/spring
8877
8878 \pgfcircdeclarebipolescaled{mechanicals}
8879 {}
8880 {\ctikzvalof{bipoles/spring/height}}
8881 {spring}
8882 {\ctikzvalof{bipoles/spring/height}}
8883 {\ctikzvalof{bipoles/spring/width}}{
8884 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8885 \pgftransformationadjustments
8886
8887 \pgfmathsetlength{\pgf@circ@res@step}
8888 {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
8889
8890 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
8891 \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
8892 \pgf@circ@res@other = \pgf@circ@res@left
8893 \advance\pgf@circ@res@other by \pgf@circ@res@step
8894 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8895 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8896 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8897 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8898 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8899 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8900 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8901 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8902 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8903 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8904 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8905 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8906 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8907 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8908 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8909 \advance\pgf@circ@res@other by \pgf@circ@res@step
8910 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
8911 \pgfsetbuttcap
8912 \pgfsetbeveljoin
8913 \pgfusepath{stroke}
8914 }
8915
8916 %% mechanical inductance - mass
8917 \pgfcircdeclarebipolescaled{mechanicals}
8918 {}
8919 {\ctikzvalof{bipoles/mass/box height}}
8920 {mass}
8921 {\ctikzvalof{bipoles/mass/height}}
8922 {\ctikzvalof{bipoles/mass/width}}
8923 {
8924 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8925 \pgftransformationadjustments
8926 \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8927 {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
8928 \pgf@circ@draworfill
8929
8930 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8931 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8932 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8933 \pgfsetrectcap
8934 \pgfsetmiterjoin
8935 \pgfusepath{stroke}
8936 }
8937
8938 %% mechanical resistor - damper
8939 \pgfcircdeclarebipolescaled{mechanicals}
8940 {}
8941 {\ctikzvalof{bipoles/damper/height}}
8942 {damper}
8943 {\ctikzvalof{bipoles/damper/height}}
8944 {\ctikzvalof{bipoles/damper/width}}
8945 {
8946 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8947 \pgf@circ@maybefill
8948
8949 % line into the damper
8950 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8951 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8952 {\pgf@circ@res@zero}}
8953 \pgfusepath{stroke}
8954
8955 % damper box
8956 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8957 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8958 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8959 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8960 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8961
8962 \pgfsetrectcap
8963 \pgfsetmiterjoin
8964 \pgfusepath{stroke}
8965
8966 % damper vertical element
8967 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8968 {.8\pgf@circ@res@down}}
8969 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8970 {.8\pgf@circ@res@up}}
8971 \pgfsetbuttcap
8972 \pgfusepath{stroke}
8973
8974 }
8975 %% mechanical viscoelastic element, suggested by @alex
8976 %% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
8977 \pgfcircdeclarebipolescaled{mechanicals}
8978 {} % extra anchors
8979 {\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
8980 {viscoe} % name
8981 {\ctikzvalof{bipoles/damper/height}} % height (above the path line)
8982 {\ctikzvalof{bipoles/damper/width}} % width
8983 { % draw the bipole
8984 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8985 \pgf@circ@maybefill
8986
8987 % spring into the damper
8988 \pgfscope
8989 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8990 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8991 \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
8992 \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8993 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
8994 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8995 \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
8996 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
8997 \pgfusepath{stroke}
8998 \endpgfscope
8999 % damper box
9000 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9001 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
9002 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9003 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9004 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9005
9006 \pgfsetrectcap
9007 \pgfsetmiterjoin
9008 \pgfusepath{stroke}
9009
9010 % damper vertical element
9011 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
9012 {.8\pgf@circ@res@down}}
9013 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
9014 {.8\pgf@circ@res@up}}
9015 \pgfsetbuttcap
9016 \pgfusepath{stroke}
9017
9018 }
9019
9020 %%%%%%%%%%%%%%%%
9021 %% Crossing
9022 %%%%%%%%%%%%%%%%
9023
9024 %% crossing bipole (but see also nodes)
9025 \pgfcircdeclarebipole
9026 {}
9027 {\ctikzvalof{bipoles/crossing/size}}
9028 {crossing}
9029 {\ctikzvalof{bipoles/crossing/size}}
9030 {\ctikzvalof{bipoles/crossing/size}}{
9031 \pgfscope
9032 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
9033 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
9034 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
9035 \pgfsetbeveljoin
9036 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
9037 \pgfusepath{draw}
9038 \endpgfscope
9039 }
9040
9041 %%%%%%%%%%%%%%%%%%%%%%%%%
9042 %% Miscellaneous bipoles
9043 %%%%%%%%%%%%%%%%%%%%%%%%%
9044
9045 %% loudspeaker and microphone
9046
9047 \pgfcircdeclarebipolescaled{misc}
9048 {}
9049 {\ctikzvalof{bipoles/loudspeaker/depth}}
9050 {loudspeaker}
9051 {\ctikzvalof{bipoles/loudspeaker/height}}
9052 {\ctikzvalof{bipoles/loudspeaker/width}}{
9053
9054 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
9055 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9056 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
9057 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
9058 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
9059 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
9060 \pgfpathclose
9061 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9062 \pgf@circ@draworfill
9063 }
9064
9065 \pgfcircdeclarebipolescaled{misc}
9066 {}
9067 {\ctikzvalof{bipoles/mic/depth}}
9068 {mic}
9069 {\ctikzvalof{bipoles/mic/height}}
9070 {\ctikzvalof{bipoles/mic/width}}{
9071
9072 \pgfscope
9073 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9074 \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
9075 \pgf@circ@draworfill
9076 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
9077 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
9078 \pgfusepath{draw}
9079 \endpgfscope
9080 \pgfscope
9081 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9082 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
9083 % 0.25358 is 0.6-0.4*cos(30)
9084 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
9085 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
9086 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
9087 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9088 \pgfusepath{draw}
9089
9090 \pgfusepath{draw}
9091 \endpgfscope
9092 }
9093
9094 %% european gas filled surge arrester
9095 \pgfcircdeclarebipolescaled{misc}
9096 {}
9097 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
9098 {european gas filled surge arrester}
9099 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
9100 {\ctikzvalof{bipoles/european gas filled surge arrester/width}}
9101 {
9102
9103 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9104 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9105
9106 \pgf@circ@draworfill
9107
9108 \pgfscope
9109 \pgfsetarrowsend{latexslim}
9110 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9111 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
9112 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9113 \pgfusepath{draw}
9114
9115 \endpgfscope
9116 }
9117
9118 %% american gas filled surge arrester
9119 \pgfcircdeclarebipolescaled{misc}
9120 {}
9121 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
9122 {american gas filled surge arrester}
9123 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
9124 {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
9125
9126 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
9127 \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
9128 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
9129 \pgfusepath{draw}
9130
9131 \pgfscope
9132 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9133 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
9134 \pgf@circ@draworfill
9135 \endpgfscope
9136
9137 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
9138 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
9139 \pgfusepath{draw}
9140
9141 \pgfscope
9142 \pgfsetarrowsend{latex}
9143
9144 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
9145 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
9146 \pgfusepath{draw}
9147
9148 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
9149 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
9150 \pgfusepath{draw}
9151 \endpgfscope{}
9152
9153 \pgfcircle{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\ctikzvalof{bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\ctikzvalof{bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
9154 \pgfusepath{fill}
9155 }
9156
9157 %% thermocouple
9158 \pgfcircdeclarebipolescaled{misc}
9159 {}
9160 {\ctikzvalof{bipoles/thermocouple/height 2}}
9161 {thermocouple}
9162 {\ctikzvalof{bipoles/thermocouple/height}}
9163 {\ctikzvalof{bipoles/thermocouple/width}}
9164 {
9165 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
9166 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
9167 \pgfusepath{draw}
9168 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
9169 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9170 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
9171 \pgfusepath{draw}
9172 \pgfsetlinewidth{\pgfstartlinewidth}
9173 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
9174 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
9175 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
9176 \pgfusepath{draw}
9177 }
9178
9179 %% fuse
9180 \pgfcircdeclarebipolescaled{misc}
9181 {}
9182 {\ctikzvalof{bipoles/fuse/height}}
9183 {fuse}
9184 {\ctikzvalof{bipoles/fuse/height}}
9185 {\ctikzvalof{bipoles/fuse/width}}
9186 {
9187 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
9188 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
9189 \pgfusepath{draw}
9190
9191 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9192 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9193
9194 \pgf@circ@draworfill
9195 }
9196
9197 %% asymmetric fuse
9198 \pgfcircdeclarebipolescaled{misc}
9199 {}
9200 {\ctikzvalof{bipoles/afuse/height}}
9201 {afuse}
9202 {\ctikzvalof{bipoles/afuse/height}}
9203 {\ctikzvalof{bipoles/afuse/width}}
9204 {
9205 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
9206 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
9207 \pgfusepath{draw}
9208
9209 \pgfscope
9210 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9211 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9212 \pgf@circ@draworfill
9213 \endpgfscope
9214
9215 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9216 \pgfusepath{stroke,fill}
9217 }
9218
9219 %% SQUID added by Cor Molenaar 5 March 2010
9220 \pgfcircdeclarebipolescaled{misc}
9221 {}
9222 {\ctikzvalof{bipoles/squid/height}}
9223 {squid}
9224 {\ctikzvalof{bipoles/squid/height}}
9225 {\ctikzvalof{bipoles/squid/width}}
9226 {
9227 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9228
9229 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
9230 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
9231 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
9232 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
9233 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
9234 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
9235 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
9236 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
9237 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
9238
9239 \pgfusepath{draw}
9240 }
9241
9242 % Generic barrier added by Cor Molenaar 5 March 2010
9243 \pgfcircdeclarebipolescaled{misc}
9244 {}
9245 {\ctikzvalof{bipoles/barrier/height}}
9246 {barrier}
9247 {\ctikzvalof{bipoles/barrier/height}}
9248 {\ctikzvalof{bipoles/barrier/width}}
9249 {
9250 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9251
9252 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
9253 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
9254 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
9255 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
9256 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
9257 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
9258
9259 \pgfusepath{draw}
9260 }
9261
9262 %% Lamp
9263 \pgfcircdeclarebipolescaled{misc}
9264 {}
9265 {\ctikzvalof{bipoles/lamp/height}}
9266 {lamp}
9267 {\ctikzvalof{bipoles/lamp/height}}
9268 {\ctikzvalof{bipoles/lamp/width}}
9269 {
9270 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9271
9272 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
9273 \pgf@circ@draworfill
9274 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
9275 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
9276 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
9277 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
9278 \pgfusepath{draw}
9279 }
9280
9281 %% bulb
9282 \pgfcircdeclarebipolescaled{misc}
9283 {}
9284 {\ctikzvalof{bipoles/bulb/height}}
9285 {bulb}
9286 {\ctikzvalof{bipoles/bulb/height}}
9287 {\ctikzvalof{bipoles/bulb/width}}
9288 {%
9289 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9290 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
9291 \pgf@circ@draworfill
9292 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
9293 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
9294 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
9295 \pgfsetbeveljoin
9296 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
9297 \pgfusepath{draw}
9298 }
9299
9300
9301 % end of pgfcircbipoles.tex
9302 %%%---------- close: tex/pgfcircbipoles
9303 %%%%%%%%%%% Springe nach tex/pgfcirctripoles
9304 %%%---------- open: tex/pgfcirctripoles.tex
9305 % Copyright 2018-2026 by Romano Giannetti
9306 % Copyright 2015-2026 by Stefan Lindner
9307 % Copyright 2013-2026 by Stefan Erhardt
9308 % Copyright 2007-2026 by Massimo Redaelli
9309 %
9310 % This file may be distributed and/or modified
9311 %
9312 % 1. under the LaTeX Project Public License and/or
9313 % 2. under the GNU Public License.
9314 %
9315 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
9316
9317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9318 %% Tripoles
9319
9320 %%%%%%%%%%%%%
9321 %% switches
9322 %%%%%%%%%%%%%
9323
9324 % Legacy spdt
9325 \pgfdeclareshape{spdt}{
9326 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
9327 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9328 \savedanchor\northwest{%
9329 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9330 \pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen
9331 \pgf@y=.5\pgf@y
9332 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
9333 \pgf@x=.5\pgf@x
9334 }
9335 \anchor{left}{%
9336 \northwest
9337 \pgf@y=0pt
9338 }
9339 \anchor{in}{
9340 \northwest
9341 \pgf@y=0pt
9342 }
9343 \anchor{out 1}{
9344 \northwest
9345 \pgf@x=-\pgf@x
9346 }
9347 \anchor{out 2}{
9348 \northwest
9349 \pgf@x=-\pgf@x
9350 \pgf@y=-\pgf@y
9351 }
9352 \anchor{center}{
9353 \pgf@y=0pt
9354 \pgf@x=0pt
9355 }
9356 \anchor{east}{
9357 \northwest
9358 \pgf@y=0pt
9359 \pgf@x=-\pgf@x
9360 }
9361 \anchor{west}{
9362 \northwest
9363 \pgf@y=0pt
9364 }
9365 \anchor{south}{
9366 \northwest
9367 \pgf@x=0pt
9368 \pgf@y=-\pgf@y
9369 }
9370 \anchor{north}{
9371 \northwest
9372 \pgf@x=0pt
9373 }
9374 \anchor{south west}{
9375 \northwest
9376 \pgf@y=-\pgf@y
9377 }
9378 \anchor{north east}{
9379 \northwest
9380 \pgf@x=-\pgf@x
9381 }
9382 \anchor{north west}{
9383 \northwest
9384 }
9385 \anchor{south east}{
9386 \northwest
9387 \pgf@x=-\pgf@x
9388 \pgf@y=-\pgf@y
9389 }
9390 \backgroundpath{
9391 \pgfsetcolor{\ctikzvalof{color}}
9392
9393 \northwest
9394 \pgf@circ@res@up = \pgf@y
9395 \pgf@circ@res@down = -\pgf@y
9396 \pgf@circ@res@right = -\pgf@x
9397 \pgf@circ@res@left = \pgf@x
9398 \pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
9399
9400
9401 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9402 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9403 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9404 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9405
9406 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9407 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9408
9409 \pgfusepath{draw}
9410
9411 \pgfscope
9412 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9413 \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
9414 \endpgfscope
9415 \pgfscope
9416 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9417 \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
9418 \endpgfscope
9419 \pgfscope
9420 \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
9421 \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
9422 \endpgfscope
9423
9424 \pgfscope
9425 \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
9426 \pgfpathlineto{
9427 \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
9428 {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
9429 }
9430 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9431 \pgfusepath{draw}
9432 \endpgfscope
9433 }
9434 }
9435
9436
9437 % cute switch "node" shapes, matching with cute "to" shapes
9438 % #1 -> name
9439 % #2 -> barposition
9440 % #3 -> arrowcode
9441 \long\def\pgfcircdeclarecutespdt#1#2#3{
9442 \pgfdeclareshape{#1}
9443 {
9444 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
9445 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9446 \savedanchor\northwest{%
9447 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9448 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
9449 \pgf@y=.5\pgf@y
9450 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
9451 \pgf@x=.25\pgf@x
9452 }
9453 \savedanchor\midlever{
9454 % these values are calculated when we create the definition of the shape.
9455 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9456 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
9457 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
9458 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
9459 \pgf@circ@res@down = -.5\pgf@y
9460 \pgf@circ@res@up = .5\pgf@y
9461 \pgfextracty{\pgf@circ@res@other}{#2}
9462 \pgf@x=0pt
9463 \pgf@y=.5\pgf@circ@res@other
9464 }
9465 % radius of the connector
9466 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
9467 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
9468 % shapename
9469 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
9470 % shape type
9471 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
9472 % mid of the lever, to stack switches
9473 \anchor{mid}{\midlever}
9474 % center anchors
9475 \anchor{cin}{ \northwest \pgf@y=0pt}
9476 \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
9477 \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
9478 % horizontal angles
9479 \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
9480 \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
9481 \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
9482
9483 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
9484 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
9485 \anchor{west}{ \northwest \pgf@y=0pt }
9486 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
9487 \anchor{north}{ \northwest \pgf@x=0pt }
9488 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
9489 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
9490 \anchor{north west}{ \northwest }
9491 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
9492
9493 \backgroundpath{
9494 \pgfsetcolor{\ctikzvalof{color}}
9495 \northwest
9496 \pgf@circ@res@up = \pgf@y
9497 \pgf@circ@res@down = -\pgf@y
9498 \pgf@circ@res@right = -\pgf@x
9499 \pgf@circ@res@left = \pgf@x
9500
9501 \pgfscope
9502 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
9503 \pgf@circ@res@temp=\radius\relax
9504 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
9505 \pgfsetlinewidth{2\pgf@circ@res@temp}
9506 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9507 \pgfpathlineto{#2}
9508 \pgfsetroundcap\pgfusepath{draw}
9509 \endpgfscope
9510 \pgfscope % arrow
9511 #3
9512 \endpgfscope
9513 % terminals
9514 \pgfscope
9515 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9516 \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
9517 \endpgfscope
9518 \pgfscope
9519 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9520 \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
9521 \endpgfscope
9522 \pgfscope
9523 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
9524 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
9525 \endpgfscope
9526
9527 }
9528 }
9529 }
9530
9531 \pgfcircdeclarecutespdt{cute spdt up}
9532 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
9533 {}
9534
9535 \pgfcircdeclarecutespdt{cute spdt mid}
9536 {\pgfpoint{\pgf@circ@res@right}{0pt}}
9537 {}
9538
9539 \pgfcircdeclarecutespdt{cute spdt down}
9540 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
9541 {}
9542
9543 \pgfcircdeclarecutespdt{cute spdt up arrow}
9544 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
9545 {
9546 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9547 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9548 \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
9549 \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
9550 \pgfsetarrowsend{latexslim}
9551 \pgfusepath{draw}
9552 }
9553
9554 \pgfcircdeclarecutespdt{cute spdt mid arrow}
9555 {\pgfpoint{\pgf@circ@res@right}{0pt}}
9556 {
9557 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9558 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9559 \pgfsetarrowsstart{latexslim}
9560 \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
9561 \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
9562 \pgfsetarrowsend{latexslim}
9563 \pgfusepath{draw}
9564 }
9565
9566 \pgfcircdeclarecutespdt{cute spdt down arrow}
9567 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
9568 {
9569 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9570 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9571 \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
9572 \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
9573 \pgfsetarrowsend{latexslim}
9574 \pgfusepath{draw}
9575 }
9576
9577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9579 %%
9580 %% Logic ports
9581 %%
9582 %% Code from John Kormylo at tex.stackexchange.com
9583 %% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
9584 %% Integration and fixes from Romano Giannetti and TheTeXnician <[email protected]>
9585 %%
9586
9587 \newcount\pgf@circ@res@count% reserve global register
9588
9589 \def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
9590 {%
9591 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9592 \step
9593 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9594 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9595 }%
9596
9597 % #1 = \pgfmathcounter #2=type #3 specificic port
9598 % type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
9599 \def\pgf@circ@logicport@baseinput#1#2#3%
9600 {%
9601 % and and nand
9602 \ifnum #2=1\relax
9603 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9604 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9605 \step
9606 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9607 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9608 \pgf@x=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@left
9609 \fi
9610 % or and nor
9611 \ifnum #2=2\relax
9612 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9613 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9614 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9615 \step
9616 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9617 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9618 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american #3 port/angle}}%
9619 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9620 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9621 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9622 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9623 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9624 \pgf@circ@res@temp=\pgf@y
9625 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9626 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9627 \pgf@x=\pgf@circ@res@other
9628 \fi
9629 % xor and xnor
9630 \ifnum #2=3\relax
9631 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9632 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9633 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9634 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
9635 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9636 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9637 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9638 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9639 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9640 \pgf@circ@res@temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf@circ@res@right
9641 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9642 % this compensates for the effect of the line width on the gap between the arcs
9643 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9644 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9645
9646 \step
9647 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9648 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9649 \pgf@circ@res@temp=\pgf@y
9650 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9651 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9652 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9653 \pgf@x=\pgf@circ@res@other
9654 \fi
9655 % european
9656 \ifnum #2=4\relax
9657 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9658 \pgfextractx{\pgf@circ@res@other}{\left}%
9659 \step
9660 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9661 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9662 \pgf@x=\pgf@circ@res@other
9663 \fi
9664 }%
9665
9666 %%% american
9667 \long\def\pgfcircdeclarelogicport#1#2#3{%
9668 \pgfdeclareshape{american #1 port}%
9669 {%
9670 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9671 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9672 \savedmacro\resize{% automatic
9673 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9674 \pgf@circ@res@up = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9675 \pgf@circ@res@up = .5\pgf@circ@res@up
9676 \pgf@circ@res@down = -\pgf@circ@res@up
9677 \pgf@circ@res@right = \ctikzvalof{tripoles/american #1 port/width}\pgf@circ@scaled@Rlen
9678 \pgf@circ@res@right = .5\pgf@circ@res@right
9679 \pgf@circ@res@left = -\pgf@circ@res@right
9680 }%
9681 \savedmacro\inputs{% get number of inputs
9682 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9683 \ifnum\pgf@circ@res@count=0
9684 \pgf@circ@res@count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
9685 \fi
9686 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9687 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9688 \def\inputs{\the\pgf@circ@res@count}%
9689 }%
9690 \savedanchor\step{% 1/2 gap at edges
9691 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9692 \pgf@circ@res@step = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9693 \divide\pgf@circ@res@step by \pgf@circ@res@count
9694 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9695 }%
9696 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9697 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
9698 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
9699 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
9700 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
9701
9702 \anchor{center}{\origin}% for backwards compatibility
9703 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
9704
9705 % create input anchors
9706 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
9707 \pgfmathloop%
9708 \ifnum\pgfmathcounter>\pgf@circ@res@count%
9709 \else%
9710 %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
9711 \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
9712 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9713 }%
9714 \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
9715 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
9716 }%
9717 %}{}%
9718 \repeatpgfmathloop%
9719 }
9720
9721 \anchor{out}{\northeast\pgf@y=0pt}
9722 \anchor{bout}{\right\pgf@y=0pt}
9723
9724
9725 \anchor{left}{\left}% edges of component minus leads
9726 \anchor{right}{\right}
9727
9728 \anchor{north east}{\northeast}% see \Compass macro
9729 \anchor{south west}{\southwest}
9730 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9731 \pgfpoint{0cm}{\pgf@circ@res@up}}
9732 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9733 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9734 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9735 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9736 \pgfpoint{\pgf@circ@res@left}{0cm}}
9737 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9738 \pgfpoint{0cm}{\pgf@circ@res@down}}
9739 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9740 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9741 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9742 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
9743 \pgfpoint{\pgf@circ@res@right}{0cm}}
9744
9745 \backgroundpath{
9746 \pgfsetcolor{\ctikzvalof{color}}
9747 #3
9748 }
9749 }
9750 }
9751 %%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9752 \pgfcircdeclarelogicport{and}{1}{
9753 \pgfextracty{\pgf@circ@res@temp}{\step}%
9754 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9755 \pgf@circ@res@count = \inputs\relax
9756 \ifpgfcirc@draw@leads
9757 %input leads
9758 \loop\ifnum\pgf@circ@res@count>0
9759 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9760 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9761 \pgfpathlineto{\pgfpoint
9762 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left}
9763 {\pgf@circ@res@temp}}
9764 \advance\pgf@circ@res@count by -1
9765 \repeat
9766 \fi
9767 % output lead
9768 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9769 \pgfpathlineto{\pgfpoint
9770 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
9771 {0pt}}
9772 \pgfusepath{draw}
9773
9774
9775 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9776 \pgf@circ@res@other=\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left
9777
9778 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
9779 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
9780 \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
9781 \pgfpathclose
9782 \pgf@circ@draworfill
9783 }
9784 %%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9785 \pgfcircdeclarelogicport{nand}{1}{
9786 \pgfextracty{\pgf@circ@res@temp}{\step}%
9787 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9788 \pgf@circ@res@count = \inputs\relax
9789 \ifpgfcirc@draw@leads
9790 %input leads
9791 \loop\ifnum\pgf@circ@res@count>0
9792 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9793 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9794 \pgfpathlineto{\pgfpoint
9795 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@left}
9796 {\pgf@circ@res@temp}}
9797 \advance\pgf@circ@res@count by -1
9798 \repeat
9799 \fi
9800
9801 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9802 \pgfpathlineto{\pgfpoint
9803 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
9804
9805 \pgfusepath{draw}
9806 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9807 \pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
9808 \pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
9809 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9810
9811 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9812 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9813 \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
9814 \pgfpathclose
9815
9816 \pgfpathellipse
9817 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@step}{0pt}}
9818 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9819 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9820
9821 \pgf@circ@draworfill
9822 }
9823 %%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9824 \pgfcircdeclarelogicport{nor}{2}{
9825 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9826 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/inner}\pgf@circ@res@right
9827 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9828 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9829 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9830 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9831
9832 \pgfextracty{\pgf@circ@res@temp}{\step}%
9833 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9834 \pgf@circ@res@count = \inputs\relax
9835 \ifpgfcirc@draw@leads
9836 %input leads
9837 \loop\ifnum\pgf@circ@res@count>0
9838 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9839 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9840 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9841 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9842 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9843 \advance\pgf@circ@res@count by -1
9844 \repeat
9845 \fi
9846
9847 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9848 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9849 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9850
9851 \pgfusepath{draw}
9852
9853 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9854
9855 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9856 \pgf@circ@res@step = \ctikzvalof{tripoles/american nor port/circle width}\pgf@circ@res@right
9857 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9858 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9859
9860 % main shape
9861 \ifpgfcirc@roundy@or@shapes
9862 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9863 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9864 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9865 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9866 \pgfpathclose
9867 \else
9868 \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9869 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9870 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9871 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
9872 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9873 \pgfpathclose
9874 \fi
9875
9876 % not dot
9877 \pgfpathellipse
9878 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9879 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9880 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9881
9882 \pgf@circ@draworfill
9883 }
9884 %%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9885 \pgfcircdeclarelogicport{or}{2}{
9886 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9887 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/inner}\pgf@circ@res@right
9888 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9889 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9890 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9891 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9892
9893 \pgfextracty{\pgf@circ@res@temp}{\step}%
9894 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9895 \pgf@circ@res@count = \inputs\relax
9896 \ifpgfcirc@draw@leads
9897 %input leads
9898 \loop\ifnum\pgf@circ@res@count>0
9899 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9900 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9901 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9902 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9903 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9904 \advance\pgf@circ@res@count by -1
9905 \repeat
9906 \fi
9907
9908 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9909 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9910 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9911
9912 \pgfusepath{draw}
9913
9914 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9915
9916 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9917
9918 % main shape
9919 \ifpgfcirc@roundy@or@shapes
9920 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9921 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9922 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9923 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9924 \pgfpathclose
9925 \else
9926 \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9927 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9928 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9929 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
9930 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9931 \pgfpathclose
9932 \fi
9933
9934 \pgf@circ@draworfill
9935 }
9936 %%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9937 \pgfcircdeclarelogicport{xor}{3}{
9938 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
9939 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/inner}\pgf@circ@res@right
9940 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9941 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9942 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9943 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9944 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
9945 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9946 % this compensates for the effect of the line width on the gap between the arcs
9947 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9948 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9949
9950 \pgfextracty{\pgf@circ@res@temp}{\step}%
9951 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9952 \pgf@circ@res@count = \inputs\relax
9953 \ifpgfcirc@draw@leads
9954 %input leads
9955 \loop\ifnum\pgf@circ@res@count>0
9956 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9957 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9958 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9959 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9960 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9961 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9962 \advance\pgf@circ@res@count by -1
9963 \repeat
9964 \fi
9965
9966 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9967 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9968 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9969
9970 \pgfusepath{draw}
9971
9972 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9973
9974 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xor port/angle}}%
9975
9976 % main shape
9977 \ifpgfcirc@roundy@or@shapes
9978 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9979 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9980 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9981 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9982 \pgfpathclose
9983 \else
9984 \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9985 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9986 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9987 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
9988 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
9989 \pgfpathclose
9990 \fi
9991 \pgf@circ@draworfill
9992
9993 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9994
9995 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9996 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9997
9998 \pgfusepath{draw}
9999 }
10000 %%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10001 \pgfcircdeclarelogicport{xnor}{3}{
10002 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
10003 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/inner}\pgf@circ@res@right
10004 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
10005 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
10006 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
10007 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
10008 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
10009 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
10010 % this compensates for the effect of the line width on the gap between the arcs
10011 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
10012 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
10013
10014 \pgfextracty{\pgf@circ@res@temp}{\step}%
10015 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
10016 \pgf@circ@res@count = \inputs\relax
10017 \ifpgfcirc@draw@leads
10018 %input leads
10019 \loop\ifnum\pgf@circ@res@count>0
10020 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
10021 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
10022 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
10023 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
10024 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
10025 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
10026 \advance\pgf@circ@res@count by -1
10027 \repeat
10028 \fi
10029
10030 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
10031 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10032 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
10033
10034 \pgfusepath{draw}
10035
10036 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10037
10038 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xnor port/angle}}%
10039 \pgf@circ@res@step = \ctikzvalof{tripoles/american xnor port/circle width}\pgf@circ@res@right
10040 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
10041 \advance\pgf@circ@res@other by -\pgf@circ@res@step
10042
10043 % main shape
10044 \ifpgfcirc@roundy@or@shapes
10045 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
10046 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
10047 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
10048 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
10049 \pgfpathclose
10050 \else
10051 \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
10052 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
10053 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
10054 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@other}{0pt}}
10055 \pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@right}{0.5\pgf@circ@res@up}}{\pgfpoint{0.3\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@up}}
10056 \pgfpathclose
10057 \fi
10058
10059 \pgfpathellipse
10060 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
10061 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
10062 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
10063 \pgf@circ@draworfill
10064
10065 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@left
10066 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
10067
10068 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
10069 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
10070
10071 \pgfusepath{draw}
10072 }
10073
10074 %%% Original one-input ports
10075
10076 \pgfdeclareshape{american not port}{
10077 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10078 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10079 \anchor{center}{\pgfpointorigin}
10080 \savedanchor\northwest{%
10081 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10082 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
10083 \pgf@y=.5\pgf@y
10084 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
10085 \pgf@x=.5\pgf@x
10086 }
10087 \anchor{in}{
10088 \northwest
10089 \pgf@y=0pt
10090 }
10091 \anchor{in 1}{
10092 \northwest
10093 \pgf@y=0pt
10094 }
10095 \anchor{bin}{
10096 \northwest
10097 \pgf@y=0pt
10098 }
10099 \anchor{bin 1}{
10100 \northwest
10101 \pgf@y=0pt
10102 \pgf@x=0.7\pgf@x
10103 }
10104 \anchor{out}{
10105 \northwest
10106 \pgf@y=0pt
10107 \pgf@x=-\pgf@x
10108 }
10109 \anchor{bout}{
10110 \northwest
10111 \pgf@y=0pt
10112 \pgf@x=-0.7\pgf@x
10113 }
10114 \anchor{center}{
10115 \pgfpointorigin
10116 }
10117 \anchor{east}{
10118 \northwest
10119 \pgf@y=0pt
10120 \pgf@x=-\pgf@x
10121 }
10122 \anchor{west}{
10123 \northwest
10124 \pgf@y=0pt
10125 }
10126 \anchor{south}{
10127 \northwest
10128 \pgf@x=0pt
10129 \pgf@y=-\pgf@y
10130 }
10131 \anchor{north}{
10132 \northwest
10133 \pgf@x=0pt
10134 }
10135 \anchor{south west}{
10136 \northwest
10137 \pgf@y=-\pgf@y
10138 }
10139 \anchor{north east}{
10140 \northwest
10141 \pgf@x=-\pgf@x
10142 }
10143 \anchor{north west}{
10144 \northwest
10145 }
10146 \anchor{south east}{
10147 \northwest
10148 \pgf@x=-\pgf@x
10149 \pgf@y=-\pgf@y
10150 }
10151 \backgroundpath{
10152 \pgfsetcolor{\ctikzvalof{color}}
10153
10154 \northwest
10155 \pgf@circ@res@up = \pgf@y
10156 \pgf@circ@res@down = -\pgf@y
10157 \pgf@circ@res@right = -\pgf@x
10158 \pgf@circ@res@left = \pgf@x
10159
10160 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
10161
10162 \pgfscope
10163 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10164 \pgftransformxshift{.7\pgf@circ@res@left}
10165 \pgf@circ@res@step=\pgf@circ@res@right
10166 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10167 \pgf@circ@res@step=.7\pgf@circ@res@step
10168
10169 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10170 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10171 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10172 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10173 \pgf@circ@draworfill
10174 \pgfpathellipse
10175 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
10176 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
10177 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
10178 \pgf@circ@draworfill
10179 \endpgfscope
10180
10181 \ifpgfcirc@draw@leads
10182 %input leads
10183 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10184 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10185 \fi
10186
10187 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10188 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10189
10190 \pgfusepath{draw}
10191 }
10192 }
10193
10194 \pgfdeclareshape{american buffer port}{
10195 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10196 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10197 \anchor{center}{\pgfpointorigin}
10198 \savedanchor\northwest{%
10199 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10200 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
10201 \pgf@y=.5\pgf@y
10202 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
10203 \pgf@x=.5\pgf@x
10204 }
10205 \anchor{in}{
10206 \northwest
10207 \pgf@y=0pt
10208 }
10209 \anchor{in 1}{
10210 \northwest
10211 \pgf@y=0pt
10212 }
10213 \anchor{bin}{
10214 \northwest
10215 \pgf@y=0pt
10216 }
10217 \anchor{bin 1}{
10218 \northwest
10219 \pgf@y=0pt
10220 \pgf@x=0.7\pgf@x
10221 }
10222 \anchor{out}{
10223 \northwest
10224 \pgf@y=0pt
10225 \pgf@x=-\pgf@x
10226 }
10227 \anchor{bout}{
10228 \northwest
10229 \pgf@y=0pt
10230 \pgf@x=-0.7\pgf@x
10231 }
10232 \anchor{center}{
10233 \pgfpointorigin
10234 }
10235 \anchor{east}{
10236 \northwest
10237 \pgf@y=0pt
10238 \pgf@x=-\pgf@x
10239 }
10240 \anchor{west}{
10241 \northwest
10242 \pgf@y=0pt
10243 }
10244 \anchor{south}{
10245 \northwest
10246 \pgf@x=0pt
10247 \pgf@y=-\pgf@y
10248 }
10249 \anchor{north}{
10250 \northwest
10251 \pgf@x=0pt
10252 }
10253 \anchor{south west}{
10254 \northwest
10255 \pgf@y=-\pgf@y
10256 }
10257 \anchor{north east}{
10258 \northwest
10259 \pgf@x=-\pgf@x
10260 }
10261 \anchor{north west}{
10262 \northwest
10263 }
10264 \anchor{south east}{
10265 \northwest
10266 \pgf@x=-\pgf@x
10267 \pgf@y=-\pgf@y
10268 }
10269 \backgroundpath{
10270 \pgfsetcolor{\ctikzvalof{color}}
10271
10272 \northwest
10273 \pgf@circ@res@up = \pgf@y
10274 \pgf@circ@res@down = -\pgf@y
10275 \pgf@circ@res@right = -\pgf@x
10276 \pgf@circ@res@left = \pgf@x
10277
10278 \pgfscope
10279 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10280 \pgftransformxshift{.7\pgf@circ@res@left}
10281 \pgf@circ@res@step=\pgf@circ@res@right
10282 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10283 \pgf@circ@res@step=.7\pgf@circ@res@step
10284
10285 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10286 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10287 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10288 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10289 \pgf@circ@draworfill
10290 \endpgfscope
10291
10292 \ifpgfcirc@draw@leads
10293 %input leads
10294 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10295 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10296 \fi
10297
10298 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10299 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10300
10301 \pgfusepath{draw}
10302 }
10303 }
10304 \pgfdeclareshape{invschmitt}{
10305 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10306 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10307 \anchor{center}{\pgfpointorigin}
10308 \savedanchor\northwest{%
10309 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10310 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
10311 \pgf@y=.5\pgf@y
10312 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
10313 \pgf@x=.5\pgf@x
10314 }
10315 \anchor{in}{
10316 \northwest
10317 \pgf@y=0pt
10318 }
10319 \anchor{in 1}{
10320 \northwest
10321 \pgf@y=0pt
10322 }
10323 \anchor{bin}{
10324 \northwest
10325 \pgf@y=0pt
10326 \pgf@x=0.7\pgf@x
10327 }
10328 \anchor{bin 1}{
10329 \northwest
10330 \pgf@y=0pt
10331 \pgf@x=0.7\pgf@x
10332 }
10333 \anchor{out}{
10334 \northwest
10335 \pgf@y=0pt
10336 \pgf@x=-\pgf@x
10337 }
10338 \anchor{bout}{
10339 \northwest
10340 \pgf@y=0pt
10341 \pgf@x=-0.7\pgf@x
10342 }
10343 \anchor{center}{
10344 \pgfpointorigin
10345 }
10346 \anchor{east}{
10347 \northwest
10348 \pgf@y=0pt
10349 \pgf@x=-\pgf@x
10350 }
10351 \anchor{west}{
10352 \northwest
10353 \pgf@y=0pt
10354 }
10355 \anchor{south}{
10356 \northwest
10357 \pgf@x=0pt
10358 \pgf@y=-\pgf@y
10359 }
10360 \anchor{north}{
10361 \northwest
10362 \pgf@x=0pt
10363 }
10364 \anchor{south west}{
10365 \northwest
10366 \pgf@y=-\pgf@y
10367 }
10368 \anchor{north east}{
10369 \northwest
10370 \pgf@x=-\pgf@x
10371 }
10372 \anchor{north west}{
10373 \northwest
10374 }
10375 \anchor{south east}{
10376 \northwest
10377 \pgf@x=-\pgf@x
10378 \pgf@y=-\pgf@y
10379 }
10380 \backgroundpath{
10381 \pgfsetcolor{\ctikzvalof{color}}
10382
10383 \northwest
10384 \pgf@circ@res@up = \pgf@y
10385 \pgf@circ@res@down = -\pgf@y
10386 \pgf@circ@res@right = -\pgf@x
10387 \pgf@circ@res@left = \pgf@x
10388
10389 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
10390
10391 \pgfscope
10392 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10393 \pgftransformxshift{.7\pgf@circ@res@left}
10394 \pgf@circ@res@step=\pgf@circ@res@right
10395 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10396 \pgf@circ@res@step=.7\pgf@circ@res@step
10397
10398 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10399 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10400 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10401 \pgfpathclose
10402 \pgf@circ@draworfill
10403 \pgfpathellipse
10404 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
10405 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
10406 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
10407 \pgf@circ@draworfill
10408 \endpgfscope
10409
10410 \ifpgfcirc@draw@leads
10411 %input leads
10412 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10413 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10414 \fi
10415
10416 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10417 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10418 \pgfusepath{draw}
10419 %draw inner shape
10420
10421 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10422
10423 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10424 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10425 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10426 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10427 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10428 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10429 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10430 \pgfusepath{draw}
10431
10432 }
10433 }
10434
10435 \pgfdeclareshape{schmitt}{
10436 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10437 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10438 \anchor{center}{\pgfpointorigin}
10439 \savedanchor\northwest{%
10440 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10441 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
10442 \pgf@y=.5\pgf@y
10443 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
10444 \pgf@x=.5\pgf@x
10445 }
10446 \anchor{in}{
10447 \northwest
10448 \pgf@y=0pt
10449 }
10450 \anchor{in 1}{
10451 \northwest
10452 \pgf@y=0pt
10453 }
10454 \anchor{bin}{
10455 \northwest
10456 \pgf@y=0pt
10457 \pgf@x=0.7\pgf@x
10458 }
10459 \anchor{bin 1}{
10460 \northwest
10461 \pgf@y=0pt
10462 \pgf@x=0.7\pgf@x
10463 }
10464 \anchor{out}{
10465 \northwest
10466 \pgf@y=0pt
10467 \pgf@x=-\pgf@x
10468 }
10469 \anchor{bout}{
10470 \northwest
10471 \pgf@y=0pt
10472 \pgf@x=-.7\pgf@x
10473 }
10474 \anchor{center}{
10475 \pgfpointorigin
10476 }
10477 \anchor{east}{
10478 \northwest
10479 \pgf@y=0pt
10480 \pgf@x=-\pgf@x
10481 }
10482 \anchor{west}{
10483 \northwest
10484 \pgf@y=0pt
10485 }
10486 \anchor{south}{
10487 \northwest
10488 \pgf@x=0pt
10489 \pgf@y=-\pgf@y
10490 }
10491 \anchor{north}{
10492 \northwest
10493 \pgf@x=0pt
10494 }
10495 \anchor{south west}{
10496 \northwest
10497 \pgf@y=-\pgf@y
10498 }
10499 \anchor{north east}{
10500 \northwest
10501 \pgf@x=-\pgf@x
10502 }
10503 \anchor{north west}{
10504 \northwest
10505 }
10506 \anchor{south east}{
10507 \northwest
10508 \pgf@x=-\pgf@x
10509 \pgf@y=-\pgf@y
10510 }
10511 \backgroundpath{
10512 \pgfsetcolor{\ctikzvalof{color}}
10513
10514
10515 \northwest
10516 \pgf@circ@res@up = \pgf@y
10517 \pgf@circ@res@down = -\pgf@y
10518 \pgf@circ@res@right = -\pgf@x
10519 \pgf@circ@res@left = \pgf@x
10520
10521 \pgfscope
10522 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10523 \pgftransformxshift{.7\pgf@circ@res@left}
10524 \pgf@circ@res@step=\pgf@circ@res@right
10525 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10526 \pgf@circ@res@step=.7\pgf@circ@res@step
10527
10528 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10529 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10530 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10531 \pgfpathclose
10532 \pgf@circ@draworfill
10533 \endpgfscope
10534
10535 \ifpgfcirc@draw@leads
10536 %input leads
10537 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10538 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10539 \fi
10540
10541 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10542 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
10543 \pgfusepath{draw}
10544 %draw inner shape
10545
10546 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10547
10548 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10549 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10550 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10551 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10552 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10553 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10554 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10555 \pgfusepath{draw}
10556
10557 }
10558 }
10559
10560
10561 %%% start european logic ports, from John Kormylo
10562 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10563 %%
10564
10565 % #1 - name
10566 % #2 - text inside
10567 % #3 - number of inputs
10568 % #4 = is it a not?
10569
10570 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
10571 \pgfdeclareshape{european #1 port}
10572 {
10573 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10574 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10575 \savedmacro\resize{% automatic
10576 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10577 \pgf@circ@res@up = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
10578 \pgf@circ@res@up = .5\pgf@circ@res@up
10579 \pgf@circ@res@down = -\pgf@circ@res@up
10580 \pgf@circ@res@right = \ctikzvalof{tripoles/european #1 port/width}\pgf@circ@scaled@Rlen
10581 \pgf@circ@res@right = .5\pgf@circ@res@right
10582 \pgf@circ@res@left = -\pgf@circ@res@right
10583 }%
10584 \savedmacro\inputs{% get number of inputs
10585 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
10586 \ifnum\pgf@circ@res@count=0
10587 \pgf@circ@res@count=\ctikzvalof{tripoles/european #1 port/inputs}\relax%
10588 \fi
10589 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
10590 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
10591 \def\inputs{\the\pgf@circ@res@count}%
10592 }%
10593 \savedanchor\step{% 1/2 gap at edges
10594 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10595 \pgf@circ@res@step = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
10596 \divide\pgf@circ@res@step by #3
10597 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
10598 }%
10599 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
10600 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
10601 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
10602 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
10603 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
10604
10605 \anchor{center}{\origin}% for backwards compatibility
10606 % the text anchor overlaps the logic symbol
10607 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
10608 % create input anchors
10609 \ifnum#3=1\relax
10610 \anchor{in}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
10611 \anchor{in 1}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
10612 \anchor{bin}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
10613 \anchor{bin 1}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
10614 \else
10615 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
10616 \pgfmathloop%
10617 \ifnum\pgfmathcounter>#3%
10618 \else%
10619 %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
10620 \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
10621 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
10622 }%
10623 \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
10624 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
10625 }%
10626 %}{}%
10627 \repeatpgfmathloop%
10628 }
10629 \fi
10630 \anchor{out}{\northeast\pgf@y=0pt}
10631 \anchor{bout}{\right\pgf@y=0pt}
10632
10633 \anchor{left}{\left}% edges of component minus leads
10634 \anchor{right}{\right}
10635
10636 \anchor{north east}{\northeast}% see \Compass macro
10637 \anchor{south west}{\southwest}
10638 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
10639 \pgfpoint{0cm}{\pgf@circ@res@up}}
10640 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
10641 \pgfextractx{\pgf@circ@res@left}{\southwest}%
10642 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
10643 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
10644 \pgfpoint{\pgf@circ@res@left}{0cm}}
10645 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10646 \pgfpoint{0cm}{\pgf@circ@res@down}}
10647 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10648 \pgfextractx{\pgf@circ@res@right}{\northeast}%
10649 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
10650 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
10651 \pgfpoint{\pgf@circ@res@right}{0cm}}
10652
10653 \backgroundpath{
10654 \pgfsetcolor{\ctikzvalof{color}}
10655 \pgfscope
10656 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10657 \pgfpathrectanglecorners
10658 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
10659 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
10660 \pgf@circ@draworfill
10661 \endpgfscope
10662 \ifpgfcirc@draw@leads
10663 %input leads
10664 \ifnum#3=1\relax
10665 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
10666 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
10667 \else
10668 \pgfextracty{\pgf@circ@res@temp}{\step}%
10669 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
10670 %\pgf@circ@res@count = #3\relax% redundant
10671 \loop\ifnum\pgf@circ@res@count>0
10672 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
10673 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
10674 \pgfpathlineto{\pgfpoint
10675 {\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}
10676 {\pgf@circ@res@temp}}
10677 \advance\pgf@circ@res@count by -1
10678 \repeat
10679 \fi
10680 \fi
10681 %
10682 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10683 \pgfpathlineto{%
10684 \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
10685 %
10686 \edef\pgf@temp{not}
10687 \edef\pgf@circ@temp{#4}
10688 \ifx\pgf@temp\pgf@circ@temp % is a not
10689 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
10690 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}%
10691 {\ctikzvalof{tripoles/european #1 port/not height}\pgf@circ@res@up}}
10692 \fi
10693 %
10694 \pgfusepath{draw}
10695 %
10696 \pgfpathmoveto{\pgfpointorigin}
10697 \pgftext{#2}
10698 }
10699 }
10700 }
10701 \pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
10702 \pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
10703 \pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
10704 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
10705 \pgfcircdeclareeurologicport{buffer}{$1$}{1}{}
10706 \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
10707 \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
10708 \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
10709
10710 %% end european logic ports
10711
10712 %%%%%%%%%%%%%%%%%%%%%%%%
10713 %% Transistors
10714 %%%%%%%%%%%%%%%%%%%%%%%%
10715
10716
10717 \long\def\pgfcircdeclaretransistor#1#2#3{
10718 \pgfdeclareshape{#1}
10719 {
10720 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
10721 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10722 \anchor{center}{
10723 \pgfpointorigin
10724 }
10725 \savedanchor\northeast{% upper right
10726 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10727 \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen
10728 \pgf@y=.5\pgf@y
10729 \pgf@x=0pt
10730 }
10731 \savedanchor\left{%center left
10732 \pgf@y=0pt
10733 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10734 \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
10735 }
10736 \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0
10737 \pgf@y=0pt
10738 \pgf@x=0pt
10739 }
10740 \anchor{text}{
10741 \northeast
10742 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10743 \ifpgf@circuit@transisors@fixlabels
10744 \ifpgf@circuit@fet@bodydiode
10745 % try to put the text to the right of the flyback diode
10746 \pgfmathsetlength{\pgf@circ@res@other}{(
10747 \ctikzvalof{tripoles/#1/bodydiode distance}*
10748 \ctikzvalof{tripoles/#1/width} +
10749 \ctikzvalof{tripoles/#1/bodydiode scale}*
10750 \ctikzvalof{bipoles/diode/height}/2
10751 )*\pgf@circ@scaled@Rlen}
10752 \advance\pgf@x by \pgf@circ@res@other
10753 \fi
10754 % add a bit of space to avoid central (substrate) terminal if drawn
10755 \advance\pgf@x by 0.05\pgf@circ@scaled@Rlen\relax
10756 \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
10757 \else
10758 \pgf@y=.7\pgf@y
10759 \pgf@x= \pgf@circ@scaled@Rlen
10760 \pgf@x=0.1\pgf@x
10761 \fi
10762 }
10763 \anchor{pathstart}{ % south
10764 \northeast
10765 \pgf@y=-\pgf@y
10766 }
10767 \anchor{pathend}{
10768 \northeast
10769 }
10770 \anchor{north}{
10771 \northeast
10772 \pgf@circ@res@step=\pgf@y
10773 \left
10774 \pgf@y=\pgf@circ@res@step
10775 \pgf@x=.5\pgf@x
10776 }
10777 \anchor{west}{
10778 \left
10779 }
10780 \anchor{east}{
10781 \northeast
10782 \pgf@y=0pt
10783 }
10784 \anchor{south}{
10785 \northeast
10786 \pgf@circ@res@step=\pgf@y
10787 \left
10788 \pgf@y=-\pgf@circ@res@step
10789 \pgf@x=.5\pgf@x
10790 }
10791 \anchor{south west}{
10792 \northeast
10793 \pgf@circ@res@step=\pgf@y
10794 \left
10795 \pgf@y=-\pgf@circ@res@step
10796 }
10797 \anchor{north east}{
10798 \northeast
10799 }
10800 \anchor{north west}{
10801 \northeast
10802 \pgf@circ@res@step=\pgf@y
10803 \left
10804 \pgf@y=\pgf@circ@res@step
10805 }
10806 \anchor{south east}{
10807 \northeast
10808 \pgf@y=-\pgf@y
10809 }
10810 \anchor{B}{
10811 \northeast
10812 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10813 \left
10814 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10815 }
10816 \anchor{base}{
10817 \northeast
10818 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10819 \left
10820 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10821 }
10822 \anchor{bulk}{ %added by Burak Kelleci
10823 \northeast
10824 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10825 \right
10826 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10827 }
10828 \anchor{nobulk}{ %added by Burak Kelleci
10829 \left
10830 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10831 }
10832 \anchor{G}{
10833 \northeast
10834 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10835 \left
10836 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10837 }
10838 \anchor{gate}{
10839 \northeast
10840 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10841 \left
10842 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10843 }
10844 \anchor{nobase}{
10845 \left
10846 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10847 }
10848 \anchor{nogate}{
10849 \left
10850 \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
10851 }
10852 \anchor{E}{
10853 \northeast
10854 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10855 }
10856 \anchor{emitter}{
10857 \northeast
10858 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10859 }
10860 \anchor{C}{
10861 \northeast
10862 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10863 }
10864 \anchor{collector}{
10865 \northeast
10866 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10867 }
10868 \anchor{S}{
10869 \northeast
10870 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10871 }
10872 \anchor{source}{
10873 \northeast
10874 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10875 }
10876 \anchor{D}{
10877 \northeast
10878 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10879 }
10880 \anchor{drain}{
10881 \northeast
10882 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10883 }
10884 \anchor{body C in}{
10885 \northeast
10886 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10887 \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
10888 }
10889 \anchor{body E in}{
10890 \northeast
10891 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10892 \pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
10893 }
10894 \anchor{body C out}{
10895 \northeast
10896 \pgf@ya=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10897 \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
10898 \pgf@y=\pgf@ya
10899 \left
10900 \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
10901 \pgf@y=\pgf@ya
10902 }
10903 \anchor{body E out}{
10904 \northeast
10905 \pgf@ya=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10906 \pgf@ya=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@ya
10907 \pgf@y=\pgf@ya
10908 \left
10909 \pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
10910 \pgf@y=\pgf@ya
10911 }
10912 #2
10913 \backgroundpath{
10914 \pgftransformationadjustments
10915 \pgfsetcolor{\ctikzvalof{color}}
10916 %
10917 \ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
10918 \pgf@circuit@trans@ntypetrue
10919 \else
10920 \pgf@circuit@trans@ntypefalse
10921 \fi
10922 \northeast
10923 \pgf@circ@res@up = \pgf@y
10924 \pgf@circ@res@down = -\pgf@y
10925 \pgf@circ@res@right = \pgf@x
10926 \left
10927 \pgf@circ@res@left = \pgf@x
10928 \pgf@circ@scaled@Rlen=\scaledRlen
10929 %
10930 #3
10931 % BODY DIODE
10932 \ifpgf@circuit@fet@bodydiode
10933 \drawbodydiode{#1}
10934 \fi
10935 %
10936 }
10937 }
10938 }
10939
10940 \long\def\drawbodydiode#1{
10941 \pgfscope
10942 \pgftransformshift{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
10943 \pgftransformrotate{90}
10944 % diode scale and bodydiode scale interacts. We want the size of the diode
10945 % proportional to the transistor, so we will:
10946 % 1) undo diode scale 2) apply transistor scale (using the current class) 3) apply bodydiode scale
10947 \pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
10948 \pgftransformscale{\@@BDscale}
10949 \ifpgf@circuit@fulldiode
10950 \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10951 \else
10952 \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10953 \fi
10954 \endpgfscope
10955 % Draw stroke line
10956 \ifpgf@circuit@strokediode
10957 \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
10958 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10959 \pgfusepath{stroke}
10960 \fi
10961 %Draw upper connection to body diode
10962 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10963 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10964 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}
10965 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10966 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10967 \pgfusepath{draw}
10968 \pgfscope
10969 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
10970 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10971 \pgftransformscale{0.5}
10972 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10973 \endpgfscope{}
10974 %Draw lower connection to body diode
10975 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10976 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10977 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10978 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
10979 \pgfusepath{draw}
10980 \pgfscope
10981 \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10982 \pgftransformscale{0.5}
10983 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10984 \endpgfscope
10985 }
10986
10987 \long\def\declarebpt#1{
10988 \pgfcircdeclaretransistor{#1}{
10989 \anchor{inner up}{
10990 \northeast
10991 \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y
10992 }
10993 \anchor{inner down}{
10994 \northeast
10995 \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
10996 }
10997 }{
10998 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10999 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11000 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
11001 \pgfpathlineto{\pgfpoint
11002 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11003 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}}
11004 \pgfusepath{draw}
11005
11006 \pgfscope
11007 \pgfpathmoveto{\pgfpoint
11008 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11009 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
11010 \pgfpathlineto{\pgfpoint
11011 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11012 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11013 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11014 \pgfusepath{draw}
11015 \endpgfscope
11016
11017 \pgfpathmoveto{\pgfpoint
11018 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11019 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}}
11020 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11021 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11022 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11023 \pgfusepath{draw}
11024 %draw arrow depending on type of transistor
11025 \pgfscope
11026 \pgfslopedattimetrue
11027 \pgfallowupsidedownattimetrue
11028 \pgfresetnontranslationattimefalse
11029 \edef\@@anchor{center}
11030 \ifpgf@circuit@trans@ntype
11031 \ifpgf@circuit@trans@arrowatend
11032 \edef\@@anchor{btip}
11033 \pgftransformlineattime{1.0}{%
11034 \pgfpoint%
11035 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11036 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
11037 }{%
11038 \pgfpoint{\pgf@circ@res@right}%
11039 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
11040 }
11041 \else
11042 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
11043 \pgfpoint%
11044 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11045 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
11046 }{%
11047 \pgfpoint{\pgf@circ@res@right}%
11048 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
11049 }
11050 \fi
11051 \else % p-type
11052 \ifpgf@circuit@trans@arrowatend
11053 \edef\@@anchor{tip}
11054 \pgftransformlineattime{1.0}{%
11055 \pgfpoint{\pgf@circ@res@right}%
11056 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
11057 }{%
11058 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11059 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
11060 }
11061 \else
11062 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
11063 \pgfpoint{\pgf@circ@res@right}%
11064 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
11065 }{%
11066 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11067 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
11068 }
11069 \fi
11070 \fi
11071 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11072 \endpgfscope
11073
11074 \ifpgf@circuit@bpt@drawphoto
11075 \pgfscope
11076 \pgfsetarrowsstart{latexslim}
11077 \pgfpathmoveto{\pgfpointadd{\pgfpoint
11078 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11079 {\pgf@circ@res@up+\pgf@circ@res@down}}
11080 {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
11081 \pgfpathlineto{\pgfpointadd{\pgfpoint
11082 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11083 {\pgf@circ@res@up+\pgf@circ@res@down}}
11084 {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
11085 \pgfusepath{draw}
11086 \pgfpathmoveto{\pgfpointadd{\pgfpoint
11087 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11088 {\pgf@circ@res@up+\pgf@circ@res@down}}
11089 {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
11090 \pgfpathlineto{\pgfpointadd{\pgfpoint
11091 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11092 {\pgf@circ@res@up+\pgf@circ@res@down}}
11093 {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
11094 \pgfusepath{draw}
11095 \endpgfscope
11096 \else
11097 \ifpgf@circuit@bpt@drawbase
11098 \pgfpathmoveto{\pgfpoint
11099 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11100 {\pgf@circ@res@up+\pgf@circ@res@down}}
11101 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11102 \pgfusepath{draw}
11103 \fi
11104 \fi
11105 }
11106 }
11107
11108 \declarebpt{npn}
11109 \declarebpt{pnp}
11110 %
11111 % multi-emitter and multi-collector BJTs by Romano Giannetti
11112 %
11113 \def\pgf@circ@bjt@C@anchor#1{% #1: collector number
11114 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
11115 \pgfextracty{\pgf@circ@res@other}{\basedimension}
11116 \ifnum\cdir>0 % NPN, above
11117 \pgfpoint{\pgf@circ@res@temp}{%
11118 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
11119 \else % PNP, below
11120 \pgfpoint{\pgf@circ@res@temp}{%
11121 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
11122 \fi
11123 }
11124 \def\pgf@circ@bjt@E@anchor#1{% #1: collector number
11125 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
11126 \pgfextracty{\pgf@circ@res@other}{\basedimension}
11127 \ifnum\cdir<0 % PNP, above
11128 \pgfpoint{\pgf@circ@res@temp}{%
11129 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
11130 \else % PNP, below
11131 \pgfpoint{\pgf@circ@res@temp}{%
11132 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
11133 \fi
11134 }
11135
11136 \long\def\declarebjt#1{
11137 \pgfdeclareshape{bjt#1}{
11138 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
11139 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
11140 % \cdir is 1 for npn, -1 for pnp
11141 \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}}
11142 \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}}
11143 \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}}
11144 % step up or down for the additional C/Es
11145 \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{%
11146 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
11147 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
11148 \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{%
11149 \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
11150 \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1
11151 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11152 \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
11153 \pgf@y=.5\pgf@y
11154 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
11155 \pgf@x=.5\pgf@x
11156 }
11157 \savedanchor\northeast{% upper right
11158 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11159 \pgfmathsetlength{\pgf@circ@res@step}{%
11160 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
11161 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11162 \ifnum\cdir> 0
11163 \edef\numup{\numC}\edef\numdown{\numE}
11164 \else
11165 \edef\numup{\numE}\edef\numdown{\numC}
11166 \fi
11167 \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
11168 + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth
11169 + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11170 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
11171 \pgf@x=.5\pgf@x
11172 }
11173 \savedanchor\southeast{% lower right
11174 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11175 \pgfmathsetlength{\pgf@circ@res@step}{%
11176 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
11177 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11178 \ifnum\cdir> 0
11179 \edef\numup{\numC}\edef\numdown{\numE}
11180 \else
11181 \edef\numup{\numE}\edef\numdown{\numC}
11182 \fi
11183 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
11184 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
11185 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11186 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
11187 \pgf@x=.5\pgf@x
11188 }
11189 \savedanchor\southwest{% lower left
11190 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11191 \pgfmathsetlength{\pgf@circ@res@step}{%
11192 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
11193 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11194 \ifnum\cdir> 0
11195 \edef\numup{\numC}\edef\numdown{\numE}
11196 \else
11197 \edef\numup{\numE}\edef\numdown{\numC}
11198 \fi
11199 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
11200 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
11201 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11202 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen
11203 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
11204 }
11205 \anchor{center}{\pgfpointorigin}
11206 \anchor{north}{\northeast\pgf@x=0cm\relax}
11207 \anchor{east}{\northeast\pgf@y=0cm\relax}
11208 \anchor{south}{\southwest\pgf@x=0cm\relax}
11209 \anchor{west}{\southwest\pgf@y=0cm}
11210 \anchor{north east}{\northeast}
11211 \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya}
11212 \anchor{south west}{\southwest}
11213 \anchor{south east}{\southeast}
11214
11215 \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}
11216 \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
11217 \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
11218 \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x}
11219 % center of the base "bar"
11220 \anchor{cbase}{\basedimension\pgf@x=-\pgf@x
11221 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
11222 }
11223 % geometrical centers
11224 \anchor{vcenter}{\pgf@x=0cm\relax
11225 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
11226 }
11227 \anchor{gcenter}{%
11228 \northeast\pgf@xa=0.5\pgf@x
11229 \southwest\advance\pgf@xa by 0.5\pgf@x
11230 \pgf@x=\pgf@xa
11231 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
11232 }
11233 % external connections
11234 \anchor{E}{
11235 \ifnum\cdir>0% npn, emitter down
11236 \southeast
11237 \else
11238 \northeast
11239 \fi
11240 }% first emitter
11241 \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter
11242 \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
11243 \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
11244
11245 \backgroundpath{
11246 \pgftransformationadjustments
11247 \pgfsetcolor{\ctikzvalof{color}}
11248 %
11249 % set the type and up and down number of connections
11250 %
11251 \ifnum\cdir> 0
11252 \pgf@circuit@trans@ntypetrue
11253 \edef\numup{\numC}
11254 \edef\numdown{\numE}
11255 \else
11256 \pgf@circuit@trans@ntypefalse
11257 \edef\numup{\numE}
11258 \edef\numdown{\numC}
11259 \fi
11260 \basedimension
11261 \pgf@circ@res@up = \pgf@y
11262 \pgf@circ@res@down = -\pgf@y
11263 \pgf@circ@res@right = \pgf@x
11264 \pgf@circ@res@left = -\pgf@x
11265 \pgf@circ@scaled@Rlen=\scaledRlen
11266 \pgf@circ@res@step=\multistep
11267 %
11268 % set arrow positions options
11269 %
11270 \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}}
11271 \ifpgf@circuit@trans@arrowatend
11272 \edef\@@pos{1.0}
11273 \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit
11274 \edef\@@anchor{btip}
11275 \else
11276 \edef\@@anchor{tip}
11277 \fi
11278 \fi
11279 %
11280 % Drawing upper connections
11281 %
11282 \pgfscope
11283 \pgf@circ@count@a=\numup\relax
11284 \pgfmathloop%
11285 \ifnum\pgf@circ@count@a>0
11286 \advance\pgf@circ@count@a-1\relax
11287 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
11288 \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection
11289 \pgfpathmoveto{\pgfpoint
11290 {\pgf@circ@res@right}%
11291 {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
11292 \pgfpathlineto{\pgfpoint
11293 {\pgf@circ@res@right}%
11294 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
11295 \else
11296 \pgfpathmoveto{\pgfpoint
11297 {\pgf@circ@res@right}%
11298 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
11299 \fi
11300 \pgfpathlineto{\pgfpoint
11301 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
11302 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}%
11303 \pgfsetroundcap % better when connecting to sloped lines
11304 \pgfusepath{draw}
11305 \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow
11306 \pgfscope
11307 \pgfslopedattimetrue
11308 \pgfallowupsidedownattimetrue
11309 \pgfresetnontranslationattimefalse
11310 \pgftransformlineattime{\@@pos}{%
11311 \pgfpoint
11312 {\pgf@circ@res@right}%
11313 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}%
11314 }{\pgfpoint
11315 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
11316 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}%
11317 }
11318 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11319 \endpgfscope
11320 \fi
11321 \repeatpgfmathloop
11322 \endpgfscope
11323 %
11324 % Drawing base
11325 %
11326 \pgfscope
11327 \pgfpathmoveto{\pgfpoint
11328 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
11329 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}}
11330 \pgfpathlineto{\pgfpoint
11331 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
11332 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}}
11333 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11334 \pgfsetroundcap % I like it more...
11335 \pgfusepath{draw}
11336 \endpgfscope
11337 %
11338 % draw base external connection
11339 %
11340 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}}
11341 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}}
11342 \pgfusepath{draw}
11343 %
11344 % Drawing lower connections
11345 %
11346 \pgfscope
11347 \pgf@circ@count@a=\numdown\relax
11348 \pgfmathloop%
11349 \ifnum\pgf@circ@count@a>0
11350 \advance\pgf@circ@count@a-1\relax
11351 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
11352 \pgfpathmoveto{\pgfpoint
11353 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
11354 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}}
11355 \pgfpathlineto{\pgfpoint
11356 {\pgf@circ@res@right}
11357 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}}
11358 \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection
11359 \pgfpathlineto{\pgfpoint
11360 {\pgf@circ@res@right}
11361 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}}
11362 \fi
11363 \pgfsetroundcap % better when connecting to sloped lines
11364 \pgfusepath{draw}
11365 \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow
11366 \pgfscope
11367 \pgfslopedattimetrue
11368 \pgfallowupsidedownattimetrue
11369 \pgfresetnontranslationattimefalse
11370 \pgftransformlineattime{\@@pos}{%
11371 \pgfpoint
11372 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
11373 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}%
11374 }{\pgfpoint
11375 {\pgf@circ@res@right}%
11376 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}%
11377 }
11378 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11379 \endpgfscope
11380 \fi
11381 \repeatpgfmathloop
11382 \endpgfscope
11383 }
11384 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
11385 % and is executed just before a node is drawn.
11386 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{%
11387 % Start with the maximum collector number and go backwards.
11388 \pgf@circ@count@a=\numC\relax
11389 \pgfmathloop%
11390 \ifnum\pgf@circ@count@a>0
11391 % we will create two anchors per pin: the "normal one" like `pin 1` for the
11392 % electrical contact, and the "border one" like `bpin 1` for labels.
11393 % they will coincide if `external pins width` is set to 0.
11394 \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{%
11395 \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}%
11396 }
11397 \advance\pgf@circ@count@a by -1\relax%
11398 \repeatpgfmathloop%
11399 % and emitters
11400 \pgf@circ@count@a=\numE\relax
11401 \pgfmathloop%
11402 \ifnum\pgf@circ@count@a>0
11403 % we will create two anchors per pin: the "normal one" like `pin 1` for the
11404 % electrical contact, and the "border one" like `bpin 1` for labels.
11405 % they will coincide if `external pins width` is set to 0.
11406 \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{%
11407 \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}%
11408 }
11409 \advance\pgf@circ@count@a by -1\relax%
11410 \repeatpgfmathloop%
11411 }%
11412 }
11413 }
11414
11415 \declarebjt{npn}
11416 \declarebjt{pnp}
11417
11418 % end of multi-bjts
11419
11420 \long\def\declareigbt#1{
11421 \pgfcircdeclaretransistor{#1}{
11422 \anchor{inner up}{
11423 \northeast
11424 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
11425 }
11426 \anchor{inner down}{
11427 \northeast
11428 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
11429 }
11430 }
11431 {
11432 %draw upper connection
11433 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11434 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11435 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11436 \pgfpathlineto{\pgfpoint
11437 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11438 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}}
11439 \pgfusepath{draw}
11440
11441 %draw thicker gate lines
11442 \pgfscope
11443 \pgfpathmoveto{\pgfpoint
11444 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11445 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11446 \pgfpathlineto{\pgfpoint
11447 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11448 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11449 \pgfpathmoveto{\pgfpoint
11450 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11451 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11452 \pgfpathlineto{\pgfpoint
11453 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11454 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11455 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11456 \pgfusepath{draw}
11457 \endpgfscope
11458 %draw lower connection
11459 \pgfpathmoveto{\pgfpoint
11460 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11461 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}}
11462 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11463 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11464 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11465 \pgfusepath{draw}
11466 %draw arrow depending on type of transistor
11467 \pgfscope
11468 \pgfslopedattimetrue
11469 \pgfallowupsidedownattimetrue
11470 \pgfresetnontranslationattimefalse
11471 \ifpgf@circuit@trans@arrowatend
11472 \ifpgf@circuit@trans@ntype
11473 \edef\@@anchor{btip}\edef\@@pos{1.0}
11474 \else
11475 \edef\@@anchor{tip}\edef\@@pos{1.0}
11476 \fi
11477 \else
11478 \edef\@@anchor{center}\edef\@@pos{0.5}
11479 \fi
11480 \ifpgf@circuit@trans@ntype
11481 \pgftransformlineattime{\@@pos}{%
11482 \pgfpoint%
11483 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11484 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}%
11485 }{%
11486 \pgfpoint{\pgf@circ@res@right}%
11487 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}%
11488 }
11489 \else
11490 \pgftransformlineattime{\@@pos}{%
11491 \pgfpoint{\pgf@circ@res@right}%
11492 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}%
11493 }{%
11494 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11495 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}%
11496 }
11497 \fi
11498 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11499 \endpgfscope
11500 %draw gate
11501 \ifpgf@circuit@trans@ntype
11502 \pgfpathmoveto{\pgfpoint
11503 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11504 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11505 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
11506 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11507 \else
11508 \pgfpathmoveto{\pgfpoint
11509 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11510 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
11511 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
11512 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
11513 \fi
11514 \pgfusepath{draw}
11515 }
11516 }
11517
11518 \declareigbt{pigbt}
11519 \declareigbt{nigbt}
11520 \declareigbt{Lnigbt}
11521 \declareigbt{Lpigbt}
11522
11523 \pgfcircdeclaretransistor{nmos}{
11524 \anchor{inner up}{
11525 \northeast
11526 \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y
11527 }
11528 \anchor{inner down}{
11529 \northeast
11530 \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
11531 }
11532 }{%
11533 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11534 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11535 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11536 \pgfpathlineto{\pgfpoint
11537 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11538 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11539
11540 \pgfpathmoveto{\pgfpoint
11541 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11542 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11543 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11544 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11545 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11546 \pgfusepath{draw}
11547
11548 \pgfscope
11549 \pgfpathmoveto{\pgfpoint
11550 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11551 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@up}}
11552 \pgfpathlineto{\pgfpoint
11553 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11554 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@down}}
11555 \pgfpathmoveto{\pgfpoint
11556 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11557 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11558 \pgfpathlineto{\pgfpoint
11559 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11560 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11561 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11562 \pgfusepath{draw}
11563 \endpgfscope
11564 \ifpgf@circuit@mos@arrows
11565 \pgfscope
11566 \ifpgf@circuit@trans@arrowatend
11567 \pgftransformshift{\pgfpoint
11568 {\pgf@circ@res@right}%
11569 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}%
11570 }
11571 \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}}
11572 \else
11573 \pgfslopedattimetrue
11574 \pgfallowupsidedownattimetrue
11575 \pgfresetnontranslationattimefalse
11576 \pgftransformlineattime{\ctikzvalof{tripoles/nmos/arrow pos}}{%
11577 \pgfpoint%
11578 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}%
11579 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
11580 }{%
11581 \pgfpoint
11582 {\pgf@circ@res@right}%
11583 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
11584 }
11585 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
11586 \fi
11587 \endpgfscope
11588 \fi
11589
11590 \ifpgf@circuit@bpt@drawgate
11591 \pgfpathmoveto{\pgfpoint
11592 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11593 {\pgf@circ@res@up+\pgf@circ@res@down}}
11594 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11595 \pgfusepath{draw}
11596 \fi
11597
11598 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
11599 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11600 {\pgf@circ@res@up+\pgf@circ@res@down}}
11601 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11602 {\pgf@circ@res@up+\pgf@circ@res@down}}
11603 \pgfusepath{draw}
11604 \fi
11605 }
11606
11607 \pgfcircdeclaretransistor{pmos}{
11608 \anchor{inner up}{
11609 \northeast
11610 \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y
11611 }
11612 \anchor{inner down}{
11613 \northeast
11614 \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
11615 }
11616 }{%
11617 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11618 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11619 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11620 \pgfpathlineto{\pgfpoint
11621 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11622 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11623 \pgfusepath{draw}
11624
11625 \ifpgf@circuit@mos@arrows
11626 \pgfscope
11627 \ifpgf@circuit@trans@arrowatend
11628 \pgftransformshift{\pgfpoint
11629 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}%
11630 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11631 }
11632 \pgftransformrotate{180}
11633 \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}}
11634 \else
11635 \pgfslopedattimetrue
11636 \pgfallowupsidedownattimetrue
11637 \pgfresetnontranslationattimefalse
11638 \pgftransformlineattime{\ctikzvalof{tripoles/pmos/arrow pos}}{%
11639 \pgfpoint%
11640 {\pgf@circ@res@right}%
11641 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11642 }{%
11643 \pgfpoint
11644 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}%
11645 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11646 }
11647 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
11648 \fi
11649 \endpgfscope
11650 \fi
11651
11652 \pgfscope
11653 \pgfpathmoveto{\pgfpoint
11654 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11655 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@up}}
11656 \pgfpathlineto{\pgfpoint
11657 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11658 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@down}}
11659 \pgfpathmoveto{\pgfpoint
11660 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11661 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11662 \pgfpathlineto{\pgfpoint
11663 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11664 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11665 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11666 \pgfusepath{draw}
11667 \endpgfscope
11668
11669 \pgfpathmoveto{\pgfpoint
11670 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11671 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11672 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11673 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11674 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11675
11676
11677 \pgfusepath{draw}
11678 \ifpgf@circuit@bpt@drawgate
11679 \pgfpathmoveto{\pgfpoint
11680 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11681 {\pgf@circ@res@up+\pgf@circ@res@down}}
11682 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11683 \pgfusepath{draw}
11684 \fi
11685
11686 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
11687 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11688 {\pgf@circ@res@up+\pgf@circ@res@down}}
11689 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11690 {\pgf@circ@res@up+\pgf@circ@res@down}}
11691 \pgfusepath{draw}
11692 \fi
11693
11694 \ifpgf@circuit@pmos@nocircle\else
11695 % we are not scaling the circle with the MOS --- I think it's better to have it
11696 % coherent with the poles/nodes of the rest of the circuit.
11697 \pgfpathcircle{\pgfpoint
11698 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left - \ctikzvalof{nodes width}*\pgf@circ@Rlen}
11699 {\pgf@circ@res@up+\pgf@circ@res@down}}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
11700 \ifpgf@circuit@pmos@emptycircle
11701 \pgfsetfillcolor{white}
11702 \fi
11703 \pgfusepath{draw,fill}
11704 \fi
11705 }
11706
11707 %% HEMT FET Transistor
11708 \pgfcircdeclaretransistor{hemt}{
11709 \anchor{inner up}{
11710 \northeast
11711 \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11712 }
11713 \anchor{inner down}{
11714 \northeast
11715 \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11716 }
11717 }{%
11718 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11719 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11720 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11721 \pgfpathlineto{\pgfpoint
11722 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11723 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11724
11725 \pgfpathmoveto{\pgfpoint
11726 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11727 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11728 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11729 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11730 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11731 \pgfusepath{draw}
11732
11733 \pgfscope
11734 \pgfpathmoveto{\pgfpoint
11735 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11736 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}}
11737 \pgfpathlineto{\pgfpoint
11738 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11739 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}}
11740 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11741 \pgfusepath{draw}
11742 \endpgfscope
11743
11744 \pgfpathmoveto{\pgfpoint
11745 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11746 {\pgf@circ@res@up+\pgf@circ@res@down}}
11747 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11748 \pgfusepath{draw}
11749 }
11750
11751 \long\def\drawfetcore#1{
11752 \pgftransformationadjustments
11753 %top connection
11754 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11755 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11756 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11757 \pgfpathlineto{\pgfpoint
11758 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11759 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11760 \pgfusepath{draw}
11761 \pgfscope
11762 \pgfpathmoveto{\pgfpoint
11763 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11764 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
11765 \ifpgf@circuit@trans@depletiontype
11766 \pgfpathlineto{\pgfpoint
11767 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11768 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11769 \else
11770
11771 \pgfpathlineto{\pgfpoint
11772 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11773 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.45}}
11774 \pgfpathmoveto{\pgfpoint
11775 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11776 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.25}}
11777 \pgfpathlineto{\pgfpoint
11778 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11779 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down*0.25}}
11780 \pgfpathmoveto{\pgfpoint
11781 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11782 {\ctikzvalof{tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
11783 \pgfpathlineto{\pgfpoint
11784 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11785 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11786 \fi
11787 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11788 \pgfusepath{draw}
11789 \endpgfscope
11790 %Bulk connection line
11791 \pgfpathmoveto{\pgfpoint
11792 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11793 {\pgf@circ@res@up+\pgf@circ@res@down}}
11794 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11795 {\pgf@circ@res@up+\pgf@circ@res@down}}
11796
11797 %bottom connection
11798 \pgfpathmoveto{\pgfpoint
11799 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11800 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11801 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11802 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11803 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11804 \pgfusepath{draw}
11805
11806 %draw thick gate line
11807 \pgfscope
11808 \pgfpathmoveto{\pgfpoint
11809 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11810 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11811 \pgfpathlineto{\pgfpoint
11812 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11813 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11814 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11815 \pgfusepath{draw}
11816 \endpgfscope
11817
11818 % arrows
11819 \pgfscope
11820 \pgfslopedattimetrue
11821 \pgfallowupsidedownattimetrue
11822 \pgfresetnontranslationattimefalse
11823 \ifpgf@circuit@trans@arrowatend
11824 \ifpgf@circuit@trans@ntype
11825 \edef\@@anchor{tip}
11826 \edef\@@pos{1.0}
11827 \else
11828 \edef\@@anchor{btip}
11829 \edef\@@pos{0.0}
11830 \fi
11831 \else
11832 \edef\@@anchor{center}\edef\@@pos{0.6}
11833 \fi
11834 \pgftransformlineattime{\@@pos}{%
11835 \pgfpoint
11836 {\pgf@circ@res@right}%
11837 {\pgf@circ@res@up+\pgf@circ@res@down}%
11838 }{%
11839 \pgfpoint%
11840 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11841 {\pgf@circ@res@up+\pgf@circ@res@down}%
11842 }
11843 \ifpgf@circuit@trans@ntype
11844 \else
11845 \pgftransformrotate{180}
11846 \fi
11847 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11848 \endpgfscope
11849
11850 % GATE CONNECTION
11851 \ifpgf@circuit@bpt@drawgate
11852 \ifpgf@circuit@trans@ntype
11853 \pgfpathmoveto{\pgfpoint
11854 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11855 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11856 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11857 \else
11858 \pgfpathmoveto{\pgfpoint
11859 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11860 {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11861 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11862 \fi
11863 \pgfusepath{draw}
11864 \fi
11865
11866 }
11867
11868 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
11869 {\pgfcircdeclaretransistor{#1}{
11870 \anchor{bulk}{\left\pgf@x=0pt}
11871 \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
11872 \anchor{inner up}{
11873 \northeast
11874 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
11875 }
11876 \anchor{inner down}{
11877 \northeast
11878 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
11879 }
11880 #2
11881 }
11882 {#3}
11883 }
11884
11885 \pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
11886 \pgf@circuit@trans@depletiontypefalse
11887 \drawfetcore{nfet}
11888 }
11889
11890 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
11891 \pgf@circuit@trans@depletiontypefalse
11892 \drawfetcore{pfet}
11893 }
11894
11895 % N-CHANNEL IGFET ENHANCEMENT TYPE
11896 \pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
11897 \pgf@circuit@trans@depletiontypefalse
11898 \drawfetcore{nigfete}
11899
11900 % SOURCE CONNECTION
11901 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11902 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11903 \pgfusepath{draw}
11904
11905 % SOLDER DOT at source-bulk connection
11906 \ifpgf@circuit@fet@solderdot
11907 \pgfscope
11908 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11909 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11910 \pgfnode{circ}{center}{}{}{}
11911 \endpgfscope{}
11912 \fi
11913 }
11914
11915 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
11916 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
11917 \pgf@circuit@trans@depletiontypefalse
11918 \drawfetcore{nigfetebulk}
11919 % SOLDER DOT at source-bulk connection
11920 \ifpgf@circuit@fet@solderdot
11921 \pgfscope
11922 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11923 \ctikzvalof{tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
11924 \pgfnode{circ}{center}{}{}{}
11925 \endpgfscope{}
11926 \fi
11927 }
11928
11929 % N-CHANNEL IGFET DEPLETION TYPE
11930 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
11931 \pgf@circuit@trans@depletiontypetrue
11932 \drawfetcore{nigfetd}
11933
11934 % SOURCE CONNECTION
11935 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11936 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11937 \pgfusepath{draw}
11938
11939 % SOLDER DOT at source-bulk connection
11940 \ifpgf@circuit@fet@solderdot
11941 \pgfscope
11942 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11943 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11944 \pgfnode{circ}{center}{}{}{}
11945 \endpgfscope{}
11946 \fi
11947 }
11948
11949 % P-CHANNEL IGFET ENHANCEMENT TYPE
11950 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
11951 \pgf@circuit@trans@depletiontypefalse
11952 \drawfetcore{pigfete}
11953 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11954
11955 % SOURCE CONNECTION
11956 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11957 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11958 \pgfusepath{draw}
11959
11960
11961 % SOLDER DOT at source-bulk connection
11962 \ifpgf@circuit@fet@solderdot
11963 \pgfscope
11964 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11965 \ctikzvalof{tripoles/pigfete/gate height}\pgf@circ@res@up}}
11966 \pgfnode{circ}{center}{}{}{}
11967 \endpgfscope
11968 \fi
11969 }
11970
11971 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
11972 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
11973 \pgf@circuit@trans@depletiontypefalse
11974 \drawfetcore{pigfetebulk}
11975 }
11976
11977 % P-CHANNEL IGFET DEPLETION TYPE
11978 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
11979 \pgf@circuit@trans@depletiontypetrue
11980 \drawfetcore{pigfetd}
11981
11982 % SOURCE CONNECTION
11983 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11984 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11985 \pgfusepath{draw}
11986
11987
11988 % SOLDER DOT at source-bulk connection
11989 \ifpgf@circuit@fet@solderdot
11990 \pgfscope
11991 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11992 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@up}}
11993 \pgfnode{circ}{center}{}{}{}
11994 \endpgfscope{}
11995 \fi
11996 }
11997
11998 \pgfcircdeclaretransistor{njfet}{
11999 \anchor{inner up}{
12000 \northeast
12001 \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
12002 }
12003 \anchor{inner down}{
12004 \northeast
12005 \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
12006 }
12007 }{%
12008 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12009 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12010 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
12011 \pgfpathlineto{\pgfpoint
12012 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
12013 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
12014
12015 \pgfpathmoveto{\pgfpoint
12016 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
12017 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
12018 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12019 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
12020 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12021 \pgfusepath{draw}
12022
12023 \pgfscope
12024 \pgfpathmoveto{\pgfpoint
12025 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
12026 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}}
12027 \pgfpathlineto{\pgfpoint
12028 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
12029 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}}
12030 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12031 \pgfusepath{draw}
12032 \endpgfscope
12033
12034 % arrow
12035 \pgfscope
12036 \pgfslopedattimetrue
12037 \pgfallowupsidedownattimetrue
12038 \pgfresetnontranslationattimefalse
12039 \ifpgf@circuit@trans@arrowatend
12040 \edef\@@anchor{tip}\edef\@@pos{1.0}
12041 \else
12042 \edef\@@anchor{center}\edef\@@pos{0.6}
12043 \fi
12044 \pgftransformlineattime{\@@pos}{%
12045 \pgfpoint{\pgf@circ@res@left}%
12046 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
12047 }{%
12048 \pgfpoint
12049 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}%
12050 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
12051 }
12052 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
12053 \endpgfscope
12054
12055 \pgfpathmoveto{\pgfpoint
12056 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
12057 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
12058 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
12059 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
12060 \pgfusepath{draw}
12061 }
12062
12063 \pgfcircdeclaretransistor{pjfet}{
12064 \anchor{inner up}{
12065 \northeast
12066 \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
12067 }
12068 \anchor{inner down}{
12069 \northeast
12070 \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
12071 }
12072 }{%
12073 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12074 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12075 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
12076 \pgfpathlineto{\pgfpoint
12077 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
12078 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
12079
12080 \pgfpathmoveto{\pgfpoint
12081 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
12082 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
12083 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12084 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
12085 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12086 \pgfusepath{draw}
12087
12088 \pgfscope
12089 \pgfpathmoveto{\pgfpoint
12090 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
12091 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}}
12092 \pgfpathlineto{\pgfpoint
12093 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
12094 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}}
12095 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12096 \pgfusepath{draw}
12097 \endpgfscope
12098
12099 \pgfscope
12100 \pgfslopedattimetrue
12101 \pgfallowupsidedownattimetrue
12102 \pgfresetnontranslationattimefalse
12103 \ifpgf@circuit@trans@arrowatend
12104 \edef\@@anchor{btip}\edef\@@pos{1.0}
12105 \else
12106 \edef\@@anchor{center}\edef\@@pos{0.4}
12107 \fi
12108 \pgftransformlineattime{\@@pos}{%
12109 \pgfpoint%
12110 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}%
12111 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
12112 }{%
12113 \pgfpoint{\pgf@circ@res@left}%
12114 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
12115 }
12116 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
12117 \endpgfscope
12118
12119 \pgfpathmoveto{\pgfpoint
12120 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
12121 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
12122 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
12123 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
12124 \pgfusepath{draw}
12125 }
12126
12127 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
12128 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12129 % DRAIN CONNECTION
12130 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12131 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
12132 % DRAIN
12133 \pgfpathlineto{\pgfpoint
12134 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
12135 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
12136 \pgfusepath{draw}
12137
12138 % GATE, DEPLETION TYPE
12139 \pgfscope %% added
12140 \pgfpathmoveto{\pgfpoint
12141 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
12142 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@up}}
12143 \pgfpathlineto{\pgfpoint
12144 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
12145 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@down}}
12146 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} %% added
12147 \pgfusepath{draw} %% added
12148 \endpgfscope %% added
12149
12150 % BULK
12151 \pgfpathmoveto{\pgfpoint
12152 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
12153 {\pgf@circ@res@up+\pgf@circ@res@down}}
12154 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
12155 {\pgf@circ@res@up+\pgf@circ@res@down}}
12156
12157 % SOURCE
12158 \pgfpathmoveto{\pgfpoint
12159 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
12160 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
12161 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
12162 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
12163 % SOURCE CONNECTION
12164 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12165 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
12166 \pgfusepath{draw}
12167
12168 % SOLDER DOT at source-bulk connection
12169 \ifpgf@circuit@fet@solderdot
12170 \pgfscope
12171 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
12172 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
12173 \pgfnode{circ}{center}{}{}{}
12174 \endpgfscope{}
12175 \fi
12176 % ARROW
12177 \pgfscope
12178 \pgfslopedattimetrue
12179 \pgfallowupsidedownattimetrue
12180 \pgfresetnontranslationattimefalse
12181 \ifpgf@circuit@trans@arrowatend
12182 \edef\@@anchor{tip}\edef\@@pos{1.0}
12183 \else
12184 \edef\@@anchor{center}\edef\@@pos{0.6}
12185 \fi
12186 \pgftransformlineattime{\@@pos}{%
12187 \pgfpoint
12188 {\pgf@circ@res@right}%
12189 {\pgf@circ@res@up+\pgf@circ@res@down}%
12190 }{%
12191 \pgfpoint%
12192 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}%
12193 {\pgf@circ@res@up+\pgf@circ@res@down}%
12194 }
12195 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
12196 \endpgfscope
12197 \pgfusepath{draw}
12198
12199 % Wavy lines
12200 \pgfscope
12201 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
12202 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12203 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12204 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12205 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12206 \pgfusepath{draw}
12207
12208 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
12209 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12210 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12211 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12212 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12213 \pgfusepath{draw}
12214
12215 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
12216 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12217 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12218 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12219 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
12220 \pgfusepath{draw}
12221 \endpgfscope
12222 }
12223
12224 % end of transistors
12225
12226 %%%%%%%%%%%%%
12227 %% Switches
12228 %%%%%%%%%%%%%
12229
12230 \pgfcircdeclarebipole{
12231 \anchor{out 1}{
12232 \northeast
12233 \pgf@y=0cm
12234 }
12235 \anchor{out 2}{
12236 \northeast
12237 \pgf@y=.8\pgf@y
12238 }
12239 }
12240 {\ctikzvalof{tripoles/toggleswitch/height 2}}
12241 {toggleswitch}
12242 {\ctikzvalof{tripoles/toggleswitch/height}}
12243 {\ctikzvalof{tripoles/toggleswitch/width}}
12244 {
12245
12246 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
12247 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
12248 \pgfusepath{draw}
12249 \pgfscope
12250 \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
12251 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
12252 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
12253 \pgfusepath{draw}
12254 \endpgfscope
12255
12256 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12257 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
12258
12259 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
12260 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
12261 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
12262 \pgfusepath{draw}
12263
12264
12265 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
12266 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
12267 \pgfusepath{draw}
12268
12269 \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}
12270 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
12271 \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
12272 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
12273 \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
12274 \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
12275 \pgfusepath{draw}
12276 \pgfsetdash{}{0cm}
12277 }
12278
12279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12280 %% operational and instrumentation amplifiers
12281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12282
12283 \pgfdeclareshape{op amp}
12284 {
12285 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12286 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12287 \anchor{center}{\pgfpointorigin}
12288 \savedanchor\northwest{%
12289 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12290 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
12291 \pgf@y=.5\pgf@y
12292 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12293 \pgf@x=.5\pgf@x
12294 }
12295 \savedanchor\left{%
12296 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12297 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12298 \pgf@x=.5\pgf@x
12299 \pgf@y=0pt
12300 }
12301 \anchor{south}{
12302 \northwest
12303 \pgf@y=-\pgf@y
12304 \pgf@x=0pt
12305 }
12306 \anchor{north}{
12307 \northwest
12308 \pgf@x=0pt
12309 }
12310 \savedanchor\left{%
12311 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12312 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12313 \pgf@x=.5\pgf@x
12314 \pgf@y=0pt
12315 }
12316 \savedanchor\inOneFixed{%
12317 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12318 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
12319 \pgf@y=.5\pgf@y
12320 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
12321 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12322 \pgf@x=.5\pgf@x
12323 }
12324 \anchor{in up}{
12325 \inOneFixed
12326 }
12327 \anchor{in down}{
12328 \inOneFixed
12329 \pgf@y=-\pgf@y
12330 }
12331 \savedanchor\inOne{%
12332 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12333 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
12334 \pgf@y=.5\pgf@y
12335 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
12336 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12337 \pgf@x=.5\pgf@x
12338 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12339 }
12340 \anchor{-}{
12341 \inOne
12342 }
12343 \anchor{+}{
12344 \inOne
12345 \pgf@y=-\pgf@y
12346 }
12347 \savedanchor\up{%
12348 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12349 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
12350 \pgf@y=.5\pgf@y
12351 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12352 \pgf@x=.5\pgf@x
12353 \pgf@circ@res@up = \pgf@y
12354 \pgf@circ@res@right = -\pgf@x
12355 \pgf@circ@res@left = \pgf@x
12356 \pgfpointlineattime{
12357 \ctikzvalof{tripoles/op amp/up pos}}{
12358 \pgfpoint{
12359 \ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12360 {\pgf@circ@res@up}}
12361 {\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
12362 }
12363 \anchor{up}{
12364 \up
12365 }
12366 \anchor{down}{
12367 \up
12368 \pgf@y=-\pgf@y
12369 }
12370 \anchor{out}{
12371 \northwest
12372 \pgf@y=0pt
12373 \pgf@x=-\pgf@x
12374 }
12375 \anchor{west}{
12376 \left
12377 }
12378 \anchor{east}{
12379 \left
12380 \pgf@x=-\pgf@x
12381 }
12382
12383 % support for border anchors
12384 \savedanchor\leftedge{%
12385 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12386 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
12387 \pgf@x=.5\pgf@x
12388 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12389 \pgf@y=0pt
12390 }
12391 \anchor{leftedge}{\leftedge}
12392 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
12393 \anchor{bin up}{
12394 \inOneFixed
12395 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12396 }
12397 \anchor{bin down}{
12398 \inOneFixed
12399 \pgf@y=-\pgf@y
12400 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12401 }
12402 \anchor{b-}{
12403 \inOne
12404 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12405 }
12406 \anchor{b+}{
12407 \inOne
12408 \pgf@y=-\pgf@y
12409 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12410 }
12411 \anchor{bout}{
12412 \leftedge
12413 \pgf@y=0pt
12414 \pgf@x=-\pgf@x
12415 }
12416 % end border anchors
12417 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12418 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12419 \anchor{north west}{ \northwest }
12420 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12421
12422 \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12423
12424 \backgroundpath{
12425 \pgfsetcolor{\ctikzvalof{color}}
12426
12427 \northwest
12428 \pgf@circ@res@up = \pgf@y
12429 \pgf@circ@res@down = -\pgf@y
12430 \pgf@circ@res@right = -\pgf@x
12431 \pgf@circ@res@left = \pgf@x
12432 \pgf@circ@scaled@Rlen=\scaledRlen
12433
12434 % Triangle
12435 \pgfscope
12436 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12437 \pgftransformxshift{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12438 \pgf@circ@res@step=\pgf@circ@res@right
12439 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12440 \pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
12441
12442 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12443 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12444 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12445 \pgfpathclose
12446 \pgf@circ@draworfill
12447 \endpgfscope
12448
12449 % Negative input terminal
12450 \pgfpathmoveto{\pgfpoint
12451 {\pgf@circ@res@left}
12452 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
12453 \pgfpathlineto{\pgfpoint
12454 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12455 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
12456 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
12457
12458 % Positive input terminal
12459 \pgfpathmoveto{\pgfpoint
12460 {\pgf@circ@res@left}
12461 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
12462 \pgfpathlineto{\pgfpoint
12463 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12464 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
12465 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
12466
12467 % Output terminal
12468 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12469 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
12470 \pgfsetrectcap
12471 \pgfusepath{draw}
12472 }
12473 }
12474
12475 % Op amp shape as in european standard EN 60617
12476 \pgfdeclareshape{en amp}
12477 {
12478 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12479 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12480 \anchor{center}{\pgfpointorigin}
12481 \savedanchor\northwest{%
12482 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12483 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12484 \pgf@y=.5\pgf@y
12485 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12486 \pgf@x=.5\pgf@x
12487 }
12488 \savedanchor\left{%
12489 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12490 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12491 \pgf@x=.5\pgf@x
12492 \pgf@y=0pt
12493 }
12494 \anchor{south}{
12495 \northwest
12496 \pgf@y=-\pgf@y
12497 \pgf@x=0pt
12498 }
12499 \anchor{north}{
12500 \northwest
12501 \pgf@x=0pt
12502 }
12503 \savedanchor\inOneFixed{%
12504 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12505 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12506 \pgf@y=.5\pgf@y
12507 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
12508 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12509 \pgf@x=.5\pgf@x
12510 }
12511 \anchor{in up}{
12512 \inOneFixed
12513 }
12514 \anchor{in down}{
12515 \inOneFixed
12516 \pgf@y=-\pgf@y
12517 }
12518 \savedanchor\inOne{%
12519 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12520 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12521 \pgf@y=.5\pgf@y
12522 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
12523 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12524 \pgf@x=.5\pgf@x
12525 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12526 }
12527 \anchor{-}{
12528 \inOne
12529 }
12530 \anchor{+}{
12531 \inOne
12532 \pgf@y=-\pgf@y
12533 }
12534 \anchor{up}{
12535 \northwest
12536 \pgf@x=0pt
12537 }
12538 \anchor{down}{
12539 \northwest
12540 \pgf@x=0pt
12541 \pgf@y=-\pgf@y
12542 }
12543 \anchor{out}{
12544 \northwest
12545 \pgf@y=0pt
12546 \pgf@x=-\pgf@x
12547 }
12548 \anchor{west}{
12549 \left
12550 }
12551 \anchor{east}{
12552 \left
12553 \pgf@x=-\pgf@x
12554 }
12555 % support for border anchors
12556 \savedanchor\leftedge{%
12557 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12558 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12559 \pgf@x=.5\pgf@x
12560 \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
12561 \pgf@y=0pt
12562 }
12563 \anchor{leftedge}{\leftedge}
12564 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
12565 \anchor{bin up}{
12566 \inOneFixed
12567 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12568 }
12569 \anchor{bin down}{
12570 \inOneFixed
12571 \pgf@y=-\pgf@y
12572 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12573 }
12574 \anchor{b-}{
12575 \inOne
12576 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12577 }
12578 \anchor{b+}{
12579 \inOne
12580 \pgf@y=-\pgf@y
12581 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12582 }
12583 \anchor{bout}{
12584 \leftedge
12585 \pgf@y=0pt
12586 \pgf@x=-\pgf@x
12587 }
12588 % end border anchors
12589 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12590 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12591 \anchor{north west}{ \northwest }
12592 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12593 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12594
12595 \backgroundpath{
12596 \pgfsetcolor{\ctikzvalof{color}}
12597 \northwest
12598 \pgf@circ@res@up = \pgf@y
12599 \pgf@circ@res@down = -\pgf@y
12600 \pgf@circ@res@right = -\pgf@x
12601 \pgf@circ@res@left = \pgf@x
12602 \pgf@circ@scaled@Rlen=\scaledRlen
12603
12604 \pgfscope
12605 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12606 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
12607 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
12608 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
12609 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
12610 \pgfpathclose
12611 \pgf@circ@draworfill
12612 \endpgfscope
12613
12614 \pgfpathmoveto{\pgfpoint
12615 {\pgf@circ@res@left}
12616 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
12617 \pgfpathlineto{\pgfpoint
12618 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
12619 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
12620 \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\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
12621
12622 \pgfpathmoveto{\pgfpoint
12623 {\pgf@circ@res@left}
12624 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
12625 \pgfpathlineto{\pgfpoint
12626 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
12627 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
12628 \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\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
12629
12630 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12631 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
12632 \pgfsetrectcap
12633 \pgfusepath{draw}
12634
12635
12636 \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
12637 % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
12638 }
12639 }
12640
12641 % Fully differential output op amp
12642 % Contributed by Kristofer M. Monisit
12643 \pgfdeclareshape{fd op amp}
12644 {
12645 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12646 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12647 \anchor{center}{\pgfpointorigin}
12648 \savedanchor\northwest{%
12649 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12650 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12651 \pgf@y=.5\pgf@y
12652 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12653 \pgf@x=.5\pgf@x
12654 }
12655 \savedanchor\outline{%
12656 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12657 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12658 \pgf@y=.5\pgf@y
12659 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12660 \pgf@x=.5\pgf@x
12661 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
12662 }
12663 \anchor{south}{
12664 \northwest
12665 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12666 }
12667 \anchor{north}{
12668 \northwest\pgf@x=0pt\relax
12669 }
12670 \savedanchor\left{%
12671 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12672 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12673 \pgf@x=.5\pgf@x
12674 \pgf@y=0pt
12675 }
12676 \savedanchor\inOneFixed{%
12677 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12678 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12679 \pgf@y=.5\pgf@y
12680 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
12681 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12682 \pgf@x=.5\pgf@x
12683 }
12684 \anchor{in up}{
12685 \inOneFixed
12686 }
12687 \anchor{in down}{
12688 \inOneFixed
12689 \pgf@y=-\pgf@y
12690 }
12691 \savedanchor\inOne{%
12692 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12693 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12694 \pgf@y=.5\pgf@y
12695 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
12696 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12697 \pgf@x=.5\pgf@x
12698 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12699 }
12700 \anchor{-}{
12701 \inOne
12702 }
12703 \anchor{+}{
12704 \inOne
12705 \pgf@y=-\pgf@y
12706 }
12707 \savedanchor\up{%
12708 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12709 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12710 \pgf@y=.5\pgf@y
12711 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12712 \pgf@x=.5\pgf@x
12713 \pgf@circ@res@up = \pgf@y
12714 \pgf@circ@res@right = -\pgf@x
12715 \pgf@circ@res@left = \pgf@x
12716 \pgfpointlineattime{
12717 \ctikzvalof{tripoles/fd op amp/up pos}}{
12718 \pgfpoint{
12719 \ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12720 {\pgf@circ@res@up}}
12721 {\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@right}{0pt}}
12722 }
12723 \anchor{up}{
12724 \up
12725 }
12726 \anchor{down}{
12727 \up
12728 \pgf@y=-\pgf@y
12729 }
12730 \anchor{out up}{
12731 \northwest
12732 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12733 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12734 }
12735 \anchor{out down}{
12736 \northwest
12737 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12738 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12739 }
12740 \anchor{out +}{
12741 \outline
12742 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12743 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12744 }
12745 \anchor{out -}{
12746 \outline
12747 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12748 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12749 }
12750 % support for border anchors
12751 \savedanchor\leftedge{%
12752 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12753 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12754 \pgf@x=.5\pgf@x
12755 \pgf@x = \ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12756 \pgf@y=0pt
12757 }
12758 \anchor{leftedge}{\leftedge}
12759 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
12760 \anchor{bin up}{
12761 \inOneFixed
12762 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12763 }
12764 \anchor{bin down}{
12765 \inOneFixed
12766 \pgf@y=-\pgf@y
12767 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12768 }
12769 \anchor{b-}{
12770 \inOne
12771 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12772 }
12773 \anchor{b+}{
12774 \inOne
12775 \pgf@y=-\pgf@y
12776 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
12777 }
12778 \anchor{bout}{
12779 \leftedge
12780 \pgf@y=0pt
12781 \pgf@x=-\pgf@x
12782 }
12783 \anchor{bout +}{
12784 \outline
12785 \pgf@xa=\pgf@x\pgf@ya=\pgf@y
12786 \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
12787 {\pgfpoint{\pgf@xa}{0pt}}
12788 {\pgfpoint{0pt}{\pgf@ya}}
12789 }
12790 \anchor{bout -}{
12791 \outline
12792 \pgf@xa=\pgf@x\pgf@ya=\pgf@y
12793 \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
12794 {\pgfpoint{\pgf@xa}{0pt}}
12795 {\pgfpoint{0pt}{\pgf@ya}}
12796 \pgf@y=-\pgf@y
12797 }
12798 \anchor{bout up}{
12799 \northwest
12800 \pgf@xa=\pgf@x\pgf@ya=\pgf@y
12801 \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
12802 {\pgfpoint{\pgf@xa}{0pt}}
12803 {\pgfpoint{0pt}{\pgf@ya}}
12804 }
12805 \anchor{bout down}{
12806 \northwest
12807 \pgf@xa=\pgf@x\pgf@ya=\pgf@y
12808 \pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}
12809 {\pgfpoint{\pgf@xa}{0pt}}
12810 {\pgfpoint{0pt}{\pgf@ya}}
12811 \pgf@y=-\pgf@y
12812 }
12813 % end border anchors
12814 \anchor{west}{
12815 \left
12816 }
12817 \anchor{east}{
12818 \left
12819 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12820 }
12821 \anchor{out}{% should not be used
12822 \left
12823 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12824 }
12825 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12826 \anchor{north east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x }
12827 \anchor{north west}{ \northwest }
12828 \anchor{south east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x \pgf@y=-\pgf@y }
12829 \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12830 \backgroundpath{
12831 \pgfsetcolor{\ctikzvalof{color}}
12832
12833 \northwest
12834 \pgf@circ@res@up = \pgf@y
12835 \pgf@circ@res@down = -\pgf@y
12836 \pgf@circ@res@right = -\pgf@x
12837 \pgf@circ@res@left = \pgf@x
12838 \pgf@circ@scaled@Rlen=\scaledRlen
12839
12840 % Triangle
12841 % Includes output terminals in the traingular shape
12842 % to ensure that diagonal joins are properly displayed
12843 % we first draw the main triangle and the leads with normal thickness,
12844 % and the redraw the main triangle with the component shape
12845 \pgfscope
12846 % shift origin a bit to ease calculations
12847 \pgftransformxshift{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12848 \pgf@circ@res@step=\pgf@circ@res@right
12849 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12850 \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step
12851
12852 % Initial point (right vertex)
12853 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12854
12855 % Negative output terminal
12856 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12857 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}}
12858 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12859
12860 % Top vertex
12861 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12862
12863 % Bottom vertex
12864 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12865
12866 % Positive output terminal
12867 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12868 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}}
12869 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12870
12871 % Right vertex
12872 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12873
12874 \pgfpathclose
12875 \pgfusepath{stroke}
12876
12877 % ok, now we'll redraw the triangle with the class specific
12878 % thickness and optionally fill
12879
12880 \pgfscope
12881 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
12882
12883 % Initial point (right vertex)
12884 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12885 % Top vertex
12886 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12887 % Bottom vertex
12888 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12889
12890 \pgfpathclose
12891 \pgf@circ@draworfill
12892 \endpgfscope % thick and fill
12893 \endpgfscope % shift
12894
12895 % Negative input terminal
12896 \pgfpathmoveto{\pgfpoint
12897 {\pgf@circ@res@left}
12898 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12899 \pgfpathlineto{\pgfpoint
12900 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12901 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12902 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
12903
12904 % Positive input terminal
12905 \pgfpathmoveto{\pgfpoint
12906 {\pgf@circ@res@left}
12907 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12908 \pgfpathlineto{\pgfpoint
12909 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12910 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12911 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
12912
12913 % Negative output terminal label
12914 \pgftext[right, bottom, x=3pt, y=1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
12915
12916 % Positive output terminal label
12917 \pgftext[right, top, x=3pt, y=-1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
12918
12919 \pgfsetrectcap
12920 \pgfusepath{draw}
12921 }
12922 }
12923
12924
12925 % Instrumentation amplifier with differential output
12926 \pgfdeclareshape{fd inst amp}
12927 {
12928 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12929 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12930 % when tikz calls the anchor it wants the relative position in the lengths
12931 % \pgf@x \pgf@y
12932 % \pgfpoint* functions set that variables
12933 % anchors are visible outside and run on use
12934 \anchor{center}{\pgfpointorigin}
12935 % savedanchors are internals and run on node creation (not use)
12936 % bounding-box top left
12937 \savedanchor\northwest{%
12938 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12939 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12940 \pgf@y=.5\pgf@y
12941 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12942 \pgf@x=.5\pgf@x
12943 }
12944 \anchor{nw}{
12945 \northwest
12946 }
12947 \anchor{south}{
12948 \northwest
12949 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12950 }
12951 \anchor{north}{
12952 \northwest\pgf@x=0pt\relax
12953 }
12954 \savedanchor\left{%
12955 \pgf@y=0pt
12956 }
12957 \anchor{leftedge}
12958 {\left
12959 \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
12960 }
12961 \savedanchor\inOneFixed{%
12962 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12963 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12964 \pgf@y=.5\pgf@y
12965 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12966 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12967 \pgf@x=.5\pgf@x
12968 }
12969 \anchor{in up}{
12970 \inOneFixed
12971 }
12972 \anchor{in down}{
12973 \inOneFixed
12974 \pgf@y=-\pgf@y
12975 }
12976 \savedanchor\inOne{%
12977 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12978 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12979 \pgf@y=.5\pgf@y
12980 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12981 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12982 \pgf@x=.5\pgf@x
12983 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12984 }
12985 \anchor{-}{
12986 \inOne
12987 }
12988 \anchor{+}{
12989 \inOne
12990 \pgf@y=-\pgf@y
12991 }
12992 \savedanchor\up{%
12993 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12994 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12995 \pgf@y=.5\pgf@y
12996 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12997 \pgf@x=.5\pgf@x
12998 \pgf@circ@res@up = \pgf@y
12999 \pgf@circ@res@right = -\pgf@x
13000 \pgf@circ@res@left = \pgf@x
13001 \pgfpointlineattime{
13002 \ctikzvalof{tripoles/fd inst amp/up pos}}{
13003 \pgfpoint{
13004 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
13005 {\pgf@circ@res@up}}
13006 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
13007 }
13008 \anchor{up}{
13009 \up
13010 }
13011 \anchor{down}{
13012 \up
13013 \pgf@y=-\pgf@y
13014 }
13015 % reference voltage input anchors.
13016 \savedanchor\refv{%
13017 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13018 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
13019 \pgf@y=.5\pgf@y
13020 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
13021 \pgf@x=.5\pgf@x
13022 \pgf@circ@res@up = \pgf@y
13023 \pgf@circ@res@right = -\pgf@x
13024 \pgf@circ@res@left = \pgf@x
13025 \pgfpointlineattime{
13026 \ctikzvalof{tripoles/fd inst amp/refv pos}}{
13027 \pgfpoint{
13028 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
13029 {\pgf@circ@res@up}}
13030 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
13031 }
13032 % we need both because they are normally drawn under the amp, and if you
13033 % mirror it vertically you need them
13034 \anchor{refv up}{
13035 \refv
13036 }
13037 \anchor{refv down}{
13038 \refv
13039 \pgf@y=-\pgf@y
13040 }
13041 \savedanchor\outport{
13042 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13043 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
13044 \pgf@y=.5\pgf@y
13045 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
13046 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
13047 \pgf@x=-.5\pgf@x
13048 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
13049 }
13050 \anchor{out}{
13051 \outport
13052 \pgf@y=0pt
13053 }
13054 \anchor{out +}{
13055 \outport
13056 }
13057 \anchor{out -}{
13058 \outport
13059 \pgf@y=-\pgf@y
13060 }
13061 \savedanchor\outportfixed{
13062 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13063 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
13064 \pgf@y=.5\pgf@y
13065 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
13066 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
13067 \pgf@x=-.5\pgf@x
13068 }
13069 \anchor{out up}{
13070 \outportfixed
13071 }
13072 \anchor{out down}{
13073 \outportfixed
13074 \pgf@y=-\pgf@y
13075 }
13076 % support for border anchors
13077 \savedanchor\leftedge{%
13078 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13079 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
13080 \pgf@x=.5\pgf@x
13081 \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
13082 \pgf@y=0pt
13083 }
13084 \anchor{leftedge}{\leftedge}
13085 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
13086 \anchor{bin up}{
13087 \inOneFixed
13088 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13089 }
13090 \anchor{bin down}{
13091 \inOneFixed
13092 \pgf@y=-\pgf@y
13093 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13094 }
13095 \anchor{b-}{
13096 \inOne
13097 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13098 }
13099 \anchor{b+}{
13100 \inOne
13101 \pgf@y=-\pgf@y
13102 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13103 }
13104 \anchor{bout}{
13105 \leftedge
13106 \pgf@x=-\pgf@x \pgf@y=0pt
13107 }
13108 \anchor{bout +}{
13109 \outport
13110 \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
13111 }
13112 \anchor{bout -}{
13113 \outport
13114 \pgf@y=-\pgf@y
13115 \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
13116 }
13117 \anchor{bout up}{
13118 \outportfixed
13119 \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
13120 }
13121 \anchor{bout down}{
13122 \outportfixed
13123 \pgf@y=-\pgf@y
13124 \pgf@ya=\pgf@y \leftedge \pgf@x=-\pgf@x \pgf@y=\pgf@ya
13125 }
13126 % end border anchors
13127 %
13128 \anchor{west}{
13129 \left
13130 }
13131 \anchor{east}{
13132 \left
13133 \pgf@x=-\pgf@x
13134 }
13135 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13136 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13137 \anchor{north west}{ \northwest }
13138 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13139 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13140
13141 % let's start drawing the component
13142 \backgroundpath{
13143 \pgfsetcolor{\ctikzvalof{color}}
13144 %
13145 \northwest
13146 \pgf@circ@res@up = \pgf@y
13147 \pgf@circ@res@down = -\pgf@y
13148 \pgf@circ@res@right = -\pgf@x
13149 \pgf@circ@res@left = \pgf@x
13150 \pgf@circ@scaled@Rlen=\scaledRlen
13151 % main component, normally in thicker lines
13152 \pgfscope
13153 \newdimen\pgf@circ@res@right@double
13154 \pgf@circ@res@right@double=2\pgf@circ@res@right
13155
13156 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13157 \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
13158 \pgf@circ@res@step=\pgf@circ@res@right
13159 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13160 \pgf@circ@res@step=\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@step
13161 %first point (near output)
13162 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{0}}
13163 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
13164 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
13165 % and then to the input "front up", "down", to the output short side "down"
13166 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13167 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13168 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@down}}
13169 % ...and close
13170 \pgfpathclose
13171 \pgf@circ@draworfill
13172 \endpgfscope
13173
13174 % input terminal up
13175 \pgfpathmoveto{\pgfpoint
13176 {\pgf@circ@res@left}
13177 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13178 %
13179 \pgfpathlineto{\pgfpoint
13180 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
13181 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
13182 %
13183 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
13184
13185 % input terminal down
13186 \pgfpathmoveto{\pgfpoint
13187 {\pgf@circ@res@left}
13188 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13189 %
13190 \pgfpathlineto{\pgfpoint
13191 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
13192 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
13193 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
13194
13195 % output leads down and up
13196 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
13197 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
13198 \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
13199
13200 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
13201 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
13202 \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
13203 %
13204 \pgfsetrectcap
13205 \pgfusepath{draw}
13206 }
13207 }
13208
13209 % Transconductance amplifier (Transkonduktanzverstärker)
13210 \pgfdeclareshape{gm amp}
13211 {
13212 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13213 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13214 \anchor{center}{\pgfpointorigin}
13215 \savedanchor\northwest{%
13216 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13217 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
13218 \pgf@y=.5\pgf@y
13219 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
13220 \pgf@x=.5\pgf@x
13221 }
13222 \anchor{south}{
13223 \northwest
13224 \pgf@y=-\pgf@y
13225 }
13226 \anchor{north}{
13227 \northwest
13228 }
13229 \savedanchor\left{%
13230 \pgf@y=0pt
13231 }
13232 \anchor{leftedge}
13233 {\left
13234 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
13235 }
13236 \savedanchor\inOneFixed{%
13237 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13238 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
13239 \pgf@y=.5\pgf@y
13240 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
13241 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
13242 \pgf@x=.5\pgf@x
13243 }
13244 \anchor{in up}{
13245 \inOneFixed
13246 }
13247 \anchor{in down}{
13248 \inOneFixed
13249 \pgf@y=-\pgf@y
13250 }
13251 \savedanchor\inOne{%
13252 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13253 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
13254 \pgf@y=.5\pgf@y
13255 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
13256 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
13257 \pgf@x=.5\pgf@x
13258 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13259 }
13260 \anchor{-}{
13261 \inOne
13262 }
13263 \anchor{+}{
13264 \inOne
13265 \pgf@y=-\pgf@y
13266 }
13267 \savedanchor\up{%
13268 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13269 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
13270 \pgf@y=.5\pgf@y
13271 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
13272 \pgf@x=.5\pgf@x
13273 \pgf@circ@res@up = \pgf@y
13274 \pgf@circ@res@right = -\pgf@x
13275 \pgf@circ@res@left = \pgf@x
13276 \pgfpointlineattime{
13277 \ctikzvalof{tripoles/gm amp/up pos}}{
13278 \pgfpoint{
13279 \ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
13280 {\pgf@circ@res@up}}
13281 {\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}
13282 }
13283 \anchor{up}{
13284 \up
13285 }
13286 \anchor{down}{
13287 \up
13288 \pgf@y=-\pgf@y
13289 }
13290 \anchor{out}{
13291 \northwest
13292 \pgf@y=0pt
13293 \pgf@x=-\pgf@x
13294 }
13295 % support for border anchors
13296 \savedanchor\leftedge{%
13297 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13298 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
13299 \pgf@x=.5\pgf@x
13300 \pgf@x = \ctikzvalof{tripoles/gm amp/port width}\pgf@x
13301 \pgf@y=0pt
13302 }
13303 \anchor{leftedge}{\leftedge}
13304 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
13305 \anchor{bin up}{
13306 \inOneFixed
13307 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13308 }
13309 \anchor{bin down}{
13310 \inOneFixed
13311 \pgf@y=-\pgf@y
13312 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13313 }
13314 \anchor{b-}{
13315 \inOne
13316 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13317 }
13318 \anchor{b+}{
13319 \inOne
13320 \pgf@y=-\pgf@y
13321 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13322 }
13323 \anchor{bout}{
13324 \leftedge
13325 \pgf@y=0pt
13326 \pgf@x=-\pgf@x
13327 }
13328 % end border anchors
13329 \anchor{west}{
13330 \left
13331 }
13332 \anchor{east}{
13333 \left
13334 \pgf@x=-\pgf@x
13335 }
13336 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13337 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13338 \anchor{north west}{ \northwest }
13339 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13340
13341 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13342 \backgroundpath{
13343 \pgfsetcolor{\ctikzvalof{color}}
13344
13345 \northwest
13346 \pgf@circ@res@up = \pgf@y
13347 \pgf@circ@res@down = -\pgf@y
13348 \pgf@circ@res@right = -\pgf@x
13349 \pgf@circ@res@left = \pgf@x
13350 \pgf@circ@scaled@Rlen=\scaledRlen
13351
13352 \pgfscope
13353 \newdimen\pgf@circ@res@right@double
13354 \pgf@circ@res@right@double=2\pgf@circ@res@right
13355
13356 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13357 \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
13358 \pgf@circ@res@step=\pgf@circ@res@right
13359 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13360 \pgf@circ@res@step=\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@step
13361 %Umrandung:
13362 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{0}} %geändert startpunkt neu am ausgangsstrich
13363 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}%vom Ausgang nach oben
13364 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
13365 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
13366 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@down}}%ecke links unten nach rechts unten
13367 \pgfpathclose
13368 \pgf@circ@draworfill
13369 \endpgfscope
13370
13371 \pgfpathmoveto{\pgfpoint
13372 {\pgf@circ@res@left}
13373 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
13374 \pgfpathlineto{\pgfpoint
13375 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
13376 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
13377 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
13378
13379
13380 \pgfpathmoveto{\pgfpoint
13381 {\pgf@circ@res@left}
13382 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
13383 \pgfpathlineto{\pgfpoint
13384 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
13385 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
13386 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
13387
13388 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13389 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
13390 \pgfsetrectcap
13391 \pgfusepath{draw}
13392
13393 }
13394 }
13395
13396 % Instrumentation amplifier
13397 \pgfdeclareshape{inst amp}
13398 {
13399 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13400 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13401 % when tikz calls the anchor it wants the relative position in the lengths
13402 % \pgf@x \pgf@y
13403 % \pgfpoint* functions set that variables
13404 % anchors are visible outside and run on use
13405 \anchor{center}{\pgfpointorigin}
13406 % savedanchors are internals and run on node creation (not use)
13407 % bounding-box top left
13408 \savedanchor\northwest{%
13409 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13410 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
13411 \pgf@y=.5\pgf@y
13412 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13413 \pgf@x=.5\pgf@x
13414 }
13415 \anchor{nw}{
13416 \northwest
13417 }
13418 \anchor{south}{
13419 \northwest
13420 \pgf@y=-\pgf@y
13421 }
13422 \anchor{north}{
13423 \northwest
13424 }
13425 \savedanchor\left{%
13426 \pgf@y=0pt
13427 }
13428 \anchor{leftedge}
13429 {\left
13430 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
13431 }
13432 \savedanchor\inOneFixed{%
13433 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13434 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
13435 \pgf@y=.5\pgf@y
13436 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
13437 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13438 \pgf@x=.5\pgf@x
13439 }
13440 \anchor{in up}{
13441 \inOneFixed
13442 }
13443 \anchor{in down}{
13444 \inOneFixed
13445 \pgf@y=-\pgf@y
13446 }
13447 \savedanchor\inOne{%
13448 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13449 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
13450 \pgf@y=.5\pgf@y
13451 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
13452 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13453 \pgf@x=.5\pgf@x
13454 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13455 }
13456 \anchor{-}{
13457 \inOne
13458 }
13459 \anchor{+}{
13460 \inOne
13461 \pgf@y=-\pgf@y
13462 }
13463 \savedanchor\up{%
13464 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13465 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
13466 \pgf@y=.5\pgf@y
13467 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13468 \pgf@x=.5\pgf@x
13469 \pgf@circ@res@up = \pgf@y
13470 \pgf@circ@res@right = -\pgf@x
13471 \pgf@circ@res@left = \pgf@x
13472 \pgfpointlineattime{
13473 \ctikzvalof{tripoles/inst amp/up pos}}{
13474 \pgfpoint{
13475 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
13476 {\pgf@circ@res@up}}
13477 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
13478 }
13479 \anchor{up}{
13480 \up
13481 }
13482 \anchor{down}{
13483 \up
13484 \pgf@y=-\pgf@y
13485 }
13486 % reference voltage input anchors.
13487 \savedanchor\refv{%
13488 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13489 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
13490 \pgf@y=.5\pgf@y
13491 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13492 \pgf@x=.5\pgf@x
13493 \pgf@circ@res@up = \pgf@y
13494 \pgf@circ@res@right = -\pgf@x
13495 \pgf@circ@res@left = \pgf@x
13496 \pgfpointlineattime{
13497 \ctikzvalof{tripoles/inst amp/refv pos}}{
13498 \pgfpoint{
13499 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
13500 {\pgf@circ@res@up}}
13501 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
13502 }
13503 % we need both because they are normally drawn under the amp, and if you
13504 % mirror it vertically you need them
13505 \anchor{refv up}{
13506 \refv
13507 }
13508 \anchor{refv down}{
13509 \refv
13510 \pgf@y=-\pgf@y
13511 }
13512 \anchor{out}{
13513 \northwest
13514 \pgf@y=0pt
13515 \pgf@x=-\pgf@x
13516 }
13517 % support for border anchors
13518 \savedanchor\leftedge{%
13519 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13520 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
13521 \pgf@x=.5\pgf@x
13522 \pgf@x = \ctikzvalof{tripoles/inst amp/port width}\pgf@x
13523 \pgf@y=0pt
13524 }
13525 \anchor{leftedge}{\leftedge}
13526 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
13527 \anchor{bin up}{
13528 \inOneFixed
13529 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13530 }
13531 \anchor{bin down}{
13532 \inOneFixed
13533 \pgf@y=-\pgf@y
13534 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13535 }
13536 \anchor{b-}{
13537 \inOne
13538 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13539 }
13540 \anchor{b+}{
13541 \inOne
13542 \pgf@y=-\pgf@y
13543 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13544 }
13545 \anchor{bout}{
13546 \leftedge
13547 \pgf@y=0pt
13548 \pgf@x=-\pgf@x
13549 }
13550 % end border anchors
13551 \anchor{west}{
13552 \left
13553 }
13554 \anchor{east}{
13555 \left
13556 \pgf@x=-\pgf@x
13557 }
13558 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13559 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13560 \anchor{north west}{ \northwest }
13561 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13562
13563 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13564
13565 % let's start drawing the component
13566 \backgroundpath{
13567 \pgfsetcolor{\ctikzvalof{color}}
13568 %
13569 \northwest
13570 \pgf@circ@res@up = \pgf@y
13571 \pgf@circ@res@down = -\pgf@y
13572 \pgf@circ@res@right = -\pgf@x
13573 \pgf@circ@res@left = \pgf@x
13574 \pgf@circ@scaled@Rlen=\scaledRlen
13575
13576 % main component, normally in thicker lines
13577 \pgfscope
13578 \newdimen\pgf@circ@res@right@double
13579 \pgf@circ@res@right@double=2\pgf@circ@res@right
13580
13581 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13582 \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
13583 \pgf@circ@res@step=\pgf@circ@res@right
13584 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13585 \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@step
13586 %first point (near output)
13587 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{0}}
13588 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
13589 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
13590 % and then to the input "front up", "down", to the output short side "down"
13591 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13592 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13593 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@down}}
13594 % ...and close
13595 \pgfpathclose
13596 \pgf@circ@draworfill
13597 \endpgfscope
13598
13599 % Negative input terminal
13600 \pgfpathmoveto{\pgfpoint
13601 {\pgf@circ@res@left}
13602 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
13603 %
13604 \pgfpathlineto{\pgfpoint
13605 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
13606 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
13607 %
13608 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
13609
13610 % Positive input terminal
13611 \pgfpathmoveto{\pgfpoint
13612 {\pgf@circ@res@left}
13613 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
13614 %
13615 \pgfpathlineto{\pgfpoint
13616 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
13617 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
13618 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
13619
13620 % Output terminal
13621 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13622 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} %
13623 %
13624 \pgfsetrectcap
13625 \pgfusepath{draw}
13626 }
13627 }
13628
13629 % Instrumentation amplifier with terminals for gain resistance between inputs
13630 \pgfdeclareshape{inst amp ra}
13631 {
13632 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13633 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13634 \anchor{center}{\pgfpointorigin}
13635 % bounding-box top left
13636 \savedanchor\northwest{%
13637 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13638 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13639 \pgf@y=.5\pgf@y
13640 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13641 \pgf@x=.5\pgf@x
13642 }
13643 \anchor{nw}{
13644 \northwest
13645 }
13646 \anchor{south}{
13647 \northwest
13648 \pgf@y=-\pgf@y\pgf@x=0pt\relax
13649 }
13650 \anchor{north}{
13651 \northwest\pgf@x=0pt\relax
13652 }
13653 \savedanchor\left{%
13654 \pgf@y=0pt
13655 }
13656 \anchor{leftedge}
13657 {\left
13658 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
13659 }
13660 % inputs (+-)
13661 \savedanchor\inOneFixed{%
13662 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13663 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13664 \pgf@y=.5\pgf@y
13665 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
13666 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13667 \pgf@x=.5\pgf@x
13668 }
13669 \anchor{in up}{
13670 \inOneFixed
13671 }
13672 \anchor{in down}{
13673 \inOneFixed
13674 \pgf@y=-\pgf@y
13675 }
13676 \savedanchor\inOne{%
13677 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13678 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13679 \pgf@y=.5\pgf@y
13680 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
13681 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13682 \pgf@x=.5\pgf@x
13683 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13684 }
13685 \anchor{-}{
13686 \inOne
13687 }
13688 \anchor{+}{
13689 \inOne
13690 \pgf@y=-\pgf@y
13691 }
13692 % R ampli anchors. They are by default at 20% more than R-length distance
13693 % you can change that with the `ra pos` key (use 0.5 for one-R).
13694 \savedanchor\raOneFixed{%
13695 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13696 \pgf@y=\pgf@circ@scaled@Rlen
13697 \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
13698 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13699 \pgf@x=.5\pgf@x
13700 }
13701 \anchor{ra up}{
13702 \raOneFixed
13703 }
13704 \anchor{ra down}{
13705 \raOneFixed
13706 \pgf@y=-\pgf@y
13707 }
13708 \savedanchor\raOne{%
13709 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13710 \pgf@y=\pgf@circ@scaled@Rlen
13711 \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
13712 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13713 \pgf@x=.5\pgf@x
13714 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13715 }
13716 \anchor{ra-}{
13717 \raOne
13718 }
13719 \anchor{ra+}{
13720 \raOne
13721 \pgf@y=-\pgf@y
13722 }
13723 % power supplies
13724 \savedanchor\up{%
13725 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13726 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13727 \pgf@y=.5\pgf@y
13728 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13729 \pgf@x=.5\pgf@x
13730 \pgf@circ@res@up = \pgf@y
13731 \pgf@circ@res@right = -\pgf@x
13732 \pgf@circ@res@left = \pgf@x
13733 \pgfpointlineattime{
13734 \ctikzvalof{tripoles/inst amp ra/up pos}}{
13735 \pgfpoint{
13736 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13737 {\pgf@circ@res@up}}
13738 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
13739 }
13740 \anchor{up}{
13741 \up
13742 }
13743 \anchor{down}{
13744 \up
13745 \pgf@y=-\pgf@y
13746 }
13747 % reference voltage input anchors.
13748 \savedanchor\refv{%
13749 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13750 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13751 \pgf@y=0.5\pgf@y
13752 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13753 \pgf@x=0.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 \ctikzvalof{tripoles/inst amp ra/refv pos}}{
13759 \pgfpoint{
13760 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13761 {\pgf@circ@res@up}}
13762 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\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 \anchor{out}{
13774 \northwest
13775 \pgf@y=0pt
13776 \pgf@x=-\pgf@x
13777 }
13778 % support for border anchors
13779 \savedanchor\leftedge{%
13780 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13781 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13782 \pgf@x=.5\pgf@x
13783 \pgf@x = \ctikzvalof{tripoles/inst amp ra/port width}\pgf@x
13784 \pgf@y=0pt
13785 }
13786 \anchor{leftedge}{\leftedge}
13787 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
13788 \anchor{bin up}{
13789 \inOneFixed
13790 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13791 }
13792 \anchor{bin down}{
13793 \inOneFixed
13794 \pgf@y=-\pgf@y
13795 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13796 }
13797 \anchor{b-}{
13798 \inOne
13799 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13800 }
13801 \anchor{b+}{
13802 \inOne
13803 \pgf@y=-\pgf@y
13804 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13805 }
13806 \anchor{bra up}{
13807 \raOneFixed
13808 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13809 }
13810 \anchor{bra down}{
13811 \raOneFixed
13812 \pgf@y=-\pgf@y
13813 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13814 }
13815 \anchor{bra-}{
13816 \raOne
13817 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13818 }
13819 \anchor{bra+}{
13820 \raOne
13821 \pgf@y=-\pgf@y
13822 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
13823 }
13824 \anchor{bout}{
13825 \leftedge
13826 \pgf@y=0pt
13827 \pgf@x=-\pgf@x
13828 }
13829 % end border anchors
13830 \anchor{west}{
13831 \left
13832 }
13833 \anchor{east}{
13834 \left
13835 \pgf@x=-\pgf@x
13836 }
13837 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13838 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13839 \anchor{north west}{ \northwest }
13840 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13841
13842 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13843
13844 % drawing of the component
13845 \backgroundpath{
13846 \pgfsetcolor{\ctikzvalof{color}}
13847
13848 \northwest
13849 \pgf@circ@res@up = \pgf@y
13850 \pgf@circ@res@down = -\pgf@y
13851 \pgf@circ@res@right = -\pgf@x
13852 \pgf@circ@res@left = \pgf@x
13853 \pgf@circ@scaled@Rlen=\scaledRlen
13854
13855 \newdimen\pgf@circ@res@right@double
13856 \pgf@circ@res@right@double=2\pgf@circ@res@right
13857
13858 % main component, normally in thicker lines
13859 \pgfscope
13860 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13861 \pgftransformxshift{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13862 \pgf@circ@res@step=\pgf@circ@res@right
13863 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13864 \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@step
13865 %primer punto: la linea de salida (lado componente)
13866 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{0}}
13867 %from the exit to the top (short side)... (note that the .6 must be copied in \up anchor
13868 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
13869 % and then to the input "front up", "down", to the output short side "down"
13870 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13871 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13872 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@down}}
13873 % ...and close
13874 \pgfpathclose
13875 \pgf@circ@draworfill
13876 \endpgfscope
13877
13878 % ra terminal -
13879 \pgfpathmoveto{\pgfpoint
13880 {\pgf@circ@res@left}
13881 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13882 %
13883 \pgfpathlineto{\pgfpoint
13884 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13885 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13886 % ra terminal +
13887 \pgfpathmoveto{\pgfpoint
13888 {\pgf@circ@res@left}
13889 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13890 %
13891 \pgfpathlineto{\pgfpoint
13892 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13893 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13894
13895 % Negative input terminal
13896 \pgfpathmoveto{\pgfpoint
13897 {\pgf@circ@res@left}
13898 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
13899 %
13900 \pgfpathlineto{\pgfpoint
13901 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13902 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
13903 %
13904 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
13905
13906 % Positive input terminal
13907 \pgfpathmoveto{\pgfpoint
13908 {\pgf@circ@res@left}
13909 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
13910 %
13911 \pgfpathlineto{\pgfpoint
13912 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13913 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
13914 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
13915
13916 % Output terminal
13917 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13918 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} %
13919 %
13920 \pgfsetrectcap
13921 \pgfusepath{draw}
13922 }
13923 }
13924
13925 % Buffer
13926 % Contributed by Danilo Piazzalunga
13927 \pgfdeclareshape{buffer}
13928 {
13929 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13930 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13931 \anchor{center}{\pgfpointorigin}
13932 \savedanchor\northwest{%
13933 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13934 \pgf@y=\ctikzvalof{bipoles/buffer/height}\pgf@circ@scaled@Rlen
13935 \pgf@y=.5\pgf@y
13936 \pgf@x=-\ctikzvalof{bipoles/buffer/width}\pgf@circ@scaled@Rlen
13937 \pgf@x=.5\pgf@x
13938 }
13939 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
13940 \anchor{west}{ \northwest \pgf@y=0pt }
13941 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
13942 \anchor{north}{ \northwest \pgf@x=0pt }
13943 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13944 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13945 \anchor{north west}{ \northwest }
13946 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13947 \savedanchor\left{%
13948 \pgf@y=0pt
13949 }
13950 \anchor{in}{
13951 \northwest
13952 \pgf@y=0pt
13953 }
13954 \anchor{out}{
13955 \northwest
13956 \pgf@y=0pt
13957 \pgf@x=-\pgf@x
13958 }
13959 \anchor{bin}{
13960 \northwest
13961 \pgf@y=0pt
13962 \pgf@x=0.7\pgf@x
13963 }
13964 \anchor{bout}{
13965 \northwest
13966 \pgf@y=0pt
13967 \pgf@x=-0.7\pgf@x
13968 }
13969
13970 \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13971
13972 \backgroundpath{
13973 \pgfsetcolor{\ctikzvalof{color}}
13974
13975 \northwest
13976 \pgf@circ@res@up = \pgf@y
13977 \pgf@circ@res@down = -\pgf@y
13978 \pgf@circ@res@right = -\pgf@x
13979 \pgf@circ@res@left = \pgf@x
13980 \pgf@circ@scaled@Rlen=\scaledRlen
13981 \pgfscope
13982 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13983 \pgftransformxshift{.7\pgf@circ@res@left}
13984 \pgf@circ@res@step=\pgf@circ@res@right
13985 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13986 \pgf@circ@res@step=.7\pgf@circ@res@step
13987
13988 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13989 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13990 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13991 \pgfpathclose
13992 \pgf@circ@draworfill
13993 \endpgfscope
13994
13995 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
13996 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
13997
13998 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13999 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
14000
14001 \pgfusepath{draw}
14002 }
14003 }
14004
14005 % plain amplifier, no symbols
14006 \pgfdeclareshape{plain amp}
14007 {
14008 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
14009 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14010 \anchor{center}{\pgfpointorigin}
14011 \savedanchor\northwest{%
14012 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14013 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14014 \pgf@y=.5\pgf@y
14015 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14016 \pgf@x=.5\pgf@x
14017 }
14018 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
14019 \anchor{west}{ \northwest \pgf@y=0pt }
14020 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
14021 \anchor{north}{ \northwest \pgf@x=0pt }
14022 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14023 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
14024 \anchor{north west}{ \northwest }
14025 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
14026 \savedanchor\left{%
14027 \pgf@y=0pt
14028 }
14029 \savedanchor\inOne{%
14030 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14031 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14032 \pgf@y=.5\pgf@y
14033 \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
14034 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14035 \pgf@x=.5\pgf@x
14036 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
14037 }
14038 \savedanchor\inOneFixed{%
14039 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14040 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14041 \pgf@y=.5\pgf@y
14042 \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
14043 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14044 \pgf@x=.5\pgf@x
14045 }
14046 \anchor{-}{
14047 \inOne
14048 }
14049 \anchor{+}{
14050 \inOne
14051 \pgf@y=-\pgf@y
14052 }
14053 \anchor{in up}{
14054 \inOneFixed
14055 }
14056 \anchor{in down}{
14057 \inOneFixed
14058 \pgf@y=-\pgf@y
14059 }
14060 % support for border anchors
14061 \savedanchor\leftedge{%
14062 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14063 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14064 \pgf@x=.5\pgf@x
14065 \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
14066 \pgf@y=0pt
14067 }
14068 \anchor{leftedge}{\leftedge}
14069 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
14070 \anchor{bin up}{
14071 \inOneFixed
14072 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
14073 }
14074 \anchor{bin down}{
14075 \inOneFixed
14076 \pgf@y=-\pgf@y
14077 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
14078 }
14079 \anchor{b-}{
14080 \inOne
14081 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
14082 }
14083 \anchor{b+}{
14084 \inOne
14085 \pgf@y=-\pgf@y
14086 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
14087 }
14088 \anchor{bout}{
14089 \leftedge
14090 \pgf@y=0pt
14091 \pgf@x=-\pgf@x
14092 }
14093 % end border anchors
14094 \savedanchor\up{%
14095 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14096 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14097 \pgf@y=.5\pgf@y
14098 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14099 \pgf@x=.5\pgf@x
14100 \pgf@circ@res@up = \pgf@y
14101 \pgf@circ@res@right = -\pgf@x
14102 \pgf@circ@res@left = \pgf@x
14103 \pgfpointlineattime{
14104 \ctikzvalof{tripoles/plain amp/up pos}}{
14105 \pgfpoint{
14106 \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14107 {\pgf@circ@res@up}}
14108 {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
14109 }
14110 \anchor{up}{
14111 \up
14112 }
14113 \anchor{down}{
14114 \up
14115 \pgf@y=-\pgf@y
14116 }
14117 \anchor{out}{
14118 \northwest
14119 \pgf@y=0pt
14120 \pgf@x=-\pgf@x
14121 }
14122
14123 \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
14124
14125 \backgroundpath{
14126 \pgfsetcolor{\ctikzvalof{color}}
14127
14128 \northwest
14129 \pgf@circ@res@up = \pgf@y
14130 \pgf@circ@res@down = -\pgf@y
14131 \pgf@circ@res@right = -\pgf@x
14132 \pgf@circ@res@left = \pgf@x
14133
14134 \pgfscope
14135 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
14136 \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14137 \pgf@circ@res@step=\pgf@circ@res@right
14138 \advance\pgf@circ@res@step by -\pgf@circ@res@left
14139 \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
14140
14141 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
14142 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
14143 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
14144 \pgfpathclose
14145 \pgf@circ@draworfill
14146 \endpgfscope
14147 \pgfpathmoveto{\pgfpoint
14148 {\pgf@circ@res@left}
14149 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
14150 \pgfpathlineto{\pgfpoint
14151 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14152 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
14153
14154
14155 \pgfpathmoveto{\pgfpoint
14156 {\pgf@circ@res@left}
14157 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
14158 \pgfpathlineto{\pgfpoint
14159 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14160 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
14161
14162 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
14163 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
14164
14165 \pgfusepath{draw}
14166 }
14167 }
14168
14169 % plain amplifier, no symbols, one input
14170 \pgfdeclareshape{plain mono amp}
14171 {
14172 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
14173 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14174 \anchor{center}{\pgfpointorigin}
14175 \savedanchor\northwest{%
14176 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14177 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14178 \pgf@y=.5\pgf@y
14179 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14180 \pgf@x=.5\pgf@x
14181 }
14182 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
14183 \anchor{west}{ \northwest \pgf@y=0pt }
14184 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
14185 \anchor{north}{ \northwest \pgf@x=0pt }
14186 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14187 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
14188 \anchor{north west}{ \northwest }
14189 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
14190 \savedanchor\left{%
14191 \pgf@y=0pt
14192 }
14193 \savedanchor\inOne{%
14194 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14195 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14196 \pgf@x=.5\pgf@x
14197 \pgf@y=0pt\relax
14198 }
14199 \anchor{in}{
14200 \inOne
14201 }
14202 % support for border anchors
14203 \savedanchor\leftedge{%
14204 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14205 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14206 \pgf@x=.5\pgf@x
14207 \pgf@x = \ctikzvalof{tripoles/plain amp/port width}\pgf@x
14208 \pgf@y=0pt
14209 }
14210 \anchor{leftedge}{\leftedge}
14211 \anchor{rightedge}{\leftedge \pgf@x =-\pgf@x }
14212 \anchor{bin}{
14213 \inOne
14214 \pgf@ya=\pgf@y \leftedge \pgf@y=\pgf@ya
14215 }
14216 \anchor{bout}{
14217 \leftedge
14218 \pgf@y=0pt
14219 \pgf@x=-\pgf@x
14220 }
14221 % end border anchors
14222 \savedanchor\up{%
14223 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14224 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
14225 \pgf@y=.5\pgf@y
14226 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
14227 \pgf@x=.5\pgf@x
14228 \pgf@circ@res@up = \pgf@y
14229 \pgf@circ@res@right = -\pgf@x
14230 \pgf@circ@res@left = \pgf@x
14231 \pgfpointlineattime{
14232 \ctikzvalof{tripoles/plain amp/up pos}}{
14233 \pgfpoint{
14234 \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14235 {\pgf@circ@res@up}}
14236 {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
14237 }
14238 \anchor{up}{
14239 \up
14240 }
14241 \anchor{down}{
14242 \up
14243 \pgf@y=-\pgf@y
14244 }
14245 \anchor{out}{
14246 \northwest
14247 \pgf@y=0pt
14248 \pgf@x=-\pgf@x
14249 }
14250
14251 \anchor{text}{\pgfpoint{-.6\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
14252
14253 \backgroundpath{
14254 \pgfsetcolor{\ctikzvalof{color}}
14255
14256 \northwest
14257 \pgf@circ@res@up = \pgf@y
14258 \pgf@circ@res@down = -\pgf@y
14259 \pgf@circ@res@right = -\pgf@x
14260 \pgf@circ@res@left = \pgf@x
14261
14262 \pgfscope
14263 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
14264 \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14265 \pgf@circ@res@step=\pgf@circ@res@right
14266 \advance\pgf@circ@res@step by -\pgf@circ@res@left
14267 \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
14268
14269 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
14270 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
14271 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
14272 \pgfpathclose
14273 \pgf@circ@draworfill
14274 \endpgfscope
14275 \pgfpathmoveto{\pgfpoint
14276 {\pgf@circ@res@left}
14277 {0pt}}
14278 \pgfpathlineto{\pgfpoint
14279 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
14280 {0pt}}
14281
14282 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
14283 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
14284
14285 \pgfusepath{draw}
14286 }
14287 }
14288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14289 %% electromechanical device (motor/generator)
14290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14291
14292 \pgfdeclareshape{elmech}
14293 {
14294 \savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}}
14295 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14296 \savedanchor\northwest{
14297 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14298 \pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
14299 \pgf@y=.5\pgf@y
14300 \pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
14301 \pgf@x=.5\pgf@x
14302 }
14303 \anchor{center}{
14304 \pgfpointorigin
14305 }
14306 \anchor{text}{
14307 \pgfpointorigin
14308 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
14309 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
14310 }
14311 \anchor{left}{%
14312 \northwest
14313 \pgf@y=0pt
14314 }
14315 \anchor{right}{%
14316 \northwest
14317 \pgf@y=0pt
14318 \pgf@x=-\pgf@x
14319 }
14320 \anchor{top}{
14321 \northwest
14322 \pgf@x=0pt
14323 }
14324 \anchor{pathstart}{
14325 \northwest
14326 \pgf@x=0pt
14327 }
14328 \anchor{pathend}{
14329 \northwest
14330 \pgf@x=0pt
14331 \pgf@y=-\pgf@y
14332 }
14333 \anchor{bottom}{
14334 \northwest
14335 \pgf@x=0pt
14336 \pgf@y=-\pgf@y
14337 }
14338 \anchor{center}{
14339 \pgf@y=0pt
14340 \pgf@x=0pt
14341 }
14342 \anchor{east}{
14343 \northwest
14344 \pgf@y=0pt
14345 \pgf@x=-\pgf@x
14346 }
14347 \anchor{west}{
14348 \northwest
14349 \pgf@y=0pt
14350 }
14351 \anchor{south}{
14352 \northwest
14353 \pgf@x=0pt
14354 \pgf@y=-\pgf@y
14355 }
14356 \anchor{north}{
14357 \northwest
14358 \pgf@x=0pt
14359 }
14360 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14361 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
14362 \anchor{north west}{ \northwest }
14363 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
14364 \anchorborder{%
14365 \@tempdima=\pgf@x\@tempdimb=\pgf@y
14366 \northwest\pgf@circ@res@other=-\pgf@x
14367 \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}}
14368 }
14369 \anchor{block north west}{\northwest\pgf@x=0.5\pgf@x}
14370 \anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y}
14371 \anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x}
14372 \anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y}
14373 \anchor{block up right}{
14374 \northwest
14375 % remember that pgf@x is negative
14376 % center of the block is at 0.5*H+W*cos(30)/2
14377 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
14378 \pgf@x=-0.5\pgf@x
14379 }
14380 \anchor{block up left}{
14381 \northwest
14382 % remember that pgf@x is negative
14383 % center of the block is at 0.5*H+W*cos(30)/2
14384 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
14385 \pgf@x=0.5\pgf@x
14386 }
14387 \anchor{block down right}{
14388 \northwest
14389 % remember that pgf@x is negative
14390 % center of the block is at 0.5*H+W*cos(30)/2
14391 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
14392 \pgf@y=-\pgf@y
14393 \pgf@x=-0.5\pgf@x
14394 }
14395 \anchor{block down left}{
14396 \northwest
14397 % remember that pgf@x is negative
14398 % center of the block is at 0.5*H+W*cos(30)/2
14399 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
14400 \pgf@y=-\pgf@y
14401 \pgf@x=0.5\pgf@x
14402 }
14403 \behindbackgroundpath{
14404 \pgfsetcolor{\ctikzvalof{color}}
14405 \pgf@circ@scaled@Rlen=\scaledRlen
14406 \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
14407 \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
14408 \pgfscope
14409 \pgfstartlinewidth=\pgflinewidth
14410 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14411 \pgfscope % clip the bar: whole size minus the circle
14412 \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
14413 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14414 \pgfseteorule
14415 \pgfusepath{clip}
14416 \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
14417 \pgfsetfillcolor{\ctikzvalof{color}}
14418 \pgfusepath{fill, draw}
14419 \endpgfscope
14420 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14421 \ifx\tikz@fillcolor\pgfutil@empty
14422 % set the default fill color to white
14423 \pgfsetfillcolor{white}
14424 % ...but override it if the class is defined!
14425 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
14426 \else
14427 \pgfsetfillcolor{\tikz@fillcolor}
14428 \pgfusepath{draw, fill}
14429 \fi
14430 \endpgfscope
14431 }
14432 }
14433
14434 %%%%%%%%%%%%%%%%%%%
14435 %% Magnetron
14436 %%%%%%%%%%%%%%%%%%%
14437
14438 \pgfdeclareshape{magnetron}
14439 {
14440 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}} % class of these components
14441 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14442 \savedanchor\northwest{
14443 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14444 \pgf@y=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
14445 \pgf@y=.5\pgf@y
14446 \pgf@x=-\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
14447 \pgf@x=.5\pgf@x
14448 }
14449 \anchor{center}{
14450 \pgfpointorigin
14451 }
14452 \anchor{anode}{
14453 \northwest
14454 \pgf@x=0pt
14455 \pgf@y=-\pgf@y
14456 }
14457 \anchor{cathode1}{
14458 \northwest
14459 \pgf@circ@res@step=\pgf@y
14460 \pgfmathparse{cos(105)}
14461 \pgf@x=\pgfmathresult\pgf@circ@res@step
14462 \pgfmathparse{sin(105)}
14463 \pgf@y=\pgfmathresult\pgf@circ@res@step
14464 %\pgfpointorigin
14465 %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
14466 }
14467 \anchor{cathode2}{
14468 \northwest
14469 \pgf@circ@res@step=\pgf@y
14470 \pgfmathparse{cos(75)}
14471 \pgf@x=\pgfmathresult\pgf@circ@res@step
14472 \pgfmathparse{sin(75)}
14473 \pgf@y=\pgfmathresult\pgf@circ@res@step
14474 %\pgfpointorigin
14475 %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
14476 }
14477 \anchor{text}{
14478 \pgfpointorigin
14479 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
14480 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
14481 }
14482 \anchor{left}{%
14483 \northwest
14484 \pgf@y=0pt
14485 }
14486 \anchor{right}{%
14487 \northwest
14488 \pgf@y=0pt
14489 \pgf@x=-\pgf@x
14490 }
14491 \anchor{top}{
14492 \northwest
14493 \pgf@x=0pt
14494 }
14495 \anchor{pathstart}{
14496 \northwest
14497 \pgf@x=0pt
14498 }
14499 \anchor{pathend}{
14500 \northwest
14501 \pgf@x=0pt
14502 \pgf@y=-\pgf@y
14503 }
14504 \anchor{bottom}{
14505 \northwest
14506 \pgf@x=0pt
14507 \pgf@y=-\pgf@y
14508 }
14509 \anchor{center}{
14510 \pgf@y=0pt
14511 \pgf@x=0pt
14512 }
14513 \anchor{east}{
14514 \northwest
14515 \pgf@y=0pt
14516 \pgf@x=-\pgf@x
14517 }
14518 \anchor{west}{
14519 \northwest
14520 \pgf@y=0pt
14521 }
14522 \anchor{south}{
14523 \northwest
14524 \pgf@x=0pt
14525 \pgf@y=-\pgf@y
14526 }
14527 \anchor{north}{
14528 \northwest
14529 \pgf@x=0pt
14530 }
14531 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
14532 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
14533 \anchor{north west}{ \northwest }
14534 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
14535 \backgroundpath{
14536 \pgfsetcolor{\ctikzvalof{color}}
14537 \pgf@circ@scaled@Rlen=\scaledRlen
14538 \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
14539 \northwest
14540 \pgf@circ@res@up = \pgf@y
14541 \pgf@circ@res@down = -\pgf@y
14542 \pgf@circ@res@right = -\pgf@x
14543 \pgf@circ@res@left = \pgf@x
14544 \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
14545
14546 \pgfscope
14547 \pgfstartlinewidth=\pgflinewidth
14548 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14549 %create outer circle
14550 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
14551 \pgf@circ@draworfill
14552 %create chambers
14553 \foreach \angle in {45,135,225,315}{
14554 \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
14555 \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
14556 }
14557 \pgfsetroundcap
14558 \pgfusepath{draw}
14559 \pgfscope
14560 %draw connection from outside
14561 %anode
14562 \pgfsetlinewidth{\pgfstartlinewidth}
14563 \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
14564 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
14565 %cathodes
14566 \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
14567 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
14568 \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
14569 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
14570 \pgfsetbuttcap
14571 \pgfusepath{draw}
14572 \endpgfscope
14573 %create cathode
14574 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
14575 \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
14576 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
14577 \pgfusepath{draw}
14578 %create anode
14579 \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
14580 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
14581
14582 \pgfsetbuttcap
14583 \pgfusepath{draw}
14584 \endpgfscope
14585 }
14586 }
14587
14588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14589 % Electronic tubes, submitted by J. op den Brouw
14590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14591
14592 % Draw tube outline
14593 \def\pgf@circ@tubes@drawtube{%
14594 \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
14595 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
14596 \pgfutil@tempdima=\pgf@circ@res@right
14597 \advance\pgfutil@tempdima by -\pgf@circ@res@up
14598 \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
14599 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
14600 \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
14601 \pgfpatharc{270}{90}{\pgf@circ@res@up}
14602 \else
14603 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
14604 \pgfutil@tempdima=\pgf@circ@res@up
14605 \advance\pgfutil@tempdima by -\pgf@circ@res@right
14606 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
14607 \pgfpatharc{180}{0}{\pgf@circ@res@right}
14608 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
14609 \pgfpatharc{180}{0}{-\pgf@circ@res@right}
14610 \fi
14611 \pgfpathclose
14612 }
14613
14614 %% The diode (tube), triode, tetrode and pentode only differ in the
14615 %% number of grids. So we construct a generic declare function in
14616 %% which we can put code for the grid anchors and grid drawing code
14617 %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
14618 \long\def\pgfcircdeclaretube#1#2#3{%
14619 \pgfdeclareshape{#1}{
14620 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
14621 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14622 \anchor{center}{
14623 \pgfpointorigin
14624 }
14625 \savedanchor\northwest{%
14626 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14627 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
14628 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
14629 % x and y should be half the Rlen
14630 \pgf@y=\pgf@circ@res@up
14631 \pgf@y=.5\pgf@y
14632 \pgf@x=-\pgf@circ@res@right
14633 \pgf@x=.5\pgf@x
14634 }
14635 \anchor{north} {%
14636 \northwest
14637 \pgf@x=0pt
14638 }
14639 \anchor{east}{%
14640 \northwest
14641 \pgf@x=-\pgf@x
14642 \pgf@y=0pt
14643 }
14644 \anchor{south}{%
14645 \northwest
14646 \pgf@y=-\pgf@y
14647 \pgf@x=0pt
14648 }
14649 \anchor{west}{%
14650 \northwest
14651 \pgf@y=0pt
14652 }
14653 \anchor{north west}{%
14654 \northwest
14655 }
14656 \anchor{north east}{%
14657 \northwest
14658 \pgf@x=-\pgf@x
14659 }
14660 \anchor{south east}{
14661 \northwest
14662 \pgf@x=-\pgf@x
14663 \pgf@y=-\pgf@y
14664 }
14665 \anchor{south west}{
14666 \northwest
14667 \pgf@y=-\pgf@y
14668 }
14669 \anchor{anode} {%
14670 \northwest
14671 \pgf@x=0pt
14672 }
14673 \anchor{cathode}{%
14674 \northwest
14675 \pgf@y=-\pgf@y
14676 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
14677 }
14678 \anchor{cathode 1}{%
14679 \northwest
14680 \pgf@y=-\pgf@y
14681 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
14682 }
14683 \anchor{cathode 2}{%
14684 \northwest
14685 \pgf@y=-\pgf@y
14686 \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
14687 }
14688 \anchor{filament 1}{%
14689 \northwest
14690 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
14691 \pgf@x=\pgfmathresult\pgf@x
14692 \pgf@y=-\pgf@y
14693 }
14694 \anchor{filament 2}{%
14695 \northwest
14696 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
14697 \pgf@x=-\pgfmathresult\pgf@x
14698 \pgf@y=-\pgf@y
14699 }
14700
14701 % Extra anchors
14702 #2
14703
14704 \backgroundpath{
14705 \pgfscope
14706 % Line width for tripoles
14707 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
14708 \pgf@circ@scaled@Rlen=\scaledRlen
14709
14710 % Setup to draw tube
14711 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
14712 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
14713 \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
14714 \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14715
14716 % Tube outline
14717 \pgf@circ@tubes@drawtube
14718
14719 % Setup to draw grid, filament, anode and cathode
14720 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
14721 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
14722 \pgf@circ@res@up=0.5\pgf@circ@res@up
14723 \pgf@circ@res@right=0.5\pgf@circ@res@right
14724
14725 % Tube fill color (if any)
14726 \pgf@circ@draworfill
14727
14728 % Grid drawing
14729 #3
14730
14731 % Filament (is not drawn by default)
14732 \ifpgf@circuit@tubes@filament
14733 \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
14734 \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
14735 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
14736 \pgf@xa=\pgfmathresult\pgf@circ@res@right
14737 \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
14738 \pgf@ya=\pgfmathresult\pgf@circ@res@up
14739 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
14740 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
14741 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
14742 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
14743 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
14744 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
14745 \pgf@circuit@tubes@filamentfalse
14746 \fi
14747
14748 % Anode (or plate)
14749 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
14750 \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
14751 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
14752 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
14753
14754 % Cathode
14755 \ifpgf@circuit@tubes@nocathode
14756 \pgf@circuit@tubes@nocathodefalse
14757 \else
14758 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
14759 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
14760 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
14761 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
14762 \ifpgf@circuit@tubes@fullcathode
14763 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
14764 \pgf@circuit@tubes@fullcathodefalse
14765 \else
14766 \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}}
14767 \fi
14768 \fi
14769
14770 % Draw the background
14771 \pgfusepath{draw}
14772 \endpgfscope
14773 }
14774 }
14775 }
14776
14777 \pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
14778
14779 \pgfcircdeclaretube{triode}
14780 {
14781 \anchor{grid} {% should not be used
14782 \northwest
14783 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14784 }
14785 \anchor{control} {%
14786 \northwest
14787 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14788 }
14789 }
14790 {
14791 % Grid protrusion
14792 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14793 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14794 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
14795 \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
14796 % Grid dashes: calculations
14797 \pgf@xb=2\pgf@circ@res@right
14798 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14799 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14800 \multiply\pgf@circ@count@a by 2\relax
14801 \advance\pgf@circ@count@a by 1\relax
14802 \advance\pgf@circ@res@step by -\pgf@xa
14803 \divide\pgf@circ@res@step by \pgf@circ@count@a
14804 % Grid dashes: draw
14805 \pgf@circ@res@temp=\pgf@xa
14806 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14807 \loop
14808 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14809 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
14810 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14811 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
14812 \advance\pgf@circ@count@a by-1
14813 \ifnum\pgf@circ@count@a>0\relax
14814 \repeat
14815 }
14816
14817 \pgfcircdeclaretube{tetrode}
14818 {
14819 \anchor{grid} {% should not be used
14820 \northwest
14821 \pgfutil@tempdima=\pgf@y
14822 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14823 \pgf@y=0.5\pgf@y
14824 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14825 }
14826 \anchor{control} {%
14827 \northwest
14828 \pgfutil@tempdima=\pgf@y
14829 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14830 \pgf@y=0.5\pgf@y
14831 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14832 }
14833 \anchor{screen} {%
14834 \northwest
14835 \pgfutil@tempdima=\pgf@y
14836 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
14837 \pgf@y=0.5\pgf@y
14838 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14839 }
14840 }
14841 {
14842 % Grid x/y points
14843 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14844 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14845 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
14846 \pgfutil@tempdimb=-\pgfutil@tempdima
14847 \pgfutil@tempdima=0.5\pgfutil@tempdima
14848 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14849 \pgfutil@tempdimb=0.5\pgfutil@tempdimb
14850 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14851 % Grid protrusion
14852 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
14853 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
14854 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
14855 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
14856 % Grid dashes: calculations
14857 \pgf@xb=2\pgf@circ@res@right
14858 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14859 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14860 \multiply\pgf@circ@count@a by 2\relax
14861 \advance\pgf@circ@count@a by 1\relax
14862 \advance\pgf@circ@res@step by -\pgf@xa
14863 \divide\pgf@circ@res@step by \pgf@circ@count@a
14864 % Grid dashes: draw
14865 \pgf@circ@res@temp=\pgf@xa
14866 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14867 \loop
14868 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14869 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
14870 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
14871 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
14872 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
14873 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14874 \advance\pgf@circ@count@a by-1
14875 \ifnum\pgf@circ@count@a>0\relax
14876 \repeat
14877 }
14878
14879 \pgfcircdeclaretube{pentode}
14880 {
14881 \anchor{grid} {% should not be used
14882 \northwest
14883 \pgfutil@tempdima=\pgf@y
14884 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14885 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14886 }
14887 \anchor{control} {%
14888 \northwest
14889 \pgfutil@tempdima=\pgf@y
14890 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14891 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14892 }
14893 \anchor{screen} {%
14894 \northwest
14895 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14896 }
14897 \anchor{suppressor} {%
14898 \northwest
14899 \pgfutil@tempdima=\pgf@y
14900 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
14901 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14902 }
14903 }
14904 {
14905 % Grid x/y points
14906 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14907 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14908 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
14909 \pgfutil@tempdimb=-\pgfutil@tempdima
14910 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14911 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14912 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14913 % Grid protrusion
14914 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
14915 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
14916 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
14917 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
14918 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
14919 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
14920 % Grid dashes: calculations
14921 \pgf@xb=2\pgf@circ@res@right
14922 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14923 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14924 \multiply\pgf@circ@count@a by 2\relax
14925 \advance\pgf@circ@count@a by 1\relax
14926 \advance\pgf@circ@res@step by -\pgf@xa
14927 \divide\pgf@circ@res@step by \pgf@circ@count@a
14928 % Grid dashes: draw
14929 \pgf@circ@res@temp=\pgf@xa
14930 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14931 \loop
14932 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14933 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
14934 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
14935 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
14936 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
14937 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
14938 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
14939 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14940 \advance\pgf@circ@count@a by-1
14941 \ifnum\pgf@circ@count@a>0\relax
14942 \repeat
14943 }
14944
14945 \pgfcircdeclaretube{pentode suppressor to cathode}
14946 {
14947 \anchor{grid} {% should not be used
14948 \northwest
14949 \pgfutil@tempdima=\pgf@y
14950 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14951 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14952 }
14953 \anchor{control} {%
14954 \northwest
14955 \pgfutil@tempdima=\pgf@y
14956 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14957 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14958 }
14959 \anchor{screen} {%
14960 \northwest
14961 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14962 }
14963 }
14964 {
14965 % Grid x/y points
14966 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14967 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14968 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
14969 \pgfutil@tempdimb=-\pgfutil@tempdima
14970 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14971 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14972 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14973 % Grid protrusion
14974 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
14975 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
14976 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
14977 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
14978 % Grid dashes: calculations
14979 \pgf@xb=2\pgf@circ@res@right
14980 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14981 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14982 \multiply\pgf@circ@count@a by 2\relax
14983 \advance\pgf@circ@count@a by 1\relax
14984 \advance\pgf@circ@res@step by -\pgf@xa
14985 \divide\pgf@circ@res@step by \pgf@circ@count@a
14986 % Grid dashes: draw
14987 \pgf@circ@res@temp=\pgf@xa
14988 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14989 \loop
14990 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14991 \ifnum\pgf@circ@count@a>1\relax
14992 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
14993 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
14994 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
14995 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
14996 \fi
14997 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
14998 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
14999 \advance\pgf@circ@res@temp by\pgf@circ@res@step
15000 \advance\pgf@circ@count@a by-1
15001 \ifnum\pgf@circ@count@a>0\relax
15002 \repeat
15003 % Grid: connection from suppressor to cathode
15004 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
15005 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
15006 \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}}
15007
15008 }
15009
15010 %%%---------- close: tex/pgfcirctripoles
15011 %%%%%%%%%%% Springe nach tex/pgfcircquadpoles
15012 %%%---------- open: tex/pgfcircquadpoles.tex
15013 % Copyright 2018-2026 by Romano Giannetti
15014 % Copyright 2015-2026 by Stefan Lindner
15015 % Copyright 2013-2026 by Stefan Erhardt
15016 % Copyright 2007-2026 by Massimo Redaelli
15017 %
15018 % This file may be distributed and/or modified
15019 %
15020 % 1. under the LaTeX Project Public License and/or
15021 % 2. under the GNU Public License.
15022 %
15023 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15024
15025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15026 %% Quadripoles
15027
15028 \long\def\pgfcircdeclarequadpole#1#2#3{
15029 \pgfdeclareshape{#1}
15030 {
15031 \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}}
15032 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15033 % shapename
15034 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
15035 \anchor{center}{
15036 \northwest
15037 \pgf@x=0pt
15038 \pgf@y=0pt
15039 }
15040 \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
15041 \savedanchor\northwest{%
15042 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15043 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
15044 \pgf@y=.5\pgf@y
15045 \pgf@x=.5\pgf@circ@scaled@Rlen
15046 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
15047 }
15048 %% we define the upper right (positive coord) dot (which is B1)
15049 \savedanchor{\innerdot}{%
15050 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15051 \pgf@xa=.5\pgf@circ@scaled@Rlen
15052 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
15053 % by default use the cute inductor size
15054 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
15055 % check if it's american
15056 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
15057 \edef\pgf@temp{american}
15058 \ifx\pgf@circ@temp\pgf@temp
15059 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
15060 \fi
15061 % check if it's european
15062 \edef\pgf@temp{european}
15063 \ifx\pgf@circ@temp\pgf@temp
15064 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
15065 \fi
15066 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
15067 }
15068 \savedanchor{\outerdot}{%
15069 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15070 \pgf@xa=.5\pgf@circ@scaled@Rlen
15071 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
15072 % by default use the cute inductor size
15073 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
15074 % check if it's american
15075 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
15076 \edef\pgf@temp{american}
15077 \ifx\pgf@circ@temp\pgf@temp
15078 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
15079 \fi
15080 % check if it's european
15081 \edef\pgf@temp{european}
15082 \ifx\pgf@circ@temp\pgf@temp
15083 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
15084 \fi
15085 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
15086 }
15087 \anchor{A2}{
15088 \northwest
15089 \pgf@y=-\pgf@y
15090 }
15091 \anchor{B1}{
15092 \northwest
15093 \pgf@x=-\pgf@x
15094 }
15095 \anchor{A1}{
15096 \northwest
15097 }
15098 \anchor{B2}{
15099 \northwest
15100 \pgf@x=-\pgf@x
15101 \pgf@y=-\pgf@y
15102 }
15103 %% dot's anchors
15104 \anchor{inner dot A1}{\innerdot\pgf@x=-\pgf@x}
15105 \anchor{outer dot A1}{\outerdot\pgf@x=-\pgf@x}
15106 \anchor{inner dot A2}{\innerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15107 \anchor{outer dot A2}{\outerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15108 \anchor{inner dot B1}{\innerdot}
15109 \anchor{outer dot B1}{\outerdot}
15110 \anchor{inner dot B2}{\innerdot\pgf@y=-\pgf@y}
15111 \anchor{outer dot B2}{\outerdot\pgf@y=-\pgf@y}
15112 % geographical
15113 \anchor{north}{
15114 \northwest
15115 \pgf@x=0pt
15116 }
15117 \anchor{south}{
15118 \northwest
15119 \pgf@x=0pt
15120 \pgf@y=-\pgf@y
15121 }
15122 \anchor{west}{
15123 \northwest
15124 \pgf@y=0pt
15125 }
15126 \anchor{east}{
15127 \northwest
15128 \pgf@y=0pt
15129 \pgf@x=-\pgf@x
15130 }
15131 \anchor{south west}{
15132 \northwest
15133 \pgf@y=-\pgf@y
15134 }
15135 \anchor{north east}{
15136 \northwest
15137 \pgf@x=-\pgf@x
15138 }
15139 \anchor{north west}{
15140 \northwest
15141 }
15142 \anchor{south east}{
15143 \northwest
15144 \pgf@x=-\pgf@x
15145 \pgf@y=-\pgf@y
15146 }
15147 \anchor{base}{
15148 \northwest
15149 \pgf@x=0pt
15150 }
15151 #3
15152 \backgroundpath{
15153 \pgfsetcolor{\ctikzvalof{color}}
15154
15155 \northwest
15156 \pgf@circ@res@up = \pgf@y
15157 \pgf@circ@res@down = -\pgf@y
15158 \pgf@circ@res@right = -\pgf@x
15159 \pgf@circ@res@left = \pgf@x
15160 #2
15161 }
15162 }
15163 }
15164
15165
15166 \def\pgf@circ@drawtransformerbasicanchor{
15167 \ctikzvalof{quadpoles/trans/height}
15168 \anchor{AA2}{
15169 \northwest
15170 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
15171 \pgf@x=.7\pgf@x
15172 \pgf@y=-\pgf@y
15173 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
15174 }
15175 \anchor{BB1}{
15176 \northwest
15177 \pgf@x=-\pgf@x
15178 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
15179 \pgf@x=.7\pgf@x
15180 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
15181 }
15182 \anchor{AA1}{
15183 \northwest
15184 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
15185 \pgf@x=.7\pgf@x
15186 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
15187 }
15188 \anchor{BB2}{
15189 \northwest
15190 \pgf@x=-\pgf@x
15191 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
15192 \pgf@x=.7\pgf@x
15193 \pgf@y=-\pgf@y
15194 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
15195 }
15196 }
15197
15198 %% Null styles that can be used to change individually the L1 and L2
15199 %% inductors of the transformer.
15200
15201 \ctikzset{transformer L1/.style={}}
15202 \ctikzset{transformer L2/.style={}}
15203
15204 \def\pgf@circ@drawtransformerbasicbody{
15205 \pgfscope
15206 \pgfslopedattimetrue
15207 \pgfallowupsidedownattimetrue
15208 \pgftransformlineattime{.5}{%
15209 \pgfpoint%
15210 {\stretto\pgf@circ@res@left}%
15211 {\pgf@circ@res@up}%
15212 }{%
15213 \pgfpoint
15214 {\stretto\pgf@circ@res@left}%
15215 {\pgf@circ@res@down}%
15216 }
15217
15218 \pgfkeys{\circuitikzbasekey/.cd, transformer L1}
15219 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
15220 \def\pgf@temp{european}%
15221 \ifx\pgf@temp\pgf@circ@temp%
15222 \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
15223 \else%
15224 \def\pgf@temp{cute}
15225 \ifx\pgf@temp\pgf@circ@temp%
15226 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
15227 \else%
15228 \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
15229 \fi%
15230 \fi%
15231
15232
15233 \endpgfscope
15234 \pgfscope
15235 \pgfslopedattimetrue
15236 \pgfallowupsidedownattimetrue
15237 \pgftransformlineattime{.5}{%
15238 \pgfpoint%
15239 {\stretto\pgf@circ@res@right}%
15240 {\pgf@circ@res@down}%
15241 }{%
15242 \pgfpoint
15243 {\stretto\pgf@circ@res@right}%
15244 {\pgf@circ@res@up}%
15245 }
15246
15247 \pgfkeys{\circuitikzbasekey/.cd, transformer L2}
15248 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
15249 \def\pgf@temp{european}%
15250 \ifx\pgf@temp\pgf@circ@temp%
15251 \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
15252 \else%
15253 \def\pgf@temp{cute}
15254 \ifx\pgf@temp\pgf@circ@temp%
15255 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
15256 \else%
15257 \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
15258 \fi%
15259 \fi%
15260
15261 \endpgfscope
15262
15263 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
15264 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
15265 \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}}
15266
15267 \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}}
15268 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
15269 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
15270
15271 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
15272 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
15273 \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}}
15274
15275 \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}}
15276 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
15277 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
15278
15279 \pgfusepath{draw}
15280
15281 }
15282
15283
15284 \pgfcircdeclarequadpole{transformer}{
15285 \pgf@circ@drawtransformerbasicbody
15286 }{\pgf@circ@drawtransformerbasicanchor}
15287
15288 \pgfcircdeclarequadpole{transformer core}{
15289
15290 \pgf@circ@drawtransformerbasicbody
15291
15292 % use the chocke line thickness
15293 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
15294
15295 % Find the distance from center for the lines representing the core
15296 % the 2.5 is for backward compatibility --- the distance was calculated as a fraction
15297 % of the whole component, now as a fraction of the distance between coils, to be
15298 % compatible with the quadpoles "inner" style.
15299 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
15300
15301 \pgfmoveto{\pgfpoint%
15302 {\pgf@circ@res@other}%
15303 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
15304 }
15305 \pgflineto{
15306 \pgfpoint%
15307 {\pgf@circ@res@other}%
15308 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
15309 }
15310
15311 %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
15312 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
15313 \pgfmoveto{\pgfpoint%
15314 {\pgf@circ@res@other}%
15315 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
15316 }
15317 \pgflineto{
15318 \pgfpoint%
15319 {\pgf@circ@res@other}%
15320 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
15321 }
15322
15323 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
15324 \pgfusepath{draw}
15325 }{\pgf@circ@drawtransformerbasicanchor}
15326
15327
15328 \pgfcircdeclarequadpole{gyrator}{
15329
15330 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
15331 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
15332 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
15333 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
15334
15335 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
15336 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
15337 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
15338 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
15339
15340 \pgfusepath{draw}
15341
15342 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
15343 \pgfmathsetlength{\pgf@circ@res@other}{min(.7*\stretto*\pgf@circ@res@up, .8*\pgf@circ@res@right)} % radius
15344 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{-\pgf@circ@res@other}}
15345 \pgfpatharc{-90}{90}{\pgf@circ@res@other}
15346 \pgfpathclose
15347 \pgf@circ@draworfill
15348
15349 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@other}}
15350 \pgfpatharc{90}{270}{\pgf@circ@res@other}
15351 \pgfpathclose
15352 \pgf@circ@draworfill
15353 }{}
15354
15355 %%%%%%%%%%%%%%%%%%%%
15356 %% Block elements
15357 %%%%%%%%%%%%%%%%%%%%
15358
15359 \pgfdeclareshape{mixer}
15360 {
15361 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15362 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15363 \savedanchor\northwest{
15364 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15365 \ifpgf@circuit@boxed
15366 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15367 \pgf@y=.5\pgf@y
15368 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15369 \pgf@x=.5\pgf@x
15370 \else
15371 \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
15372 \pgf@y=.5\pgf@y
15373 \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
15374 \pgf@x=.5\pgf@x
15375 \fi
15376 }
15377 \anchor{center}{
15378 \pgfpointorigin
15379 }
15380 \anchor{left}{%
15381 \northwest
15382 \pgf@y=0pt
15383 }
15384 \anchor{1}{
15385 \northwest
15386 \pgf@y=0pt
15387 }
15388 \anchor{2}{
15389 \northwest
15390 \pgf@y=-\pgf@y
15391 \pgf@x=0pt
15392 }
15393 \anchor{3}{
15394 \northwest
15395 \pgf@y=0pt
15396 \pgf@x=-\pgf@x
15397 }
15398 \anchor{4}{
15399 \northwest
15400 \pgf@y=\pgf@y
15401 \pgf@x=0pt
15402 }
15403 \anchor{in 1}{
15404 \northwest
15405 \pgf@y=0pt
15406 }
15407 \anchor{in1}{
15408 \northwest
15409 \pgf@y=0pt
15410 }
15411 \anchor{in}{
15412 \northwest
15413 \pgf@y=0pt
15414 }
15415 \anchor{in 2}{
15416 \northwest
15417 \pgf@y=-\pgf@y
15418 \pgf@x=0pt
15419 }
15420 \anchor{in2}{
15421 \northwest
15422 \pgf@y=-\pgf@y
15423 \pgf@x=0pt
15424 }
15425 \anchor{out}{
15426 \northwest
15427 \pgf@y=0pt
15428 \pgf@x=-\pgf@x
15429 }
15430 \anchor{center}{
15431 \pgf@y=0pt
15432 \pgf@x=0pt
15433 }
15434 \anchor{east}{
15435 \northwest
15436 \pgf@y=0pt
15437 \pgf@x=-\pgf@x
15438 }
15439 \anchor{west}{
15440 \northwest
15441 \pgf@y=0pt
15442 }
15443 \anchor{south}{
15444 \northwest
15445 \pgf@x=0pt
15446 \pgf@y=-\pgf@y
15447 }
15448 \anchor{north}{
15449 \northwest
15450 \pgf@x=0pt
15451 }
15452 \anchor{south west}{
15453 \northwest
15454 \pgf@y=-\pgf@y
15455 }
15456 \anchor{north east}{
15457 \northwest
15458 \pgf@x=-\pgf@x
15459 }
15460 \anchor{north west}{
15461 \northwest
15462 }
15463 \anchor{south east}{
15464 \northwest
15465 \pgf@x=-\pgf@x
15466 \pgf@y=-\pgf@y
15467 }
15468 \backgroundpath{
15469 \pgfsetcolor{\ctikzvalof{color}}
15470 \pgf@circ@scaled@Rlen=\scaledRlen
15471
15472 \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
15473
15474 \pgfscope
15475 \pgfstartlinewidth=\pgflinewidth
15476
15477 % draw outer box
15478 \ifpgf@circuit@boxed
15479 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
15480 \fi
15481
15482 % draw outer circle
15483 \ifpgf@circuit@boxed
15484 \pgf@circ@res@step=.7\pgf@circ@res@step
15485 \pgfsetdash{}{0pt} % draw solid circle if boxed
15486 \else
15487 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
15488 \fi
15489 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
15490 \pgf@circ@draworfill
15491
15492 % draw inner stuff
15493 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15494 \pgfsetlinewidth{\pgfstartlinewidth}
15495 \pgfpathmoveto{\pgfpointorigin}
15496 \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
15497 \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
15498 \pgfpathmoveto{\pgfpointorigin}
15499 \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
15500 \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
15501 \pgfusepath{draw}
15502
15503 \endpgfscope
15504 }
15505 }
15506
15507 \pgfdeclareshape{adder}
15508 {
15509 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15510 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15511 \savedanchor\northwest{
15512 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15513 \ifpgf@circuit@boxed
15514 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15515 \pgf@y=.5\pgf@y
15516 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15517 \pgf@x=.5\pgf@x
15518 \else
15519 \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
15520 \pgf@y=.5\pgf@y
15521 \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
15522 \pgf@x=.5\pgf@x
15523 \fi
15524 }
15525 \anchor{center}{
15526 \pgfpointorigin
15527 }
15528 \anchor{left}{%
15529 \northwest
15530 \pgf@y=0pt
15531 }
15532 \anchor{1}{
15533 \northwest
15534 \pgf@y=0pt
15535 }
15536 \anchor{2}{
15537 \northwest
15538 \pgf@y=-\pgf@y
15539 \pgf@x=0pt
15540 }
15541 \anchor{3}{
15542 \northwest
15543 \pgf@y=0pt
15544 \pgf@x=-\pgf@x
15545 }
15546 \anchor{4}{
15547 \northwest
15548 \pgf@y=\pgf@y
15549 \pgf@x=0pt
15550 }
15551 \anchor{in 1}{
15552 \northwest
15553 \pgf@y=0pt
15554 }
15555 \anchor{in1}{
15556 \northwest
15557 \pgf@y=0pt
15558 }
15559 \anchor{in}{
15560 \northwest
15561 \pgf@y=0pt
15562 }
15563 \anchor{in 2}{
15564 \northwest
15565 \pgf@y=-\pgf@y
15566 \pgf@x=0pt
15567 }
15568 \anchor{in2}{
15569 \northwest
15570 \pgf@y=-\pgf@y
15571 \pgf@x=0pt
15572 }
15573 \anchor{out}{
15574 \northwest
15575 \pgf@y=0pt
15576 \pgf@x=-\pgf@x
15577 }
15578 \anchor{center}{
15579 \pgf@y=0pt
15580 \pgf@x=0pt
15581 }
15582 \anchor{east}{
15583 \northwest
15584 \pgf@y=0pt
15585 \pgf@x=-\pgf@x
15586 }
15587 \anchor{west}{
15588 \northwest
15589 \pgf@y=0pt
15590 }
15591 \anchor{south}{
15592 \northwest
15593 \pgf@x=0pt
15594 \pgf@y=-\pgf@y
15595 }
15596 \anchor{north}{
15597 \northwest
15598 \pgf@x=0pt
15599 }
15600 \anchor{south west}{
15601 \northwest
15602 \pgf@y=-\pgf@y
15603 }
15604 \anchor{north east}{
15605 \northwest
15606 \pgf@x=-\pgf@x
15607 }
15608 \anchor{north west}{
15609 \northwest
15610 }
15611 \anchor{south east}{
15612 \northwest
15613 \pgf@x=-\pgf@x
15614 \pgf@y=-\pgf@y
15615 }
15616 \backgroundpath{
15617 \pgfsetcolor{\ctikzvalof{color}}
15618 \pgf@circ@scaled@Rlen=\scaledRlen
15619
15620 \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
15621
15622 \pgfscope
15623 \pgfstartlinewidth=\pgflinewidth
15624
15625 % draw outer box
15626 \ifpgf@circuit@boxed
15627 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
15628 \fi
15629
15630 % draw outer circle
15631 \ifpgf@circuit@boxed
15632 \pgf@circ@res@step=.7\pgf@circ@res@step{}
15633 \pgfsetdash{}{0pt} % draw solid circle if boxed
15634 \else
15635 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
15636 \fi
15637 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
15638 \pgf@circ@draworfill
15639
15640 % draw inner stuff
15641 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15642 \pgfsetlinewidth{\pgfstartlinewidth}
15643
15644 \pgfpathmoveto{\pgfpointorigin}
15645 \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
15646 \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
15647 \pgfpathmoveto{\pgfpointorigin}
15648 \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
15649 \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
15650 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
15651 \pgfusepath{draw}
15652
15653 \endpgfscope
15654 }
15655 }
15656
15657 \pgfdeclareshape{oscillator}
15658 {
15659 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15660 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15661 \savedanchor\northwest{
15662 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15663 \ifpgf@circuit@boxed
15664 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15665 \pgf@y=.5\pgf@y
15666 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15667 \else
15668 \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
15669 \pgf@y=.5\pgf@y
15670 \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
15671 \fi
15672 }
15673 \anchor{center}{
15674 \pgfpointorigin
15675 }
15676 \anchor{north}{
15677 \northwest
15678 \pgf@x=.5\pgf@x
15679 }
15680 \anchor{south}{
15681 \northwest
15682 \pgf@x=.5\pgf@x
15683 \pgf@y=-\pgf@y
15684 }
15685 \anchor{east}{
15686 \northwest
15687 \pgf@y=0pt
15688 \pgf@x=0pt
15689 }
15690 \anchor{west}{
15691 \northwest
15692 \pgf@y=0pt
15693 }
15694 \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
15695 \anchor{north east}{ \northwest \pgf@x=0pt\relax}
15696 \anchor{north west}{ \northwest }
15697 \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
15698 \anchor{text}{
15699 \pgf@x=-2\pgf@x
15700 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
15701 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
15702 }
15703 \backgroundpath{
15704 \pgfsetcolor{\ctikzvalof{color}}
15705 \pgf@circ@scaled@Rlen=\scaledRlen
15706
15707 \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
15708
15709 \pgfscope
15710 \pgfstartlinewidth=\pgflinewidth
15711
15712 \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
15713
15714 % draw outer box
15715 \ifpgf@circuit@boxed{}
15716 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
15717 \fi
15718
15719 % draw outer circle
15720 \ifpgf@circuit@boxed
15721 \pgf@circ@res@step=.7\pgf@circ@res@step{}
15722 \pgfsetdash{}{0pt} % draw solid circle if boxed
15723 \else
15724 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
15725 \fi
15726 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
15727 \pgf@circ@draworfill
15728
15729 % draw inner sine waves
15730 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15731 \pgfsetlinewidth{\pgfstartlinewidth}
15732 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
15733 \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
15734 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
15735 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
15736 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
15737 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
15738
15739 \pgfusepath{draw}
15740
15741 \endpgfscope
15742 }
15743 }
15744
15745 \pgfdeclareshape{circulator}
15746 {
15747 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15748 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15749 \savedanchor\northwest{
15750 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15751 \ifpgf@circuit@boxed
15752 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15753 \pgf@y=.5\pgf@y
15754 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
15755 \pgf@x=.5\pgf@x
15756 \else
15757 \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
15758 \pgf@y=.5\pgf@y
15759 \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
15760 \pgf@x=.5\pgf@x
15761 \fi
15762 }
15763 \anchor{center}{
15764 \pgfpointorigin
15765 }
15766 \anchor{left}{%
15767 \northwest
15768 \pgf@y=0pt
15769 }
15770 \anchor{1}{
15771 \northwest
15772 \pgf@y=0pt
15773 }
15774 \anchor{2}{
15775 \northwest
15776 \pgf@y=0pt
15777 \pgf@x=-\pgf@x
15778 }
15779 \anchor{3}{
15780 \northwest
15781 \pgf@y=-\pgf@y
15782 \pgf@x=0pt
15783 }
15784 \anchor{east}{
15785 \northwest
15786 \pgf@y=0pt
15787 \pgf@x=-\pgf@x
15788 }
15789 \anchor{west}{
15790 \northwest
15791 \pgf@y=0pt
15792 }
15793 \anchor{south}{
15794 \northwest
15795 \pgf@x=0pt
15796 \pgf@y=-\pgf@y
15797 }
15798 \anchor{north}{
15799 \northwest
15800 \pgf@x=0pt
15801 }
15802 \anchor{south west}{
15803 \northwest
15804 \pgf@y=-\pgf@y
15805 }
15806 \anchor{north east}{
15807 \northwest
15808 \pgf@x=-\pgf@x
15809 }
15810 \anchor{north west}{
15811 \northwest
15812 }
15813 \anchor{south east}{
15814 \northwest
15815 \pgf@x=-\pgf@x
15816 \pgf@y=-\pgf@y
15817 }
15818 \backgroundpath{
15819 \pgfsetcolor{\ctikzvalof{color}}
15820 \pgf@circ@scaled@Rlen=\scaledRlen
15821
15822 \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
15823
15824 \pgfscope
15825 \pgfstartlinewidth=\pgflinewidth
15826
15827 % draw outer box
15828 \ifpgf@circuit@boxed
15829 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
15830 \fi
15831
15832 % draw outer circle
15833 \ifpgf@circuit@boxed{}
15834 \pgf@circ@res@step=.7\pgf@circ@res@step{}
15835 \pgfsetdash{}{0pt} % draw solid circle if boxed
15836 \else
15837 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
15838 \fi
15839 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
15840 \pgf@circ@draworfill
15841
15842 % inner arrow
15843 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15844 \pgfsetlinewidth{\pgfstartlinewidth}
15845
15846 \pgfsetarrowsend{latex}
15847 \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
15848 \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
15849 \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
15850 \pgfusepath{draw}
15851
15852 \endpgfscope
15853 }
15854 }
15855
15856
15857 % Wilkinson divider
15858 \pgfdeclareshape{wilkinson}{
15859 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15860 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15861 \savedanchor\northwest{%
15862 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15863 \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen
15864 \pgf@y=.5\pgf@y
15865 \pgf@x= \pgf@circ@scaled@Rlen
15866 \pgf@x=.5\pgf@x
15867 \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x
15868 }
15869 \anchor{center}{
15870 \northwest
15871 \pgf@x=0pt
15872 \pgf@y=0pt
15873 }
15874 \anchor{north}{
15875 \northwest
15876 \pgf@x=0pt
15877 }
15878 \anchor{south}{
15879 \northwest
15880 \pgf@x=0pt
15881 \pgf@y=-\pgf@y
15882 }
15883 \anchor{west}{
15884 \northwest
15885 \pgf@y=0pt
15886 }
15887 \anchor{east}{
15888 \northwest
15889 \pgf@y=0pt
15890 \pgf@x=-\pgf@x
15891 }
15892 \anchor{south west}{
15893 \northwest
15894 \pgf@y=-\pgf@y
15895 }
15896 \anchor{north east}{
15897 \northwest
15898 \pgf@x=-\pgf@x
15899 }
15900 \anchor{north west}{
15901 \northwest
15902 }
15903 \anchor{south east}{
15904 \northwest
15905 \pgf@x=-\pgf@x
15906 \pgf@y=-\pgf@y
15907 }
15908 \anchor{in}{
15909 \northwest
15910 \pgf@y=0pt
15911 }
15912 \anchor{out1}{
15913 \northwest
15914 \pgf@x=-\pgf@x
15915 \pgf@y=-0.5\pgf@y
15916 }
15917 \anchor{out2}{
15918 \northwest
15919 \pgf@x=-\pgf@x
15920 \pgf@y=0.5\pgf@y
15921 }
15922 \anchor{text}{
15923 \northwest
15924 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
15925 \pgf@x=-.5\wd\pgfnodeparttextbox
15926 }
15927 \backgroundpath{
15928 \pgfsetcolor{\ctikzvalof{color}}
15929 \pgf@circ@scaled@Rlen=\scaledRlen
15930
15931 \northwest
15932 \pgf@circ@res@up = \pgf@y
15933 \pgf@circ@res@down = -\pgf@y
15934 \pgf@circ@res@right = -\pgf@x
15935 \pgf@circ@res@left = \pgf@x
15936
15937 \pgfstartlinewidth=\pgflinewidth
15938
15939 % draw outer box
15940 \pgf@circ@twoportbox
15941
15942 % draw inner stuff
15943 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15944 \pgfsetarrows{-} %never draw arrows
15945 \pgfsetlinewidth{\pgfstartlinewidth}
15946 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
15947 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
15948 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15949 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15950 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
15951 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15952 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15953
15954 \pgfusepath{draw}
15955
15956 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15957 % draw inner resisitor - european or american style is recognised
15958 {
15959 \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
15960 \pgftransformrotate{90}
15961
15962 % calculate size of resistor
15963 \ifpgf@circuit@europeanresistor
15964 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
15965 \pgftransformscale{\pgfmathresult}
15966 \pgfnode{genericshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
15967 \else
15968 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
15969 \pgftransformscale{\pgfmathresult}
15970 \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
15971 \fi
15972 }
15973
15974 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15975 \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}}
15976
15977 \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}}
15978 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15979 \pgfusepath{draw}
15980
15981 }
15982 }
15983
15984 %% couplers generics
15985 \long\def\pgfcircdeclarefourport#1#2{
15986
15987 \pgfdeclareshape{#1}{
15988 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15989 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15990 \anchor{center}{
15991 \northwest
15992 \pgf@x=0pt
15993 \pgf@y=0pt
15994 }
15995 \savedanchor\northwest{%
15996 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15997 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
15998 \pgf@y=.5\pgf@y
15999 \pgf@x=.5\pgf@circ@scaled@Rlen
16000 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
16001 }
16002 \anchor{north}{
16003 \northwest
16004 \pgf@x=0pt
16005 }
16006 \anchor{south}{
16007 \northwest
16008 \pgf@x=0pt
16009 \pgf@y=-\pgf@y
16010 }
16011 \anchor{west}{
16012 \northwest
16013 \pgf@y=0pt
16014 }
16015 \anchor{east}{
16016 \northwest
16017 \pgf@y=0pt
16018 \pgf@x=-\pgf@x
16019 }
16020 \anchor{south west}{
16021 \northwest
16022 \pgf@y=-\pgf@y
16023 }
16024 \anchor{north east}{
16025 \northwest
16026 \pgf@x=-\pgf@x
16027 }
16028 \anchor{north west}{
16029 \northwest
16030 }
16031 \anchor{south east}{
16032 \northwest
16033 \pgf@x=-\pgf@x
16034 \pgf@y=-\pgf@y
16035 }
16036 \anchor{port1}{
16037 \northwest
16038 \pgf@y=-0.5\pgf@y
16039 }
16040 \anchor{port2}{
16041 \northwest
16042 \pgf@x=-\pgf@x
16043 \pgf@y=-0.5\pgf@y
16044 }
16045 \anchor{port3}{
16046 \northwest
16047 \pgf@x=-\pgf@x
16048 \pgf@y=0.5\pgf@y
16049 }
16050 \anchor{port4}{
16051 \northwest
16052 \pgf@y=0.5\pgf@y
16053 }
16054 \anchor{1}{
16055 \northwest
16056 \pgf@y=-0.5\pgf@y
16057 }
16058 \anchor{2}{
16059 \northwest
16060 \pgf@x=-\pgf@x
16061 \pgf@y=-0.5\pgf@y
16062 }
16063 \anchor{3}{
16064 \northwest
16065 \pgf@x=-\pgf@x
16066 \pgf@y=0.5\pgf@y
16067 }
16068 \anchor{4}{
16069 \northwest
16070 \pgf@y=0.5\pgf@y
16071 }
16072
16073 \anchor{text}{
16074 \northwest
16075 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
16076 \pgf@x=-.5\wd\pgfnodeparttextbox
16077 }
16078 \backgroundpath{
16079 \pgfsetcolor{\ctikzvalof{color}}
16080
16081 \northwest
16082 \pgf@circ@res@up = \pgf@y
16083 \pgf@circ@res@down = -\pgf@y
16084 \pgf@circ@res@right = -\pgf@x
16085 \pgf@circ@res@left = \pgf@x
16086 \pgf@circ@scaled@Rlen=\scaledRlen
16087
16088 \pgfstartlinewidth=\pgflinewidth
16089
16090 % draw outer box
16091 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
16092 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
16093 \pgf@circ@draworfill
16094
16095 % draw inner stuff
16096 #2
16097
16098 % draw inner text
16099 \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
16100 }
16101 }
16102 }
16103
16104 % four-port
16105 \pgfcircdeclarefourport{fourport}{}
16106
16107 % straight coupler
16108 \pgfcircdeclarefourport{coupler}{
16109 \pgfsetlinewidth{\pgfstartlinewidth}
16110 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
16111 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
16112 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
16113 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
16114 \pgfusepath{draw}
16115
16116 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
16117 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
16118 \pgfsetarrows{latex-latex}
16119 \pgfusepath{draw}
16120 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
16121 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
16122 \pgfsetarrows{latex-latex}
16123 \pgfusepath{draw}
16124 }
16125
16126 % "bended" coupler
16127 \pgfcircdeclarefourport{coupler2}{
16128 \pgfsetlinewidth{\pgfstartlinewidth}
16129 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
16130 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
16131 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
16132 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
16133 \pgfusepath{draw}
16134
16135 \pgfscope
16136 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
16137 \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
16138 \pgfsetarrowsend{latex}
16139 \pgfusepath{draw}
16140 \endpgfscope
16141 \pgfscope
16142 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
16143 \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
16144 \pgfsetarrowsend{latex}
16145 \pgfusepath{draw}
16146 \endpgfscope
16147 \pgfscope
16148 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
16149 \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
16150 \pgfsetarrowsend{latex}
16151 \pgfusepath{draw}
16152 \endpgfscope
16153 \pgfscope
16154 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
16155 \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
16156 \pgfsetarrowsend{latex}
16157 \pgfusepath{draw}
16158 \endpgfscope
16159 }
16160
16161 %%%---------- close: tex/pgfcircquadpoles
16162 %%%%%%%%%%% Springe nach tex/pgfcircmultipoles
16163 %%%---------- open: tex/pgfcircmultipoles.tex
16164 % Copyright 2018-2026 by Romano Giannetti
16165 % Copyright 2015-2026 by Stefan Lindner
16166 % Copyright 2013-2026 by Stefan Erhardt
16167 % Copyright 2007-2026 by Massimo Redaelli
16168 %
16169 % This file may be distributed and/or modified
16170 %
16171 % 1. under the LaTeX Project Public License and/or
16172 % 2. under the GNU Public License.
16173 %
16174 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16175
16176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16177 %% Multipoles by Romano Giannetti
16178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16179
16180 %%%%%%%%%
16181 %% Chips
16182 %%%%%%%%%
16183
16184 % let's use the same shifts everywhere, no magic numbers
16185 \def\pgf@circ@dip@pin@shift{0.5}
16186 \def\pgf@circ@qfp@pin@shift{0.25}
16187
16188 % derived from https://tex.stackexchange.com/a/146753/38080
16189 % original author Mark Wibrow
16190 % Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
16191 % a lot of thanks to @marmot for the un-rotation hint
16192 % https://tex.stackexchange.com/a/473571/38080
16193
16194 % DIP (dual in line package) chips
16195
16196 \pgfdeclareshape{dipchip}{
16197 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
16198 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
16199 \savedmacro\numpins{%
16200 \pgf@circ@count@a=\ctikzvalof{multipoles/dipchip/num pins}%
16201 \def\numpins{\the\pgf@circ@count@a}
16202 }
16203 \savedanchor\centerpoint{%
16204 \pgf@x=-.5\wd\pgfnodeparttextbox%
16205 \pgf@y=-.5\ht\pgfnodeparttextbox%
16206 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
16207 }%
16208 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
16209 \anchor{center}{\origin}
16210 \anchor{text}{\centerpoint}% to adjust text
16211 \saveddimen\height{%
16212 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16213 \pgfmathsetlength\pgf@x{((\numpins)
16214 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
16215 }%
16216 \saveddimen{\chipspacing}{
16217 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16218 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/pin spacing}}}
16219 \saveddimen{\width}{
16220 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16221 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}}
16222 \saveddimen{\extshift}{
16223 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16224 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
16225 % standard anchors
16226 \savedanchor\northwest{%
16227 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16228 \pgfmathsetlength\pgf@y{0.5*((\numpins)
16229 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
16230 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}
16231 }
16232 \anchor{dot}{\northwest
16233 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
16234 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
16235 }
16236 \anchor{nw}{\northwest}
16237 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
16238 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
16239 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
16240 \anchor{north west}{\northwest}
16241 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
16242 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
16243 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
16244 \anchor{n}{\northwest\pgf@x=0pt }
16245 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
16246 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
16247 \anchor{w}{\northwest\pgf@y=0pt }
16248 \anchor{north}{\northwest\pgf@x=0pt }
16249 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
16250 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
16251 \anchor{west}{\northwest\pgf@y=0pt }
16252 % start drawing
16253 \backgroundpath{%
16254 \northwest
16255 \pgf@circ@res@up = \pgf@y
16256 \pgf@circ@res@down = -\pgf@y
16257 \pgf@circ@res@right = -\pgf@x
16258 \pgf@circ@res@left = \pgf@x
16259 \pgf@circ@scaled@Rlen=\scaledRlen
16260 \pgf@circ@res@step = \ctikzvalof{multipoles/dipchip/pin spacing}\pgf@circ@scaled@Rlen
16261 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
16262 \pgfscope% (for the line width)
16263 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
16264 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
16265 \pgf@circ@draworfill
16266 %% upside mark
16267 \ifpgf@circuit@chip@topmark
16268 \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
16269 \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
16270 \fi
16271 \pgfusepath{stroke}%
16272 \pgfsetcolor{\ctikzvalof{color}}
16273 % Adding the pin number
16274 \ifpgf@circuit@chip@shownumbers
16275 \pgf@circ@count@a=\numpins\relax
16276 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
16277 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
16278 \ifpgf@circuit@chip@straightnumbers
16279 \pgfgettransformentries\a\b\temp\temp\temp\temp
16280 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
16281 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
16282 \else
16283 \pgfmathsetmacro{\rot}{0}
16284 \pgfmathsetmacro{\quadrant}{0}
16285 \fi
16286 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
16287 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
16288 \pgfmathloop%
16289 \ifnum\pgf@circ@count@a>0
16290 \ifcase\quadrant % rotation 0
16291 % left
16292 \pgf@circ@count@c=\pgf@circ@count@a
16293 \pgftext[left,
16294 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16295 rotate=\rot]{\mytext}
16296 % right
16297 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16298 \pgftext[right,
16299 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16300 rotate=\rot]{\mytext}
16301 \or % rotation -90
16302 % left
16303 \pgf@circ@count@c=\pgf@circ@count@a
16304 \pgftext[top,
16305 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16306 rotate=\rot]{\mytext}
16307 % right
16308 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16309 \pgftext[bottom,
16310 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16311 rotate=\rot]{\mytext}
16312 \or %rotation 180
16313 % left
16314 \pgf@circ@count@c=\pgf@circ@count@a
16315 \pgftext[right,
16316 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16317 rotate=\rot]{\mytext}
16318 % right
16319 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16320 \pgftext[left,
16321 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16322 rotate=\rot]{\mytext}
16323 \or % rotation +90
16324 % left
16325 \pgf@circ@count@c=\pgf@circ@count@a
16326 \pgftext[bottom,
16327 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16328 rotate=\rot]{\mytext}
16329 % right
16330 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16331 \pgftext[top,
16332 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16333 rotate=\rot]{\mytext}
16334 \fi
16335 \advance\pgf@circ@count@a-1\relax%
16336 \repeatpgfmathloop
16337 \fi
16338 \endpgfscope
16339 \ifdim\pgf@circ@res@other>0pt
16340 \pgfscope
16341 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
16342 \pgf@circ@count@a=\numpins\relax
16343 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
16344 \pgfmathloop%
16345 \ifnum\pgf@circ@count@a>0
16346 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
16347 \ifnum\padfrac>0
16348 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
16349 % left side pads
16350 \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}}
16351 \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}}
16352 \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}}
16353 \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}}
16354 % right side pads
16355 \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}}
16356 \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}}
16357 \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}}
16358 \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}}
16359 \else
16360 % left side pins
16361 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
16362 \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}}
16363 % right side pins
16364 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
16365 \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}}
16366 \fi
16367 \advance\pgf@circ@count@a by -1\relax%
16368 \repeatpgfmathloop
16369 \pgfusepath{stroke}
16370 \endpgfscope
16371 \fi
16372 }%
16373 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
16374 % and is executed just before a node is drawn.
16375 \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
16376 % Start with the maximum pin number and go backwards.
16377 \pgf@circ@count@a=\numpins\relax
16378 \pgfmathloop%
16379 \ifnum\pgf@circ@count@a>0
16380 % we will create two anchors per pin: the "normal one" like `pin 1` for the
16381 % electrical contact, and the "border one" like `bpin 1` for labels.
16382 % they will coincide if `external pins width` is set to 0.
16383 \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
16384 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
16385 }
16386 \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
16387 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
16388 }
16389 \advance\pgf@circ@count@a by -1\relax%
16390 \repeatpgfmathloop%
16391 }%
16392 }
16393
16394 % QFP (quad flat package) chips
16395
16396 \pgfdeclareshape{qfpchip}{
16397 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
16398 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
16399 \savedmacro\numpins{%
16400 \pgf@circ@count@a=\ctikzvalof{multipoles/qfpchip/num pins}%
16401 \def\numpins{\the\pgf@circ@count@a}
16402 }
16403 \savedanchor\centerpoint{%
16404 \pgf@x=-.5\wd\pgfnodeparttextbox%
16405 \pgf@y=-.5\ht\pgfnodeparttextbox%
16406 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
16407 }%
16408 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
16409 \anchor{center}{\origin}
16410 \anchor{text}{\centerpoint}% to adjust text
16411 \saveddimen\height{%
16412 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16413 \pgfmathsetlength\pgf@x{((\numpins+2)
16414 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
16415 }%
16416 \saveddimen\width{%
16417 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16418 \pgfmathsetlength\pgf@x{((\numpins+2)
16419 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
16420 }%
16421 \saveddimen{\chipspacing}{
16422 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16423 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/qfpchip/pin spacing}}}
16424 \saveddimen{\extshift}{
16425 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16426 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
16427 % standard anchors
16428 \savedanchor\northwest{%
16429 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16430 \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
16431 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
16432 \pgf@x=-\pgf@y
16433 }
16434 \anchor{dot}{\northwest
16435 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
16436 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
16437 }
16438 \anchor{nw}{\northwest}
16439 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
16440 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
16441 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
16442 \anchor{north west}{\northwest}
16443 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
16444 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
16445 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
16446 \anchor{n}{\northwest\pgf@x=0pt }
16447 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
16448 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
16449 \anchor{w}{\northwest\pgf@y=0pt }
16450 \anchor{north}{\northwest\pgf@x=0pt }
16451 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
16452 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
16453 \anchor{west}{\northwest\pgf@y=0pt }
16454 % start drawing
16455 \backgroundpath{%
16456 \northwest
16457 \pgf@circ@res@up = \pgf@y
16458 \pgf@circ@res@down = -\pgf@y
16459 \pgf@circ@res@right = -\pgf@x
16460 \pgf@circ@res@left = \pgf@x
16461 \pgf@circ@scaled@Rlen=\scaledRlen
16462 \pgf@circ@res@step = \ctikzvalof{multipoles/qfpchip/pin spacing}\pgf@circ@scaled@Rlen
16463 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
16464 \pgfscope% (for the line width)
16465 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
16466 %% upside mark
16467 \ifpgf@circuit@chip@topmark
16468 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
16469 \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
16470 \else
16471 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
16472 \fi
16473 %% rest of the shape
16474 \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
16475 \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
16476 \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
16477 \pgfpathclose
16478 \pgf@circ@draworfill
16479 % Adding the pin number
16480 \pgfsetcolor{\ctikzvalof{color}}
16481 \ifpgf@circuit@chip@shownumbers
16482 \pgf@circ@count@a=\numpins%
16483 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
16484 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
16485 \ifpgf@circuit@chip@straightnumbers
16486 \pgfgettransformentries\a\b\temp\temp\temp\temp
16487 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
16488 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
16489 \else
16490 \pgfmathsetmacro{\rot}{0}
16491 \pgfmathsetmacro{\quadrant}{0}
16492 \fi
16493 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
16494 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
16495 \pgfmathloop%
16496 \ifnum\pgf@circ@count@a>0
16497 \ifcase\quadrant % rotation 0
16498 % left
16499 \pgf@circ@count@c=\pgf@circ@count@a
16500 \pgftext[left,
16501 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16502 rotate=\rot]{\mytext}
16503 % bottom
16504 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
16505 \pgftext[bottom,
16506 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
16507 rotate=\rot]{\mytext}
16508 % right
16509 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16510 \pgftext[right,
16511 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16512 rotate=\rot]{\mytext}
16513 % top
16514 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
16515 \pgftext[top,
16516 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
16517 rotate=\rot]{\mytext}
16518 \or % rotation -90
16519 % left
16520 \pgf@circ@count@c=\pgf@circ@count@a
16521 \pgftext[top,
16522 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16523 rotate=\rot]{\mytext}
16524 % bottom
16525 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
16526 \pgftext[left,
16527 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
16528 rotate=\rot]{\mytext}
16529 % right
16530 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16531 \pgftext[bottom,
16532 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16533 rotate=\rot]{\mytext}
16534 % top
16535 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
16536 \pgftext[right,
16537 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
16538 rotate=\rot]{\mytext}
16539 \or %rotation 180
16540 % left
16541 \pgf@circ@count@c=\pgf@circ@count@a
16542 \pgftext[right,
16543 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16544 rotate=\rot]{\mytext}
16545 % bottom
16546 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
16547 \pgftext[top,
16548 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
16549 rotate=\rot]{\mytext}
16550 % right
16551 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16552 \pgftext[left,
16553 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16554 rotate=\rot]{\mytext}
16555 % top
16556 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
16557 \pgftext[bottom,
16558 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
16559 rotate=\rot]{\mytext}
16560 \or % rotation +90
16561 % left
16562 \pgf@circ@count@c=\pgf@circ@count@a
16563 \pgftext[bottom,
16564 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16565 rotate=\rot]{\mytext}
16566 % bottom
16567 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
16568 \pgftext[right,
16569 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
16570 rotate=\rot]{\mytext}
16571 % right
16572 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
16573 \pgftext[top,
16574 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
16575 rotate=\rot]{\mytext}
16576 % top
16577 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
16578 \pgftext[left,
16579 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
16580 rotate=\rot]{\mytext}
16581 \fi
16582 \advance\pgf@circ@count@a-1\relax%
16583 \repeatpgfmathloop
16584 \fi
16585 \endpgfscope
16586 \ifdim\pgf@circ@res@other>0pt
16587 \pgfscope
16588 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
16589 \pgf@circ@count@a=\numpins%
16590 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
16591 \pgfmathloop%
16592 \ifnum\pgf@circ@count@a>0
16593 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
16594 \ifnum\padfrac>0
16595 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
16596 % left side pads
16597 \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}}
16598 \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}}
16599 \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}}
16600 \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}}
16601 % bottom side pads
16602 \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}}
16603 \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}}
16604 \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}}
16605 \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}}
16606 % right side pads
16607 \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}}
16608 \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}}
16609 \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}}
16610 \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}}
16611 % top side pads
16612 \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}}
16613 \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}}
16614 \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}}
16615 \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}}
16616 \else
16617 % left side pins
16618 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
16619 \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}}
16620 % bottom side pins
16621 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
16622 \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}}
16623 % right side pins
16624 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
16625 \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}}
16626 % top side pins
16627 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
16628 \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}}
16629 \fi
16630 \advance\pgf@circ@count@a-1\relax%
16631 \repeatpgfmathloop
16632 \pgfusepath{stroke}
16633 \endpgfscope
16634 \fi
16635 }%
16636 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
16637 % and is executed just before a node is drawn.
16638 \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
16639 % Start with the maximum pin number and go backwards.
16640 \pgf@circ@count@a=\numpins%
16641 \pgfmathloop%
16642 \ifnum\pgf@circ@count@a>0
16643 \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
16644 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
16645 }
16646 \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
16647 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
16648 }
16649 \advance\pgf@circ@count@a-1\relax%
16650 \repeatpgfmathloop%
16651 }%
16652 }
16653
16654 %% anchors for DIP
16655 \def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
16656 \c@pgf@countc=\numpins\relax
16657 \divide\c@pgf@countc by 2
16658 \ifnum #1 > \the\c@pgf@countc
16659 % right side
16660 \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
16661 \else
16662 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
16663 \fi
16664 }
16665
16666 %% anchors for QFP
16667 \def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
16668 \c@pgf@countc=\numpins\relax
16669 \divide\c@pgf@countc by 4
16670 \ifnum #1 > \the\c@pgf@countc
16671 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
16672 \ifnum #1 > \the\c@pgf@countb
16673 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
16674 \ifnum #1 > \the\c@pgf@countb
16675 % 3*npins/4 < pin, top side
16676 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
16677 \else
16678 % 2*npins/4 < pin <= 3*npins/4, right side
16679 \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
16680 \fi
16681 \else
16682 % npins/4 < pin <= 2*npins/4, bottom side
16683 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
16684 \fi
16685 \else
16686 % <= npins/4, left side
16687 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
16688 \fi
16689 }
16690
16691 %%%%%%%%%%%%%%%%%
16692 %% Rotary Switch
16693 %%%%%%%%%%%%%%%%%
16694
16695 \pgfdeclareshape{rotaryswitch}
16696 {
16697 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
16698 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
16699 \savedanchor\northeast{%
16700 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16701 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
16702 % the magic number is 0.25/cos(35)
16703 % try to recalculate it for the actual switch
16704 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
16705 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
16706 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
16707 \edef\r{\ctikzvalof{nodes width}}
16708 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
16709 \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@scaled@Rlen + \pgf@circ@res@temp}
16710 }
16711 \savedanchor\northwest{%
16712 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16713 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
16714 % the magic number is 0.25/cos(35)
16715 % try to recalculate it for the actual switch
16716 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
16717 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
16718 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
16719 \edef\r{\ctikzvalof{nodes width}}
16720 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
16721 \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@scaled@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
16722 }
16723 \savedanchor\central{%
16724 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16725 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
16726 % the magic number is 0.25/cos(35)
16727 % try to recalculate it for the actual switch
16728 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
16729 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
16730 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
16731 \edef\r{\ctikzvalof{nodes width}}
16732 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
16733 \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
16734 }
16735 % external square limits
16736 \savedanchor\extnorthwest{%
16737 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16738 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
16739 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
16740 \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
16741 \pgf@x=2.5\pgf@x % external square size
16742 \pgf@y=-\pgf@x %square thing when angle=180?
16743 }
16744 \saveddimen{\width}{
16745 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16746 \pgfmathsetlength\pgf@x{0.3052*\pgf@circ@scaled@Rlen*\ctikzvalof{tripoles/spdt/width}}}
16747 % radius of the connector
16748 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
16749 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
16750 % shapename
16751 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
16752 % shape type
16753 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
16754 \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
16755 \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
16756 \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
16757 \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
16758 % mid of the lever, to stack switches
16759 %\anchor{mid}{\midlever}
16760 \anchor{mid}{\northwest
16761 \pgf@circ@res@temp=-\pgf@x
16762 \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
16763 \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
16764 }
16765 % center anchors
16766 \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
16767 % horizontal angles
16768 \anchor{in}{ \northwest \pgf@y=0pt}
16769 \anchor{ain}{ \northwest \pgf@y=0pt}
16770
16771 \anchor{center}{ \central \pgf@y=0pt }
16772 \anchor{east}{ \northeast \pgf@y=0pt }
16773 \anchor{west}{ \northwest \pgf@y=0pt }
16774 \anchor{south}{ \central \pgf@y=-\pgf@y }
16775 \anchor{north}{ \central }
16776 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
16777 \anchor{north east}{ \northeast }
16778 \anchor{north west}{ \northwest }
16779 \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
16780
16781 \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
16782 \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
16783 \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
16784 \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
16785 \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
16786 \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
16787 \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
16788 \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
16789 \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
16790
16791 \backgroundpath{
16792 \pgfsetcolor{\ctikzvalof{color}}
16793 \pgf@circ@res@right = \width
16794 \pgf@circ@res@left = -\width
16795
16796 \pgfscope %wiper
16797 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
16798 \pgf@circ@res@temp=\radius\relax
16799 \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
16800 \pgfsetlinewidth{2\pgf@circ@res@temp}
16801 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
16802 \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
16803 \pgfsetroundcap\pgfusepath{draw}
16804 \endpgfscope
16805
16806 \ifpgf@circ@rotaryarrow
16807 \pgfscope % arrow
16808 \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
16809 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
16810 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
16811 \pgftransformrotate{\wiper}
16812 \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
16813 \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
16814 \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
16815 \pgfusepath{draw}
16816 \endpgfscope
16817 \fi
16818
16819 % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
16820 \pgf@circ@count@a=\channels\relax
16821 \pgfmathsetmacro{\currenta}{-\angle}
16822 \pgfmathloop%
16823 \ifnum\pgf@circ@count@a>0
16824 % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
16825 \pgfscope
16826 \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
16827 \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
16828 \endpgfscope
16829 \pgfmathsetmacro{\currenta}{\currenta+\stepa}
16830 % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
16831 \advance\pgf@circ@count@a by -1\relax%
16832 \repeatpgfmathloop
16833
16834 \pgfscope % input
16835 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
16836 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
16837 \endpgfscope
16838 }
16839 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
16840 % and is executed just before a node is drawn.
16841 \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
16842 % Start with the maximum pin number and go backwards.
16843 \pgf@circ@count@a=\channels\relax
16844 \pgfmathloop%
16845 \ifnum\pgf@circ@count@a>0
16846 % we will create two anchors per pin: the "normal one" like `pin 1` for the
16847 % electrical contact, and the "border one" like `bpin 1` for labels.
16848 % they will coincide if `external pins width` is set to 0.
16849 \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
16850 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
16851 }
16852 \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
16853 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
16854 }
16855 \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
16856 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
16857 }
16858 \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
16859 \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
16860 }
16861 \advance\pgf@circ@count@a by -1\relax%
16862 \repeatpgfmathloop%
16863 }%
16864 }
16865
16866 \def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
16867 \pgf@circ@res@temp=\width
16868 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
16869 \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
16870 \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
16871 \advance\pgf@x by -\pgf@circ@res@temp
16872 }
16873
16874 \def\pgf@circ@rotarysqanchor#1{% external square anchors
16875 \pgf@circ@res@temp=\width
16876 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
16877 \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
16878 \advance\pgf@x by -\pgf@circ@res@temp
16879 }
16880
16881 %%%%%%%%%%%%%%%%%%%%%%%%%%
16882 % Seven segments displays
16883 %%%%%%%%%%%%%%%%%%%%%%%%%%
16884
16885 \pgfdeclareshape{bare7seg}{
16886 \savedmacro{\ctikzclass}{\edef\ctikzclass{displays}}
16887 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
16888 \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
16889 \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
16890 \ifpgf@circ@sevenseg@dot
16891 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
16892 \else
16893 \pgf@x=0pt
16894 \fi
16895 }
16896 % The object extension is more or less (-width/2,-width) to (width/2,width)
16897 % and adjusted for line thickness (both sides) and eventually the dot
16898 \saveddimen{\width}{
16899 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16900 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}}
16901 \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
16902 \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
16903 \savedanchor{\southwest}{% both negative
16904 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16905 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16906 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
16907 \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16908 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
16909 }
16910 \savedanchor{\northeast}{% both positive
16911 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16912 \ifpgf@circ@sevenseg@dot
16913 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
16914 \else
16915 \pgf@circ@res@other=0pt
16916 \fi
16917 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16918 +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
16919 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16920 +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
16921 }
16922 \savedanchor{\topright}{% anchor without the box sep and the thickness
16923 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16924 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
16925 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
16926 }
16927 \anchor{center}{\pgfpointorigin}
16928 \anchor{north west}{\southwest\pgf@y=-\pgf@y}
16929 \anchor{north east}{\northeast}
16930 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
16931 \anchor{south west}{\southwest}
16932 \anchor{north}{\northeast\pgf@x=0pt}
16933 \anchor{east}{\northeast\pgf@y=0pt}
16934 \anchor{south}{\southwest\pgf@x=0pt}
16935 \anchor{west}{\southwest\pgf@y=0pt}
16936 \anchor{a}{\topright\pgf@x=0pt}
16937 \anchor{b}{\topright\pgf@y=0.5\pgf@y}
16938 \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
16939 \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
16940 \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
16941 \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
16942 \anchor{g}{\pgfpointorigin}
16943 \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
16944 \behindbackgroundpath{%
16945 \southwest % I do not want the dot here, it will stick out
16946 \pgf@circ@res@up = -\pgf@y
16947 \pgf@circ@res@down = \pgf@y
16948 \pgf@circ@res@right = \pgf@x
16949 \pgf@circ@res@left = -\pgf@x
16950 \pgfscope
16951 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
16952 \pgfsetcolor{\ctikzvalof{color}}
16953 \pgfpathrectanglecorners%
16954 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
16955 {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
16956 \ifpgf@circ@sevenseg@box
16957 \pgf@circ@draworfill
16958 \else
16959 \pgf@circ@maybefill
16960 \fi
16961 \endpgfscope
16962 \edef\bits{\ctikzvalof{seven seg/bits}}
16963 \pgfscope
16964 \pfg@circ@sseg@drawbits{\bits}
16965 \endpgfscope
16966 \pgfscope
16967 \ifpgf@circ@sevenseg@dot
16968 \pgf@circ@sseg@drawdots
16969 \fi
16970 \endpgfscope
16971 }
16972 }
16973
16974 \def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
16975 \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
16976 }
16977 \def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
16978 \ifnum #1 > 0\relax
16979 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
16980 \else
16981 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
16982 \fi
16983 \pgfpathmoveto{\pgfpoint{#2}{#3}}
16984 \pgfpathlineto{\pgfpoint{#4}{#5}}
16985 \pgfusepath{draw}
16986 }
16987 \def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
16988 \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
16989 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
16990 \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
16991 % \pgfsetroundcap
16992 \pgfsetarrowsstart{Triangle Cap[]}
16993 \pgfsetarrowsend{Triangle Cap[]}
16994 % segments
16995 \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
16996 \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
16997 \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
16998 \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
16999 \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
17000 \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
17001 \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
17002 }
17003 \def\pgf@circ@sseg@drawdots{% dots
17004 \edef\what{empty}
17005 \ifx\what\pgf@circ@sevenseg@dotstate
17006 % do nothing
17007 \else
17008 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
17009 \edef\what{off}
17010 \ifx\what\pgf@circ@sevenseg@dotstate
17011 % dot off
17012 \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
17013 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
17014 \else
17015 % dot on
17016 \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
17017 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
17018 \fi
17019 \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
17020 \pgfusepath{draw,fill}
17021 \fi
17022 }
17023
17024
17025 %%%%%%
17026 %%%%%% Flip-flops
17027 %%%%%%
17028
17029 % Flip flops are a specialized kind of dipchip.
17030 % they have a class by themselves
17031
17032 %% flip flop definitions --- by default empty
17033 %% pin texts
17034 \ctikzset{multipoles/flipflop/t1/.initial={}}
17035 \ctikzset{multipoles/flipflop/t2/.initial={}}
17036 \ctikzset{multipoles/flipflop/t3/.initial={}}
17037 \ctikzset{multipoles/flipflop/t4/.initial={}}
17038 \ctikzset{multipoles/flipflop/t5/.initial={}}
17039 \ctikzset{multipoles/flipflop/t6/.initial={}}
17040 \ctikzset{multipoles/flipflop/tu/.initial={}}
17041 \ctikzset{multipoles/flipflop/td/.initial={}}
17042 % pin clock wedge flags
17043 \ctikzset{multipoles/flipflop/c1/.initial={0}}
17044 \ctikzset{multipoles/flipflop/c2/.initial={0}}
17045 \ctikzset{multipoles/flipflop/c3/.initial={0}}
17046 \ctikzset{multipoles/flipflop/c4/.initial={0}}
17047 \ctikzset{multipoles/flipflop/c5/.initial={0}}
17048 \ctikzset{multipoles/flipflop/c6/.initial={0}}
17049 \ctikzset{multipoles/flipflop/cu/.initial={0}}
17050 \ctikzset{multipoles/flipflop/cd/.initial={0}}
17051 % pin negation circle flags
17052 \ctikzset{multipoles/flipflop/n1/.initial={0}}
17053 \ctikzset{multipoles/flipflop/n2/.initial={0}}
17054 \ctikzset{multipoles/flipflop/n3/.initial={0}}
17055 \ctikzset{multipoles/flipflop/n4/.initial={0}}
17056 \ctikzset{multipoles/flipflop/n5/.initial={0}}
17057 \ctikzset{multipoles/flipflop/n6/.initial={0}}
17058 \ctikzset{multipoles/flipflop/nu/.initial={0}}
17059 \ctikzset{multipoles/flipflop/nd/.initial={0}}
17060
17061
17062 % Thanks to @marmot
17063 \tikzset{flipflop def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/flipflop}{#1}}
17064
17065 % default set of flip flops
17066 \tikzset{
17067 % async
17068 latch/.style={flipflop, flipflop def={t1=D, t6=Q, t3=CLK, t4=\ctikztextnot{Q}}},
17069 flipflop SR/.style={flipflop, flipflop def={t1=S, t3=R, t6=Q, t4=\ctikztextnot{Q}}},
17070 % sync
17071 flipflop D/.style={flipflop, flipflop def={t1=D, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
17072 flipflop T/.style={flipflop, flipflop def={t1=T, t6=Q, c3=1, t4=\ctikztextnot{Q}}},
17073 flipflop JK/.style={flipflop, flipflop def={t1=J, t3=K, c2=1, t6=Q, t4=\ctikztextnot{Q}}},
17074 % additional features
17075 add async SR/.style={flipflop def={tu={\ctikztextnot{SET}}, td={\ctikztextnot{RST}}}},
17076 dot on notQ/.style={flipflop def={t4={Q}, n4=1}},
17077 }
17078
17079 %
17080 % commodity macro to draw the clock wedges. They leave the size of the
17081 % wedge in \pgf@circ@res@temp so that a possible label can be displaced.
17082 %
17083 \def\pgf@circ@do@wedge@left{
17084 \pgf@circ@res@temp=0pt\relax
17085 \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
17086 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
17087 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17088 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
17089 \pgfusepath{stroke}
17090 \pgf@circ@res@temp=\wedge
17091 \fi
17092 }
17093 \def\pgf@circ@do@wedge@right{
17094 \pgf@circ@res@temp=0pt\relax
17095 \ifnum\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}>0
17096 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step+\wedge}}
17097 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\wedge}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17098 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step-\wedge}}
17099 \pgfusepath{stroke}
17100 \pgf@circ@res@temp=-\wedge
17101 \fi
17102 }
17103 \def\pgf@circ@do@wedge@up{
17104 \pgf@circ@res@temp=0pt\relax
17105 \ifnum\ctikzvalof{multipoles/flipflop/cu}>0
17106 \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@up}}
17107 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up-\wedge}}
17108 \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@up}}
17109 \pgfusepath{stroke}
17110 \pgf@circ@res@temp=-\wedge
17111 \fi
17112 }
17113 \def\pgf@circ@do@wedge@down{
17114 \pgf@circ@res@temp=0pt\relax
17115 \ifnum\ctikzvalof{multipoles/flipflop/cd}>0
17116 \pgfpathmoveto{\pgfpoint{-\wedge}{\pgf@circ@res@down}}
17117 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down+\wedge}}
17118 \pgfpathlineto{\pgfpoint{\wedge}{\pgf@circ@res@down}}
17119 \pgfusepath{stroke}
17120 \pgf@circ@res@temp=\wedge
17121 \fi
17122 }
17123 % generic flip-flop shape
17124 \pgfdeclareshape{flipflop}{
17125 \savedmacro{\ctikzclass}{\edef\ctikzclass{flipflops}}
17126 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
17127 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
17128 \savedmacro\numpins{\def\numpins{6}}
17129 \savedanchor\centerpoint{%
17130 \pgf@x=-.5\wd\pgfnodeparttextbox%
17131 \pgf@y=-.5\ht\pgfnodeparttextbox%
17132 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
17133 }%
17134 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
17135 \anchor{center}{\origin}
17136 \anchor{text}{\centerpoint}% to adjust text
17137 \saveddimen\height{%
17138 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17139 \pgfmathsetlength\pgf@x{((\numpins)
17140 *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
17141 }%
17142 \saveddimen{\chipspacing}{
17143 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17144 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/pin spacing}}}
17145 \saveddimen{\width}{
17146 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17147 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}}
17148 \saveddimen{\extshift}{
17149 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17150 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
17151 % standard anchors
17152 \savedanchor\northwest{%
17153 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17154 \pgfmathsetlength\pgf@y{0.5*((\numpins)
17155 *\ctikzvalof{multipoles/flipflop/pin spacing})*\pgf@circ@scaled@Rlen/2}%
17156 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/flipflop/width}}
17157 }
17158 \anchor{dot}{\northwest
17159 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
17160 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
17161 }
17162 \anchor{nw}{\northwest}
17163 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
17164 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
17165 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
17166 \anchor{north west}{\northwest}
17167 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
17168 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
17169 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
17170 \anchor{n}{\northwest\pgf@x=0pt }
17171 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
17172 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
17173 \anchor{w}{\northwest\pgf@y=0pt }
17174 \anchor{north}{\northwest\pgf@x=0pt }
17175 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
17176 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
17177 \anchor{west}{\northwest\pgf@y=0pt }
17178 % upper and lower pin
17179 \anchor{up}{\northwest\pgf@x=0pt\advance\pgf@y by\extshift }
17180 \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y\advance\pgf@y by-\extshift}
17181 \anchor{bup}{\northwest\pgf@x=0pt }
17182 \anchor{bdown}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
17183 % start drawing
17184 \backgroundpath{%
17185 \northwest
17186 \pgf@circ@res@up = \pgf@y
17187 \pgf@circ@res@down = -\pgf@y
17188 \pgf@circ@res@right = -\pgf@x
17189 \pgf@circ@res@left = \pgf@x
17190 \pgf@circ@scaled@Rlen=\scaledRlen
17191 \pgf@circ@res@step = \ctikzvalof{multipoles/flipflop/pin spacing}\pgf@circ@scaled@Rlen
17192 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
17193 \pgfsetcolor{\ctikzvalof{color}}
17194 \pgfscope% (for the line width)
17195 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
17196 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
17197 \pgf@circ@draworfill
17198 \pgfusepath{stroke}%
17199 \endpgfscope
17200 % Adding the pin number
17201 \pgf@circ@count@a=\numpins\relax
17202 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
17203 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
17204 \ifpgf@circuit@chip@straightnumbers
17205 \pgfgettransformentries\a\b\temp\temp\temp\temp
17206 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
17207 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
17208 \else
17209 \pgfmathsetmacro{\rot}{0}
17210 \pgfmathsetmacro{\quadrant}{0}
17211 \fi
17212 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
17213 % text
17214 \def\mytext{\ctikzvalof{multipoles/flipflop/font}\space
17215 \ctikzvalof{multipoles/flipflop/t\the\pgf@circ@count@c}%
17216 \pgf@circ@strut\space}
17217 % \typeout{TEXT\space\mytext}
17218 \pgfmathloop%
17219 \def\wedge{\ctikzvalof{multipoles/flipflop/clock wedge size}\pgf@circ@res@step}
17220 \pgf@circ@res@temp=0pt\relax
17221 \ifnum\pgf@circ@count@a>0
17222 \ifcase\quadrant % rotation 0
17223 % left
17224 \pgf@circ@count@c=\pgf@circ@count@a
17225 \pgf@circ@do@wedge@left
17226 % \typeout{TEXT Left Q1\space\mytext}
17227 \pgftext[left,
17228 at=\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},
17229 rotate=\rot]{\mytext}
17230 % right
17231 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17232 \pgf@circ@do@wedge@right
17233 \pgftext[right,
17234 at=\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},
17235 rotate=\rot]{\mytext}
17236 \or % rotation -90
17237 % left
17238 \pgf@circ@count@c=\pgf@circ@count@a
17239 \pgf@circ@do@wedge@left
17240 \pgftext[top,
17241 at=\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},
17242 rotate=\rot]{\mytext}
17243 % right
17244 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17245 \pgf@circ@do@wedge@right
17246 \pgftext[bottom,
17247 at=\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},
17248 rotate=\rot]{\mytext}
17249 \or %rotation 180
17250 % left
17251 \pgf@circ@count@c=\pgf@circ@count@a
17252 \pgf@circ@do@wedge@left
17253 \pgftext[right,
17254 at=\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},
17255 rotate=\rot]{\mytext}
17256 % right
17257 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17258 \pgf@circ@do@wedge@right
17259 \pgftext[left,
17260 at=\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},
17261 rotate=\rot]{\mytext}
17262 \or % rotation +90
17263 % left
17264 \pgf@circ@count@c=\pgf@circ@count@a
17265 \pgf@circ@do@wedge@left
17266 \pgftext[bottom,
17267 at=\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},
17268 rotate=\rot]{\mytext}
17269 % right
17270 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17271 \pgf@circ@do@wedge@right
17272 \pgftext[top,
17273 at=\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},
17274 rotate=\rot]{\mytext}
17275 \fi
17276 \advance\pgf@circ@count@a-1\relax%
17277 \repeatpgfmathloop
17278 % Now the up and down text
17279 % up
17280 \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/tu}\space}
17281 \pgf@circ@do@wedge@up
17282 \ifcase\quadrant % rotation 0
17283 \pgftext[top,
17284 at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
17285 rotate=\rot]{\mytext}
17286 \or % rotation -90
17287 \pgftext[right,
17288 at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
17289 rotate=\rot]{\mytext}
17290 \or %rotation 180
17291 \pgftext[bottom,
17292 at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
17293 rotate=\rot]{\mytext}
17294 \or % rotation +90
17295 \pgftext[left,
17296 at=\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@temp},
17297 rotate=\rot]{\mytext}
17298 \fi
17299 % down
17300 \def\mytext{\ctikzvalof{multipoles/flipflop/fontud}\space\pgf@circ@strut\ctikzvalof{multipoles/flipflop/td}\space}
17301 \pgf@circ@do@wedge@down
17302 \ifcase\quadrant % rotation 0
17303 \pgftext[bottom,
17304 at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
17305 rotate=\rot]{\mytext}
17306 \or % rotation -90
17307 \pgftext[left,
17308 at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
17309 rotate=\rot]{\mytext}
17310 \or %rotation 180
17311 \pgftext[top,
17312 at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
17313 rotate=\rot]{\mytext}
17314 \or % rotation +90
17315 \pgftext[right,
17316 at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
17317 rotate=\rot]{\mytext}
17318 \fi
17319 % external pins
17320 \ifdim\pgf@circ@res@other>0pt
17321 \pgfscope
17322 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
17323 \pgf@circ@count@a=\numpins\relax
17324 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
17325 \pgfmathloop%
17326 \ifnum\pgf@circ@count@a>0
17327 % left side pins
17328 \pgf@circ@count@c=\pgf@circ@count@a
17329 %% we draw the pin only if it's defined either a text, a clock wedge or a not pin
17330 %% Or'ing tests in core TeX is tough
17331 \edef\@@or{0}
17332 % Just expand the key the minimum needed
17333 \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
17334 \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
17335 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
17336 \ifnum\@@tmp>0\edef\@@or{1}\fi
17337 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
17338 \ifnum\@@tmp>0\edef\@@or{1}\fi
17339 \ifnum\@@or>0
17340 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17341 \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}}
17342 \pgfusepath{stroke}
17343 \fi
17344 % right side pins
17345 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17346 \edef\@@or{0}
17347 \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/t\the\pgf@circ@count@c}}\edef\@@x{x}
17348 \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
17349 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/c\the\pgf@circ@count@c}}
17350 \ifnum\@@tmp>0\edef\@@or{1}\fi
17351 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
17352 \ifnum\@@tmp>0\edef\@@or{1}\fi
17353 % \typeout{TEST\space\@@tmp\space\@@x}
17354 \ifnum\@@or>0
17355 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17356 \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}}
17357 \pgfusepath{stroke}
17358 \fi
17359 \advance\pgf@circ@count@a by -1\relax%
17360 \repeatpgfmathloop
17361 % up side
17362 \edef\@@or{0}
17363 \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/tu}}\edef\@@x{x}
17364 \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
17365 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cu}}
17366 \ifnum\@@tmp>0\edef\@@or{1}\fi
17367 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
17368 \ifnum\@@tmp>0\edef\@@or{1}\fi
17369 % \typeout{TEST\space\@@tmp\space\@@x}
17370 \ifnum\@@or>0
17371 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
17372 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up+\pgf@circ@res@other}}
17373 \pgfusepath{stroke}
17374 \fi
17375 % down side
17376 \edef\@@or{0}
17377 \edef\@@tmp{x\unexpandedvalueof{/tikz/circuitikz/multipoles/flipflop/td}}\edef\@@x{x}
17378 \ifx\@@tmp\@@x\else\edef\@@or{1}\fi
17379 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/cd}}
17380 \ifnum\@@tmp>0\edef\@@or{1}\fi
17381 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
17382 \ifnum\@@tmp>0\edef\@@or{1}\fi
17383 % \typeout{TEST\space\@@tmp\space\@@x}
17384 \ifnum\@@or>0
17385 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@down}}
17386 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down-\pgf@circ@res@other}}
17387 \pgfusepath{stroke}
17388 \fi
17389 \endpgfscope
17390 \fi % external pin width >0
17391 %
17392 % draw "inverting" circles on outputs, they must be last
17393 %
17394 \pgfscope
17395 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
17396 \pgf@circ@count@a=\numpins\relax
17397 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
17398 \pgfmathloop%
17399 \ifnum\pgf@circ@count@a>0
17400 % left side pins
17401 \pgf@circ@count@c=\pgf@circ@count@a
17402 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
17403 \ifnum\@@tmp>0\pgfscope
17404 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17405 \pgfnode{ocirc}{east}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
17406 \endpgfscope\fi
17407 % right side pins
17408 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
17409 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/n\the\pgf@circ@count@c}}
17410 \ifnum\@@tmp>0\pgfscope
17411 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
17412 \pgfnode{ocirc}{west}{}{\thisshape-N\the\pgf@circ@count@c}{\pgfusepath{stroke}}
17413 \endpgfscope\fi
17414 \advance\pgf@circ@count@a by -1\relax%
17415 \repeatpgfmathloop
17416 % up side
17417 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nu}}
17418 \ifnum\@@tmp>0\pgfscope
17419 \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@up}}
17420 \pgfnode{ocirc}{south}{}{\thisshape-Nu}{\pgfusepath{stroke}}
17421 \endpgfscope\fi
17422 % down side
17423 \edef\@@tmp{\ctikzvalof{multipoles/flipflop/nd}}
17424 \ifnum\@@tmp>0\pgfscope
17425 \pgftransformshift{\pgfpoint{0pt}{\pgf@circ@res@down}}
17426 \pgfnode{ocirc}{north}{}{\thisshape-Nd}{\pgfusepath{stroke}}
17427 \endpgfscope\fi
17428 \endpgfscope
17429 }%
17430 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
17431 % and is executed just before a node is drawn.
17432 \pgfutil@g@addto@macro\pgf@sh@s@flipflop{%
17433 % Start with the maximum pin number and go backwards.
17434 \pgf@circ@count@a=\numpins\relax
17435 \pgfmathloop%
17436 \ifnum\pgf@circ@count@a>0
17437 % we will create two anchors per pin: the "normal one" like `pin 1` for the
17438 % electrical contact, and the "border one" like `bpin 1` for labels.
17439 % they will coincide if `external pins width` is set to 0.
17440 \expandafter\xdef\csname pgf@anchor@flipflop@pin\space\the\pgf@circ@count@a\endcsname{%
17441 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
17442 }
17443 \expandafter\xdef\csname pgf@anchor@flipflop@bpin\space\the\pgf@circ@count@a\endcsname{%
17444 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
17445 }
17446 \advance\pgf@circ@count@a by -1\relax%
17447 \repeatpgfmathloop%
17448 }%
17449 }
17450
17451 %
17452 % MUX-DEMUXES
17453 %
17454 % Thanks to @marmot
17455 \tikzset{muxdemux def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/muxdemux}{#1}}
17456 \tikzset{demux/.style={muxdemux, muxdemux def={Lh=4, Rh=8, NL=1, NB=3, NR=8}}}
17457 \tikzset{one bit adder/.style={muxdemux,
17458 muxdemux def={Lh=4, NL=2, Rh=2, NR=1, NB=1, w=1.5,
17459 inset w=0.5, inset Lh=2, inset Rh=1.5}}}
17460 \tikzset{ALU/.style={muxdemux,
17461 muxdemux def={Lh=5, NL=2, Rh=2, NR=1, NB=2, NT=1, w=2,
17462 inset w=1, inset Lh=2, inset Rh=0, square pins=1}}}
17463 %generic mux-demux shape
17464 \pgfdeclareshape{muxdemux}{
17465 \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}}
17466 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
17467 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
17468 % pins on the four sides
17469 % \savedmacro\NL{%
17470 % \pgf@circ@count@a=\ctikzvalof{multipoles/muxdemux/NL}%
17471 % \def\NL{\the\pgf@circ@count@a}
17472 % }
17473 \savedmacro\NL{\edef\NL{\ctikzvalof{multipoles/muxdemux/NL}}}
17474 \savedmacro\NR{\edef\NR{\ctikzvalof{multipoles/muxdemux/NR}}}
17475 \savedmacro\NT{\edef\NT{\ctikzvalof{multipoles/muxdemux/NT}}}
17476 \savedmacro\NB{\edef\NB{\ctikzvalof{multipoles/muxdemux/NB}}}
17477 \savedmacro\squarepins{\edef\squarepins{\ctikzvalof{multipoles/muxdemux/square pins}}}
17478 % topleft and topright sizes
17479 \savedanchor{\topleft}{%
17480 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17481 \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Lh}*\pgf@circ@scaled@Rlen/2}
17482 \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
17483 }
17484 \savedanchor{\topright}{%
17485 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17486 \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Rh}*\pgf@circ@scaled@Rlen/2}
17487 \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
17488 }
17489 \savedanchor{\insetnortheast}{%
17490 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17491 \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Lh}*\pgf@circ@scaled@Rlen/2}
17492 \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*
17493 (\ctikzvalof{multipoles/muxdemux/w}-2*\ctikzvalof{multipoles/muxdemux/inset w})*\pgf@circ@scaled@Rlen/2}
17494 }
17495 \saveddimen{\insethright}{
17496 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17497 \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Rh}*\pgf@circ@scaled@Rlen/2}}
17498 \saveddimen{\extshift}{
17499 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17500 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
17501 \savedanchor{\northwest}{%
17502 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17503 \pgfmathsetlength\pgf@y{\ctikzvalof{multipoles/muxdemux/base len}*max(\ctikzvalof{multipoles/muxdemux/Rh},\ctikzvalof{multipoles/muxdemux/Lh})*\pgf@circ@scaled@Rlen/2}
17504 \pgfmathsetlength\pgf@x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf@circ@scaled@Rlen/2}
17505 }
17506 \anchor{nw}{\northwest}
17507 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
17508 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
17509 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
17510 \anchor{north west}{\northwest}
17511 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
17512 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
17513 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
17514 \anchor{n}{\northwest\pgf@x=0pt }
17515 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
17516 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
17517 \anchor{w}{\northwest\pgf@y=0pt }
17518 \anchor{north}{\northwest\pgf@x=0pt }
17519 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
17520 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
17521 \anchor{west}{\northwest\pgf@y=0pt }
17522 \anchor{center}{\pgfpointorigin}
17523 \anchor{top right}{\topright}
17524 \anchor{bottom right}{\topright\pgf@y=-\pgf@y}
17525 \anchor{right}{\topright\pgf@y=0pt\relax}
17526 \anchor{top left}{\topleft}
17527 \anchor{bottom left}{\topleft\pgf@y=-\pgf@y}
17528 \anchor{left}{\topleft\pgf@y=0pt\relax}
17529 \anchor{top}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
17530 \divide\pgf@y by 2 \pgf@x=0pt\relax}
17531 \anchor{bottom}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
17532 \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
17533 \anchor{inset top right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya}
17534 \anchor{inset bottom right}{\pgf@ya=\insethright\insetnortheast\advance\pgf@y by -0.5\pgf@ya\pgf@y=-\pgf@y}
17535 \anchor{inset right}{\insetnortheast\pgf@y=0pt\relax}
17536 \anchor{inset top left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=\pgf@ya}
17537 \anchor{inset bottom left}{\insetnortheast\pgf@ya=\pgf@y\topleft\pgf@y=-\pgf@ya}
17538 \anchor{inset left}{\topleft\pgf@y=0pt\relax}
17539 \anchor{inset bottom}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
17540 \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
17541 \pgfpoint{(\pgf@xa+\pgf@xb)/2}{-\pgf@ya+\pgf@yb/2}}
17542 \anchor{inset top}{\topleft\pgf@xa=\pgf@x\pgf@ya=\insethright
17543 \insetnortheast\pgf@xb=\pgf@x\pgf@yb=\pgf@x
17544 \pgfpoint{(\pgf@xa+\pgf@xb)/2}{\pgf@ya-\pgf@yb/2}}
17545 \anchor{inset center}{\topleft\pgf@xa=\pgf@x\insetnortheast
17546 \advance\pgf@x by \pgf@xa \divide\pgf@x by 2 \pgf@y=0pt\relax}
17547 \anchor{narrow center}{\insetnortheast\pgf@xa=\pgf@x\topright
17548 \advance\pgf@x by \pgf@xa \divide\pgf@x by 2\pgf@y=0pt\relax}
17549 \anchor{center up}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
17550 \divide\pgf@y by 2
17551 \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
17552 \divide\pgf@y by 2 \pgf@x=0pt\relax}
17553 \anchor{center down}{\topright\pgf@ya=\pgf@y \topleft \advance\pgf@y by \pgf@ya
17554 \divide\pgf@y by 2
17555 \pgf@yb = \insethright \advance\pgf@y by \pgf@yb
17556 \divide\pgf@y by 2 \pgf@y=-\pgf@y \pgf@x=0pt\relax}
17557 \anchor{text}{%
17558 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
17559 \pgfmathsetlength\pgf@x{\ctikzvalof{multipoles/muxdemux/base len}*
17560 \ctikzvalof{multipoles/muxdemux/inset w}*\pgf@circ@scaled@Rlen/2}
17561 \advance\pgf@x by -.5\wd\pgfnodeparttextbox%
17562 \pgf@y=-.5\ht\pgfnodeparttextbox%
17563 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
17564 }%
17565 \backgroundpath{%
17566 \topleft
17567 \pgf@circ@res@up = \pgf@y
17568 \pgf@circ@res@down = -\pgf@y
17569 \pgf@circ@res@left = \pgf@x
17570 \topright
17571 \pgf@circ@res@other = \pgf@y
17572 \pgf@circ@res@right = \pgf@x
17573 \insetnortheast
17574 \pgf@circ@res@step = \pgf@x
17575 \pgf@circ@res@temp = \pgf@y
17576 %
17577 % external block
17578 %
17579 \pgfscope% (for the line width)
17580 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
17581 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
17582 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}}
17583 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@other}}
17584 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
17585 % inset, starting down
17586 \ifdim\pgf@circ@res@temp>0pt % inset
17587 % \typeout{INSETw\space\the\pgf@circ@res@right\space x\space\the\pgf@circ@res@step\space y\space\the\pgf@circ@res@temp}
17588 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
17589 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\insethright}}
17590 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\insethright}}
17591 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}
17592 \fi
17593 \pgfpathclose
17594 \pgf@circ@draworfill
17595 \endpgfscope
17596 % now we have to draw the pins, if needed
17597 \ifdim\extshift>0pt\ifpgfcirc@draw@leads\pgfscope % let's avoid too much indent
17598 % Ok, we have to draw the leads (a.k.a. pins)
17599 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
17600 % We mimic the anchors here --- probably there is a better way
17601 % left pins
17602 \ifnum\NL>0\relax % not indented, closed on \repeatpgfmathloop
17603 \pgf@circ@count@a=\NL\relax
17604 \pgf@circ@count@b=\NL \divide\pgf@circ@count@b by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
17605 \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
17606 \insetnortheast\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
17607 \ifdim\pgf@circ@res@down>0pt % check if we have an inset
17608 % we have to check oddity
17609 \ifodd\NL
17610 \ifnum\NL=1
17611 % only centerpin, step should not be used, but anyway...
17612 \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL)}
17613 \else
17614 \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/(\NL-1)}
17615 \fi
17616 \else
17617 \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@circ@res@up-\pgf@circ@res@down)/\NL}
17618 \fi
17619 \else % no inset
17620 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NL}
17621 \fi
17622 \pgfmathloop%
17623 \ifnum\pgf@circ@count@a>0
17624 %%%%%
17625 \ifdim\pgf@circ@res@down>0pt % check if we have an inset
17626 \ifnum\pgf@circ@count@a>\pgf@circ@count@b\relax
17627 % for lower pins we have to shift them down
17628 % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
17629 \ifodd\NL
17630 % odd number of pins
17631 \ifnum\pgf@circ@count@a=\numexpr\the\pgf@circ@count@b+1\relax
17632 % centerpin!
17633 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
17634 \ifnum\squarepins>0
17635 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{0pt}}
17636 \else
17637 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\extshift}{0pt}}
17638 \fi
17639 \else
17640 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
17641 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a+1)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
17642 \fi
17643 \else
17644 % even numer of pins: just go down
17645 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
17646 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step-2*\pgf@circ@res@down}}
17647 \fi
17648 \else
17649 % nothing need for #1<=NL/2
17650 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17651 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17652 \fi
17653 \else
17654 % no inset
17655 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17656 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17657 \fi
17658 %%%%%
17659 \advance\pgf@circ@count@a by -1\relax%
17660 \repeatpgfmathloop\fi%
17661 % right pins
17662 \ifnum\NR>0\pgf@circ@count@a=\NR\relax
17663 \pgfmathloop%
17664 \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@up=\pgf@y
17665 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@up/\NR}
17666 \ifnum\pgf@circ@count@a>0
17667 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17668 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\extshift}{\pgf@circ@res@up+(0.5-\pgf@circ@count@a)*\pgf@circ@res@step}}
17669 \advance\pgf@circ@count@a by -1\relax%
17670 \repeatpgfmathloop\fi%
17671 % bottom pins
17672 \ifnum\NB>0\pgf@circ@count@a=\NB\relax %%%
17673 \pgfmathloop%
17674 \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
17675 \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
17676 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NB}
17677 \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
17678 \ifnum\pgf@circ@count@a>0
17679 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17680 {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
17681 \ifnum\squarepins>0
17682 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17683 {-max(\pgf@circ@res@down, \pgf@circ@res@up)-\extshift}}
17684 \else
17685 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17686 {-\pgf@circ@res@down+(\NB-\pgf@circ@count@a+0.5)*\pgf@circ@res@other-\extshift}}
17687 \fi
17688 \advance\pgf@circ@count@a by -1\relax%
17689 \repeatpgfmathloop\fi%
17690 % top pins
17691 \ifnum\NT>0\pgf@circ@count@a=\NT\relax
17692 \pgfmathloop%
17693 \topleft\pgf@circ@res@left=\pgf@x \pgf@circ@res@up=\pgf@y
17694 \topright\pgf@circ@res@right=\pgf@x \pgf@circ@res@down=\pgf@y
17695 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@circ@res@right/\NT}
17696 \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@circ@res@down-\pgf@circ@res@up)/(\pgf@circ@res@right-\pgf@circ@res@left)*\pgf@circ@res@step}
17697 \ifnum\pgf@circ@count@a>0
17698 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17699 {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other}}
17700 \ifnum\squarepins>0
17701 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17702 {max(\pgf@circ@res@down, \pgf@circ@res@up)+\extshift}}
17703 \else
17704 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+(\pgf@circ@[email protected])*\pgf@circ@res@step}
17705 {\pgf@circ@res@down-(\NT-\pgf@circ@count@a+0.5)*\pgf@circ@res@other+\extshift}}
17706 \fi
17707 \advance\pgf@circ@count@a by -1\relax%
17708 \repeatpgfmathloop\fi%
17709 % end drawing pins; stroke them
17710 \pgfusepath{stroke}
17711 \endpgfscope\fi\fi
17712 }
17713 % let's start adding anchors
17714 \pgfutil@g@addto@macro\pgf@sh@s@muxdemux{%
17715 % left side anchors
17716 \pgf@circ@count@a=\NL\relax
17717 % \typeout{STARTGENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
17718 \pgfmathloop%
17719 \ifnum\pgf@circ@count@a>0
17720 % \typeout{GENERATINGLEFT\space\the\pgf@circ@count@a\space FOR\space\thisshape\space\NL}
17721 % we will create two anchors per pin: the "normal one" like `lpin 1` for the
17722 % external leads, and the "border one" like `blpin 1` for internal ones.
17723 % they will coincide if `external pins width` is set to 0.
17724 \expandafter\xdef\csname pgf@anchor@muxdemux@lpin\space\the\pgf@circ@count@a\endcsname{%
17725 \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{1}%
17726 }
17727 \expandafter\xdef\csname pgf@anchor@muxdemux@blpin\space\the\pgf@circ@count@a\endcsname{%
17728 \noexpand\pgf@circ@muxdemux@L@anchor{\the\pgf@circ@count@a}{0}%
17729 }
17730 \advance\pgf@circ@count@a by -1\relax%
17731 \repeatpgfmathloop%
17732 % right anchors
17733 \pgf@circ@count@a=\NR\relax
17734 \pgfmathloop%
17735 \ifnum\pgf@circ@count@a>0
17736 % we will create two anchors per pin: the "normal one" like `rpin 1` for the
17737 % external leads, and the "border one" like `brpin 1` for internal ones.
17738 % they will coincide if `external pins width` is set to 0.
17739 \expandafter\xdef\csname pgf@anchor@muxdemux@rpin\space\the\pgf@circ@count@a\endcsname{%
17740 \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{1}%
17741 }
17742 \expandafter\xdef\csname pgf@anchor@muxdemux@brpin\space\the\pgf@circ@count@a\endcsname{%
17743 \noexpand\pgf@circ@muxdemux@R@anchor{\the\pgf@circ@count@a}{0}%
17744 }
17745 \advance\pgf@circ@count@a by -1\relax%
17746 \repeatpgfmathloop%
17747 % bottom anchors
17748 \pgf@circ@count@a=\NB\relax
17749 \pgfmathloop%
17750 \ifnum\pgf@circ@count@a>0
17751 % we will create two anchors per pin: the "normal one" like `bpin 1` for the
17752 % external leads, and the "border one" like `bbpin 1` for internal ones.
17753 % they will coincide if `external pins width` is set to 0.
17754 \expandafter\xdef\csname pgf@anchor@muxdemux@bpin\space\the\pgf@circ@count@a\endcsname{%
17755 \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{1}%
17756 }
17757 \expandafter\xdef\csname pgf@anchor@muxdemux@bbpin\space\the\pgf@circ@count@a\endcsname{%
17758 \noexpand\pgf@circ@muxdemux@B@anchor{\the\pgf@circ@count@a}{0}%
17759 }
17760 \advance\pgf@circ@count@a by -1\relax%
17761 \repeatpgfmathloop%
17762 % top anchors
17763 \pgf@circ@count@a=\NT\relax
17764 \pgfmathloop%
17765 \ifnum\pgf@circ@count@a>0
17766 % we will create two anchors per pin: the "normal one" like `tpin 1` for the
17767 % external leads, and the "border one" like `btpin 1` for internal ones.
17768 % they will coincide if `external pins width` is set to 0.
17769 \expandafter\xdef\csname pgf@anchor@muxdemux@tpin\space\the\pgf@circ@count@a\endcsname{%
17770 \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{1}%
17771 }
17772 \expandafter\xdef\csname pgf@anchor@muxdemux@btpin\space\the\pgf@circ@count@a\endcsname{%
17773 \noexpand\pgf@circ@muxdemux@T@anchor{\the\pgf@circ@count@a}{0}%
17774 }
17775 \advance\pgf@circ@count@a by -1\relax%
17776 \repeatpgfmathloop%
17777 }%
17778 }
17779
17780 %% left anchors for muxdemux
17781
17782 \def\pgf@circ@muxdemux@L@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
17783 \topleft
17784 \pgf@xa=\pgf@x
17785 \pgf@ya=\pgf@y
17786 \insetnortheast
17787 \pgf@xb=\pgf@x
17788 \pgf@yb=\pgf@y
17789 \ifnum#1>\NL
17790 \PackageError{circuitikz}{%
17791 You requested left pin #1 for mux/demux shape \thisshape\space \MessageBreak
17792 which has been defined with \NL\space left pins%
17793 }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
17794 \fi
17795 \pgf@circ@count@a=\NL \divide\pgf@circ@count@a by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
17796 % \typeout{LEFT \the\pgf@xa \space \the\pgf@ya \space \NL}
17797 \ifnum\NL>1
17798 \ifdim\pgf@yb>0pt % check if we have an inset
17799 % we have to check oddity
17800 \ifodd\NL
17801 \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/(\NL-1)}
17802 \else
17803 \pgfmathsetlength{\pgf@circ@res@step}{2*(\pgf@ya-\pgf@yb)/\NL}
17804 \fi
17805 \else % no inset
17806 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NL}
17807 \fi
17808 \ifdim\pgf@yb>0pt % check if we have an inset
17809 \ifnum#1>\pgf@circ@count@a\relax
17810 % for lower pins we have to shift them down
17811 % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
17812 \ifodd\NL
17813 % odd number of pins
17814 \ifnum#1=\numexpr\the\pgf@circ@count@a+1\relax
17815 % centerpin!
17816 \ifnum#2=0\relax
17817 \pgfpoint{\pgf@xb}{0pt}
17818 \else
17819 \ifnum\squarepins>0
17820 \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
17821 \else
17822 \pgfpoint{\pgf@xb-#2*\extshift}{0pt}
17823 \fi
17824 \fi
17825 \else
17826 \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1+1)*\pgf@circ@res@step-2*\pgf@yb}
17827 \fi
17828 \else
17829 % even numer of pins: just go down
17830 \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step-2*\pgf@yb}
17831 \fi
17832 \else
17833 % nothing need for #1<=NL/2
17834 \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
17835 \fi
17836 \else
17837 % no inset
17838 \pgfpoint{\pgf@xa-#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
17839 \fi
17840 \else
17841 \pgfpoint{\pgf@xa-#2*\extshift}{0pt}
17842 \fi
17843 }
17844
17845 % right anchors
17846 \def\pgf@circ@muxdemux@R@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
17847 \topright
17848 \pgf@xa=\pgf@x
17849 \pgf@ya=\pgf@y
17850 \ifnum#1>\NR
17851 \PackageError{circuitikz}{%
17852 You requested right pin #1 for mux/demux shape \thisshape\space \MessageBreak
17853 which has been defined with \NR\space right pins%
17854 }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
17855 \fi
17856 \ifnum\NR>1
17857 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@ya/\NR}
17858 \pgfpoint{\pgf@xa+#2*\extshift}{\pgf@ya+(0.5-#1)*\pgf@circ@res@step}
17859 \else
17860 \pgfpoint{\pgf@xa+#2*\extshift}{0pt}
17861 \fi
17862 }
17863
17864 % bottom anchors
17865 \def\pgf@circ@muxdemux@B@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
17866 \topleft
17867 \pgf@xa=\pgf@x
17868 \pgf@ya=\pgf@y
17869 \topright
17870 \pgf@xb=\pgf@x
17871 \pgf@yb=\pgf@y
17872 \ifnum#1>\NB
17873 \PackageError{circuitikz}{%
17874 You requested bottom pin #1 for mux/demux shape \thisshape\space \MessageBreak
17875 which has been defined with \NB\space bottom pins%
17876 }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
17877 \fi
17878 \ifnum\NB>0
17879 % \typeout{DEBUGTESTtopleft\space\the\pgf@ya \space topright\space\the\pgf@yb \space\NB}
17880 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NB}
17881 \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
17882 \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
17883 \ifnum#2=0\relax
17884 \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other}
17885 \else
17886 \ifnum\squarepins>0\relax
17887 \pgfmathsetlength\pgf@y{-max(\pgf@ya,\pgf@yb)-\extshift}
17888 \else
17889 \pgfmathsetlength\pgf@y{-\pgf@yb+(\NB-#1+0.5)*\pgf@circ@res@other-\extshift}
17890 \fi
17891 \fi
17892 \else
17893 % should not happen, give the same as pin 1 anyway
17894 \ifnum#2=0\relax
17895 \pgfpoint{0pt}{-\pgf@yb+(\pgf@yb-\pgf@ya)/2}
17896 \else
17897 \pgfpoint{0pt}{-max(\pgf@ya,\pgf@yb)-\extshift}
17898 \fi
17899 \fi
17900 }
17901
17902 % top anchors
17903 \def\pgf@circ@muxdemux@T@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
17904 \topleft
17905 \pgf@xa=\pgf@x
17906 \pgf@ya=\pgf@y
17907 \topright
17908 \pgf@xb=\pgf@x
17909 \pgf@yb=\pgf@y
17910 \ifnum#1>\NT
17911 \PackageError{circuitikz}{%
17912 You requested top pin #1 for mux/demux shape \thisshape\space \MessageBreak
17913 which has been defined with \NT\space top pins%
17914 }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
17915 \fi
17916 \ifnum\NT>0
17917 \pgfmathsetlength{\pgf@circ@res@step}{2*\pgf@xb/\NT}
17918 \pgfmathsetlength{\pgf@circ@res@other}{(\pgf@yb-\pgf@ya)/(\pgf@xb-\pgf@xa)*\pgf@circ@res@step}
17919 \pgfmathsetlength\pgf@x{\pgf@xa+(#1-0.5)*\pgf@circ@res@step}
17920 \ifnum#2=0\relax
17921 \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other}
17922 \else
17923 \ifnum\squarepins>0
17924 \pgfmathsetlength\pgf@y{max(\pgf@ya,\pgf@yb)+\extshift}
17925 \else
17926 \pgfmathsetlength\pgf@y{\pgf@yb-(\NT-#1+0.5)*\pgf@circ@res@other+\extshift}
17927 \fi
17928 \fi
17929 \else
17930 % should not happen, give the same as pin 1 anyway
17931 \ifnum#2=0\relax
17932 \pgfpoint{0pt}{\pgf@yb-(\pgf@yb-\pgf@ya)/2}
17933 \else
17934 \pgfpoint{0pt}{max(\pgf@ya,\pgf@yb)+\extshift}
17935 \fi
17936 \fi
17937 }
17938 %%%---------- close: tex/pgfcircmultipoles
17939
17940 %%%%%%%%%%% Springe nach tex/pgfcirclabel
17941 %%%---------- open: tex/pgfcirclabel.tex
17942 % Copyright 2018-2026 by Romano Giannetti
17943 % Copyright 2015-2026 by Stefan Lindner
17944 % Copyright 2013-2026 by Stefan Erhardt
17945 % Copyright 2007-2026 by Massimo Redaelli
17946 %
17947 % This file may be distributed and/or modified
17948 %
17949 % 1. under the LaTeX Project Public License and/or
17950 % 2. under the GNU Public License.
17951 %
17952 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
17953
17954 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17955 %% Bipole label positioning
17956
17957 %% bipole labels and annotation extra style
17958
17959 \ctikzset{bipole label style/.style={}}
17960 \tikzset{bipole label style/.code={
17961 \ctikzset{bipole label style/.style={#1}}
17962 }}
17963 \tikzset{bipole label append style/.code={
17964 \ctikzset{bipole label style/.append style={#1}}
17965 }}
17966 \ctikzset{bipole annotation style/.style={}}
17967 \tikzset{bipole annotation style/.code={
17968 \ctikzset{bipole annotation style/.style={#1}}
17969 }}
17970 \tikzset{bipole annotation append style/.code={
17971 \ctikzset{bipole annotation style/.append style={#1}}
17972 }}
17973
17974 %% Options
17975 \ctikzset{label/.style = { l=#1 } }
17976 \ctikzset{l/.code = {
17977 \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
17978 \ctikzsetvalof{bipole/label/unit}{}
17979 \ifpgf@circ@siunitx
17980 \pgf@circ@handleSI{#1}
17981 \ifpgf@circ@siunitx@res
17982 \edef\pgf@temp{\pgf@circ@handleSI@val}
17983 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
17984 \edef\pgf@temp{\pgf@circ@handleSI@unit}
17985 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
17986 \else
17987 \fi
17988 \else
17989 \fi
17990 }}
17991
17992 \ctikzset{label above/.code = {
17993 l=#1,
17994 \circuitikzbasekey/bipole/label/position=90 }
17995 }
17996
17997 \ctikzset{l^/.style = {
17998 l=#1,
17999 \circuitikzbasekey/bipole/label/position=90 }
18000 }
18001
18002 \ctikzset{label below/.code = {
18003 l=#1,
18004 \circuitikzbasekey/bipole/label/position=-90 }
18005 }
18006
18007 \ctikzset{l_/.style = {
18008 l=#1,
18009 \circuitikzbasekey/bipole/label/position=-90 }
18010 }
18011
18012 \ctikzset{annotation/.style = { a=#1 } }
18013 \ctikzset{a/.code = {
18014 \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
18015 \ctikzsetvalof{bipole/annotation/unit}{}
18016 \ifpgf@circ@siunitx
18017 \pgf@circ@handleSI{#1}
18018 \ifpgf@circ@siunitx@res
18019 \edef\pgf@temp{\pgf@circ@handleSI@val}
18020 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
18021 \edef\pgf@temp{\pgf@circ@handleSI@unit}
18022 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
18023 \else
18024 \fi
18025 \else
18026 \fi
18027 }}
18028
18029 \ctikzset{annotation above/.code = {
18030 a=#1,
18031 \circuitikzbasekey/bipole/annotation/position=90 }
18032 }
18033
18034 \ctikzset{a^/.style = {
18035 a=#1,
18036 \circuitikzbasekey/bipole/annotation/position=90 }
18037 }
18038
18039 \ctikzset{annotation below/.code = {
18040 a=#1,
18041 \circuitikzbasekey/bipole/annotation/position=-90 }
18042 }
18043 \ctikzset{a_/.style = {
18044 a=#1,
18045 \circuitikzbasekey/bipole/annotation/position=-90 }
18046 }
18047
18048 % This is to adjust spacing for the labels so that they are not cramped on components
18049 \def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
18050
18051 \def\pgf@circ@drawlabels#1{
18052 \pgfextra{
18053 % This function will be called with argument #1 equal
18054 % to "label" or "annotation" form pgfcircpath.tex.
18055 % pgf@circ@direction is the direction of the path,
18056 % its value is set in pgfcircpath.tex
18057 \pgfmathsubtract{\pgf@circ@direction}{90}
18058 \pgfmathround{\pgfmathresult} % avoid precision loss errors
18059 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18060
18061 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
18062 \ifnum \pgf@circ@temp < 0
18063 \pgfmathadd{\pgf@circ@labanc}{180}
18064 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18065 \fi
18066 % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
18067 %
18068 % normalize the angle values
18069 %
18070 \pgfmathmod{\pgf@circ@labanc}{360}
18071 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18072 %
18073 \ifpgf@circuit@bipole@inverted
18074 \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
18075 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18076 \fi
18077 %
18078 \ifnum \ctikzvalof{mirror value} = -1
18079 \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
18080 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18081 \fi
18082 % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
18083 }
18084 %Firstly, place a coordinate directly at the edge of the shape
18085 (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
18086 %now decide, which labels should be drawn
18087 \pgfextra{
18088 \edef\pgf@temp{\ctikzvalof{label/align}}
18089 \def\pgf@circ@temp{straight}
18090 }
18091 \ifx\pgf@temp\pgf@circ@temp %straight
18092 \pgf@circ@drawreglabels{#1}
18093 \else
18094 \pgfextra{\def\pgf@circ@temp{rotate}}
18095 \ifx\pgf@temp\pgf@circ@temp %rotate
18096 \pgf@circ@drawrotlabels{#1}
18097 \else% smart
18098 \pgf@circ@drawsmartlabels{#1}
18099 \fi
18100 \fi
18101 }
18102
18103
18104 \def\pgf@circ@drawsmartlabels#1{
18105 \pgfextra{
18106 \pgfmathmod{\pgf@circ@direction}{90}
18107 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18108 }
18109 \ifnum \pgfcircmathresult > 20
18110 \ifnum \pgfcircmathresult < 70
18111 \pgf@circ@drawrotlabels{#1}
18112 \else
18113 \pgf@circ@drawreglabels{#1}
18114 \fi
18115 \else
18116 \pgf@circ@drawreglabels{#1}
18117 \fi
18118 }
18119
18120
18121 \def\pgf@circ@drawrotlabels#1{
18122 \pgfextra{
18123 % scale the distances in function of zoom, so that they are not
18124 % dependent on it but on font size. Thanks to @marmot
18125 % https://tex.stackexchange.com/a/476018/38080
18126 % the coeffcient is adjusted so that the distance is more or less
18127 % the same for rotated labels and straight ones (although it will
18128 % depend on the font, so it's not exact).
18129 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
18130 \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
18131 % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
18132 \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
18133 \ifnum \ctikzvalof{bipole/#1/position}>0
18134 %we need some more space for placement below, due to mid-anchor
18135 \else % we do not have <= in \ifnum...
18136 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
18137 \fi
18138 %Calculate rotation of the label from direction and strip decimals
18139 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
18140 % rotate the label at second or third quadrant:
18141 \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
18142 \pgfmathsubtract{\pgf@circ@direction}{180}
18143 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18144 %invert the space relationships due to rotated strings
18145 \ifnum \ctikzvalof{bipole/#1/position}>0
18146 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
18147 \fi
18148 \fi\fi
18149 \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
18150 \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18151 }
18152 % reset cm is not working correctly here
18153 (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
18154 node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
18155 (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
18156 }
18157
18158 \def\pgf@circ@drawreglabels#1{
18159 %Now calculate all shape positions
18160 %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
18161 %All points between will be addressed by angled-anchors:
18162 \pgfextra{
18163 % scale ex-distance to make it independent on scale
18164 % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
18165 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
18166 \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
18167 % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
18168 \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
18169 \pgfmathadd{\pgf@circ@labanc}{90}
18170 \pgfmathround{\pgfmathresult}
18171 \def\pgf@circ@labanctext{\pgf@circ@labanc}
18172 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18173 \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
18174 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
18175 }
18176 %Values around 90 are at both y-axis
18177 \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
18178 \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
18179 \ifnum \pgf@circ@labpos > 180
18180 \ifnum \ctikzvalof{bipole/#1/position} > 0
18181 \pgfextra{\def\pgf@circ@labanctext{mid west}}
18182 \else
18183 \pgfextra{\def\pgf@circ@labanctext{mid east}}
18184 \fi
18185 \else
18186 \ifnum \ctikzvalof{bipole/#1/position} > 0
18187 \pgfextra{\def\pgf@circ@labanctext{mid east}}
18188 \else
18189 \pgfextra{\def\pgf@circ@labanctext{mid west}}
18190 \fi
18191 \fi
18192 \fi\fi
18193 %Values between -5 and 5 are at pos /neg x-axis
18194 \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
18195 \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
18196 \ifnum \ctikzvalof{bipole/#1/position} < 0
18197 \ifnum \pgf@circ@labanc > 90
18198 % using base coordinate instead of south to naturally align
18199 % symbols with descendants; but this invalidate the effect of
18200 % the inner sep, so recover it by shifting the anchor
18201 % reset cm is not working sometime, use @marmot solution
18202 % see https://tex.stackexchange.com/a/476018/38080
18203 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
18204 \pgfextra{\def\pgf@circ@labanctext{base}}%base
18205 \else
18206 \pgfextra{\def\pgf@circ@labanctext{north}}%north
18207 \fi
18208 \else
18209 \ifnum \pgf@circ@labanc < 90
18210 % shift, as above
18211 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
18212 \pgfextra{\def\pgf@circ@labanctext{base}}%base
18213 \else
18214 \ifnum \pgf@circ@labanc > 180
18215 % this shouldn't happen, but somehow it does (270 degree anchors)
18216 % shift, as above
18217 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
18218 \pgfextra{\def\pgf@circ@labanctext{base}}%base
18219 \else
18220 \pgfextra{\def\pgf@circ@labanctext{north}}%north
18221 \fi
18222 \fi
18223 \fi
18224 \fi\fi
18225 (labelcoor) node[anchor=\pgf@circ@labanctext,
18226 inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style,
18227 ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
18228 }
18229 }
18230
18231 \def\pgf@circ@finallabels#1{%
18232 \edef\pgf@temp{}%
18233 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
18234 \ifx\pgf@temp\pgf@circ@temp%
18235 \ctikzvalof{bipole/#1/name}%
18236 \else%
18237 $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
18238 \fi%
18239 }
18240
18241 \ctikzset{text/.style={t=#1}}
18242 \ctikzset{t/.code={%
18243 \ctikzsetvalof{bipoles/twoport/text}{#1}%
18244 }}
18245
18246 %%%% Stacked labels
18247 %
18248 % stacked labels by Romano Giannetti [email protected]
18249 % heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
18250 % \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
18251 %
18252 % labels are in a tabular, globally aligned:
18253 % vertically with key l2 valign (default c)
18254 % c: center t: top b: bottom
18255 % horizontally with key l2 align (default l)
18256 % l: left c: centered r: right
18257 % you can switch sides using l2_=... and l2^=...
18258 % syntax is l2_ = line1 and line2 (same for l2^)
18259 %
18260 \ctikzset{%
18261 l2 valign/.store in=\ltwo@valign, l2 valign=c,
18262 l2 halign/.store in=\ltwo@halign, l2 halign=l,
18263 }
18264 \ctikzset{l2base/.code n args={2}{
18265 \pgfkeys{/tikz/circuitikz/bipole/label/name=%
18266 \bgroup
18267 \setlength{\tabcolsep}{2pt}%
18268 \def\ltwo@tabu{\tabular[\ltwo@valign]}%
18269 \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
18270 #1\\ #2%
18271 \endtabular
18272 \egroup
18273 }%
18274 \ctikzsetvalof{bipole/label/unit}{}
18275 \ifpgf@circ@siunitx
18276 \pgf@circ@handleSI{#2}
18277 \ifpgf@circ@siunitx@res
18278 \edef\pgf@temp{\pgf@circ@handleSI@val}
18279 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
18280 \edef\pgf@temp{\pgf@circ@handleSI@unit}
18281 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
18282 \else
18283 \fi
18284 \else
18285 \fi
18286 }}
18287 \ctikzset{l2/.style args={#1 and #2}{
18288 l2base={#1}{#2},
18289 \circuitikzbasekey/bipole/label/position=90 }
18290 }
18291 \ctikzset{l2 above/.style args={#1 and #2}{
18292 l2base={#1}{#2},
18293 \circuitikzbasekey/bipole/label/position=90 }
18294 }
18295 \ctikzset{l2^/.style args={#1 and #2}{
18296 l2base={#1}{#2},
18297 \circuitikzbasekey/bipole/label/position=90 }
18298 }
18299 \ctikzset{l2 below/.style args={#1 and #2}{
18300 l2base={#1}{#2},
18301 \circuitikzbasekey/bipole/label/position=-90 }
18302 }
18303 \ctikzset{l2_/.style args={#1 and #2}{
18304 l2base={#1}{#2},
18305 \circuitikzbasekey/bipole/label/position=-90 }
18306 }
18307
18308 %%%---------- close: tex/pgfcirclabel
18309 %%%%%%%%%%% Springe nach tex/pgfcircvoltage
18310 %%%---------- open: tex/pgfcircvoltage.tex
18311 % Copyright 2018-2026 by Romano Giannetti
18312 % Copyright 2015-2026 by Stefan Lindner
18313 % Copyright 2013-2026 by Stefan Erhardt
18314 % Copyright 2007-2026 by Massimo Redaelli
18315 %
18316 % This file may be distributed and/or modified
18317 %
18318 % 1. under the LaTeX Project Public License and/or
18319 % 2. under the GNU Public License.
18320 %
18321 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
18322
18323 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18324 %% Voltage management
18325
18326 %% styles
18327 \ctikzset{bipole voltage style/.style={}}
18328 \tikzset{bipole voltage style/.code={
18329 \ctikzset{bipole voltage style/.style={#1}}
18330 }}
18331 \tikzset{bipole voltage append style/.code={
18332 \ctikzset{bipole voltage style/.append style={#1}}
18333 }}
18334
18335 \ctikzset{v^>/.style = {
18336 v = #1,
18337 \circuitikzbasekey/bipole/voltage/direction = forward,
18338 \circuitikzbasekey/bipole/voltage/position = above
18339 }
18340 }
18341
18342 \ctikzset{v^</.style = {
18343 v = #1,
18344 \circuitikzbasekey/bipole/voltage/direction = backward,
18345 \circuitikzbasekey/bipole/voltage/position = above
18346 }
18347 }
18348
18349 \ctikzset{v_>/.style = {
18350 v = #1,
18351 \circuitikzbasekey/bipole/voltage/direction = forward,
18352 \circuitikzbasekey/bipole/voltage/position = below
18353 }
18354 }
18355
18356 \ctikzset{v_</.style = {
18357 v = #1,
18358 \circuitikzbasekey/bipole/voltage/direction = backward,
18359 \circuitikzbasekey/bipole/voltage/position = below
18360 }
18361 }
18362
18363 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
18364 \ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
18365 \ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
18366 \ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
18367
18368 % Default position varies whether the component is a voltage source
18369 % or not
18370 \ctikzset{v/.code = {
18371 \ifpgf@circuit@bipole@isvoltage
18372 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
18373 \circuitikzbasekey/bipole/voltage/direction=forward}
18374 \else
18375 \ifpgf@circ@oldvoltagedirection
18376 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
18377 \circuitikzbasekey/bipole/voltage/direction=backward}
18378 \else
18379 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
18380 \circuitikzbasekey/bipole/voltage/direction=forward}
18381 \fi
18382 \fi
18383 \ifpgf@circ@oldvoltagedirection
18384 \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
18385 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
18386 \circuitikzbasekey/bipole/voltage/direction=forward}
18387 \fi\fi
18388 \else
18389 \ifpgf@circuit@bipole@iscurrent
18390 \ifpgf@circuit@bipole@current@backward
18391 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
18392 \circuitikzbasekey/bipole/voltage/direction=forward}
18393 \else
18394 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
18395 \circuitikzbasekey/bipole/voltage/direction=backward}
18396 \fi\fi\fi
18397 \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
18398 \ctikzsetvalof{bipole/voltage/label/unit}{}
18399 \ifpgf@circ@siunitx
18400 \pgf@circ@handleSI{#1}
18401 \ifpgf@circ@siunitx@res
18402 \edef\pgf@temp{\pgf@circ@handleSI@val}
18403 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
18404 \edef\pgf@temp{\pgf@circ@handleSI@unit}
18405 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
18406 \else
18407 \fi
18408 \else
18409 \fi
18410 }
18411 }
18412
18413 % american voltage font selection and symbol definition
18414 % the default font command is {} --- nothing
18415 \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
18416 %
18417 % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
18418 %
18419 \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
18420 \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
18421
18422 %%
18423 \def\setscaledRlenforclass{%
18424 \csname pgf@sh@ma@\ctikzvalof{bipole/name}\endcsname
18425 \ifdefined\ctikzclass
18426 \edef\pgf@temp{/tikz/circuitikz/\ctikzclass/scale}
18427 \pgfkeysifdefined{\pgf@temp}
18428 {\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
18429 {\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}
18430 \else
18431 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
18432 \fi
18433 }
18434
18435 %% Output routine for generic bipoles
18436
18437 \def\pgf@circ@drawvoltagegeneric{
18438 \pgfextra{
18439 % \typeout{NAME:\ctikzvalof{bipole/name}}
18440 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}
18441 \pgfkeysifdefined{\pgf@temp}
18442 {
18443 \edef\partheight{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}}
18444 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
18445 }
18446 {
18447 \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
18448 {
18449 \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
18450 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
18451 }
18452 {%calculate default value from part height
18453 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
18454 \pgfkeysifdefined{\pgf@temp}
18455 {
18456 \edef\partheight{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
18457 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen+0.2\pgf@circ@scaled@Rlen)}
18458 }
18459 {
18460 \edef\tmpdistfromline{(.5\pgf@circ@scaled@Rlen)} %fallback to fixed value
18461 }
18462 }
18463 }
18464 % \typeout{KIND:\ctikzvalof{bipole/kind}\space RLEN:\the\pgf@circ@Rlen\space SCALED:\the\pgf@circ@scaled@Rlen}
18465 \ifnum \ctikzvalof{mirror value}=-1
18466 \ifpgf@circuit@bipole@inverted
18467 \ifpgf@circuit@bipole@voltage@straight
18468 \def\distfromline{\tmpdistfromline}
18469 \else
18470 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
18471 \fi
18472 \else
18473 \ifpgf@circuit@bipole@voltage@straight
18474 \def\distfromline{-\tmpdistfromline}
18475 \else
18476 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
18477 \fi
18478 \fi
18479 \else
18480 \ifpgf@circuit@bipole@inverted
18481 \ifpgf@circuit@bipole@voltage@straight
18482 \def\distfromline{-\tmpdistfromline}
18483 \else
18484 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
18485 \fi
18486 \else
18487 \ifpgf@circuit@bipole@voltage@straight
18488 \def\distfromline{\tmpdistfromline}
18489 \else
18490 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
18491 \fi
18492 \fi
18493 \fi
18494 \ifpgf@circuit@bipole@voltage@below
18495 \def\pgf@circ@voltage@angle{90}
18496 \else
18497 \def\pgf@circ@voltage@angle{-90}
18498 \fi
18499 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}
18500 \pgfkeysifdefined{\pgf@temp}
18501 { \edef\distancefromnode{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}} }
18502 { \edef\distancefromnode{\ctikzvalof{voltage/distance from node}} }
18503 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}
18504 \pgfkeysifdefined{\pgf@temp}
18505 { \edef\bumpb{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}} }
18506 { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
18507 \edef\shiftv{\ctikzvalof{voltage/shift}}
18508 % additional per-bipole voltage shift (internal)
18509 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}
18510 \pgfkeysifdefined{\pgf@temp}
18511 {
18512 \edef\addvshift{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/additional label shift}}
18513 }
18514 {
18515 \edef\addvshift{0}
18516 }
18517 \newdimen{\absvshift}
18518 \pgfmathsetlength{\absvshift}{(1+\shiftv+\addvshift)*(\distfromline)}
18519 % put this to true to see the voltage label coordinate anchors
18520 \newif\ifpgf@circ@debugv\pgf@circ@debugvfalse
18521 }
18522 % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow
18523 coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
18524 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorstartnode)$)
18525 coordinate (pgfcirc@Vfrom@flat) at (pgfcirc@midtmp)
18526 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
18527
18528 coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
18529 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorendnode)$)
18530 coordinate (pgfcirc@Vto@flat) at (pgfcirc@midtmp)
18531 coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
18532
18533 \ifpgf@circuit@bipole@voltage@below
18534 \ifpgf@circ@debugv
18535 node [ocirc, fill=red] at (anchorstartnode) {}
18536 node [ocirc, fill=blue] at (anchorendnode) {}
18537 node [ocirc, fill=green] at (pgfcirc@Vto) {}
18538 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
18539 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
18540 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
18541 \fi
18542 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! \absvshift!90 : (anchorendnode)$)
18543 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! \absvshift!-90 : (anchorstartnode)$)
18544 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
18545 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
18546 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! -\absvshift!90 : (pgfcirc@Vcont2t)$)
18547 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! -\absvshift!-90 : (pgfcirc@Vcont1t)$)
18548 \ifpgf@circ@debugv
18549 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
18550 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
18551 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
18552 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
18553 \fi
18554 \else
18555 \ifpgf@circ@debugv
18556 node [ocirc, fill=red] at (anchorstartnode) {}
18557 node [ocirc, fill=blue] at (anchorendnode) {}
18558 node [ocirc, fill=green] at (pgfcirc@Vto) {}
18559 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
18560 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
18561 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
18562 \fi
18563 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! -\absvshift!90 : (anchorendnode)$)
18564 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! -\absvshift!-90 : (anchorstartnode)$)
18565 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
18566 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
18567 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! \absvshift!90 : (pgfcirc@Vcont2t)$)
18568 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! \absvshift!-90 : (pgfcirc@Vcont1t)$)
18569 \ifpgf@circ@debugv
18570 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
18571 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
18572 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
18573 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
18574 \fi
18575 \fi
18576
18577 \ifpgf@circuit@europeanvoltage
18578 \ifpgf@circuit@bipole@voltage@straight
18579 \ifpgf@circuit@bipole@voltage@backward
18580 (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
18581 \else
18582 (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
18583 \fi
18584 \else
18585 \ifpgf@circuit@bipole@voltage@backward
18586 (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
18587 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
18588 (pgfcirc@Vfrom)
18589 \else
18590 (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
18591 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
18592 (pgfcirc@Vto)
18593 \fi
18594 \fi
18595 \else
18596 \ifpgf@circuit@bipole@voltage@backward
18597 \ifpgf@circ@oldvoltagedirection
18598 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
18599 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
18600 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
18601 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
18602 \else
18603 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
18604 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
18605 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
18606 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
18607 \fi
18608 \else
18609 \ifpgf@circ@oldvoltagedirection
18610 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
18611 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
18612 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
18613 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
18614 \else
18615 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
18616 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
18617 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
18618 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
18619 \fi
18620 \fi
18621 \fi
18622 }
18623
18624 %% Output routine for voltage sources
18625 \def\pgf@circ@drawvoltagegenerator{
18626 % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
18627 % it's not perfect, but I can't find the way to do it correctly...
18628 \pgfextra{
18629 \edef\shiftv{\ctikzvalof{voltage/shift}}
18630 \edef\bumpa{\ctikzvalof{voltage/bump a}}
18631 \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry.
18632 }
18633 \ifpgf@circuit@bipole@voltage@below
18634 coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
18635 coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
18636 \else
18637 coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
18638 coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
18639 \fi
18640 % fix the (unused in this case) Vcont1/2 coords for label placement along the line
18641 coordinate (pgfcirc@Vcont1) at (pgfcirc@Vto)
18642 coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom)
18643 \ifpgf@circuit@europeanvoltage
18644 \ifpgf@circuit@bipole@voltage@backward
18645 (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom)
18646 \else
18647 (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto)
18648 \fi
18649 \else% american voltage
18650 \ifpgf@circuit@bipole@voltageoutsideofsymbol
18651 % if it is a battery, must put + and -
18652
18653 \ifpgf@circ@fixbatteries
18654 \ifpgf@circuit@bipole@voltage@backward
18655 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
18656 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
18657 \else
18658 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
18659 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
18660 \fi
18661 \else
18662 \ifpgf@circuit@bipole@voltage@backward
18663 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
18664 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
18665 \else
18666 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
18667 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
18668 \fi
18669 \fi
18670 \fi
18671 \fi
18672 }
18673
18674 %% Output routine
18675 \def\pgf@circ@drawvoltage{% node name
18676 \pgfextra{ %WARNING: indentation is probably wrong
18677 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
18678 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
18679 \ifpgf@circuit@bipole@voltage@below
18680 \def\pgf@circ@bipole@voltage@label@anchor{north west}
18681 \else
18682 \def\pgf@circ@bipole@voltage@label@anchor{south east}
18683 \fi
18684 \fi\fi
18685 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
18686 \ifpgf@circuit@bipole@voltage@below
18687 \def\pgf@circ@bipole@voltage@label@anchor{west}
18688 \else
18689 \def\pgf@circ@bipole@voltage@label@anchor{east}
18690 \fi
18691 \fi\fi
18692 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
18693 \ifpgf@circuit@bipole@voltage@below
18694 \def\pgf@circ@bipole@voltage@label@anchor{south west}
18695 \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
18696 \fi
18697 \fi\fi
18698 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
18699 \ifpgf@circuit@bipole@voltage@below
18700 \def\pgf@circ@bipole@voltage@label@anchor{south}
18701 \else\def\pgf@circ@bipole@voltage@label@anchor{north}
18702 \fi
18703 \fi\fi
18704 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
18705 \ifpgf@circuit@bipole@voltage@below
18706 \def\pgf@circ@bipole@voltage@label@anchor{south east}
18707 \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
18708 \fi
18709 \fi\fi
18710 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
18711 \ifpgf@circuit@bipole@voltage@below
18712 \def\pgf@circ@bipole@voltage@label@anchor{east}
18713 \else \def\pgf@circ@bipole@voltage@label@anchor{west}
18714 \fi
18715 \fi\fi
18716 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
18717 \ifpgf@circuit@bipole@voltage@below
18718 \def\pgf@circ@bipole@voltage@label@anchor{north east}
18719 \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
18720 \fi
18721 \fi\fi
18722 \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
18723 \ifpgf@circuit@bipole@voltage@below
18724 \def\pgf@circ@bipole@voltage@label@anchor{north}
18725 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
18726 \fi
18727 \fi\fi
18728 \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
18729 \ifpgf@circuit@bipole@voltage@below
18730 \def\pgf@circ@bipole@voltage@label@anchor{north}
18731 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
18732 \fi
18733 \fi\fi
18734
18735 % this must be set *before* changing for mirroring and inverting; in that case
18736 % the xscale/yscale parameters take it into account
18737 \ifpgf@circuit@bipole@voltage@below
18738 \def\pgf@circ@bipole@voltage@label@where{-90}
18739 \else
18740 \def\pgf@circ@bipole@voltage@label@where{90}
18741 \fi
18742
18743 % magic to counteract the scale and yscale effects (there should be a better way...)
18744 \ifnum \ctikzvalof{mirror value}=-1
18745 \ifpgf@circuit@bipole@voltage@below
18746 \pgf@circuit@bipole@voltage@belowfalse
18747 \else
18748 \pgf@circuit@bipole@voltage@belowtrue
18749 \fi
18750 \fi
18751
18752 \ifpgf@circuit@bipole@inverted
18753 \ifpgf@circuit@bipole@voltage@below
18754 \pgf@circuit@bipole@voltage@belowfalse
18755 \else
18756 \pgf@circuit@bipole@voltage@belowtrue
18757 \fi
18758 \fi
18759
18760 % take into account scaling
18761 \setscaledRlenforclass
18762
18763 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}
18764 \pgfkeysifdefined{\pgf@temp}
18765 { \edef\eudist{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}} }
18766 { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
18767 % find the height of the bipole or use a default value
18768 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
18769 \pgfkeysifdefined{\pgf@temp}
18770 {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
18771 \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}}
18772 {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value
18773 \newdimen{\alshift}
18774 % this is more or less the same of the legacy code; we shift the american label a bit
18775 % outside the (+) -- (-) line
18776 \pgfmathsetlength{\alshift}{(\ctikzvalof{voltage/american label distance}-0.6)*\partheight}
18777 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
18778 }%end pgfextra
18779
18780 \ifpgf@circuit@bipole@isvoltage
18781 \pgf@circ@drawvoltagegenerator
18782 \else
18783 \pgf@circ@drawvoltagegeneric
18784 \fi
18785
18786 \ifpgf@circuit@bipole@voltage@straight
18787 coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
18788 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
18789 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
18790 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
18791 \else
18792 \ifpgf@circuit@europeanvoltage
18793 coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$)
18794 \else
18795 coordinate (Vlab) at ($(pgfcirc@Vfrom)!0.5!(pgfcirc@Vto)$)
18796 \ifpgf@circuit@bipole@isvoltage\else
18797 % add a bit of space for american labels above their symbols in the normal case. You can avoid that
18798 % with voltage/american label distance=0.5 (it's measured from the center of the component, in heights)
18799 coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$)
18800 \fi
18801 \fi
18802 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
18803 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
18804 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
18805 \fi
18806 }%end drawvoltages
18807 %%%---------- close: tex/pgfcircvoltage
18808 %%%%%%%%%%% Springe nach tex/pgfcirccurrent
18809 %%%---------- open: tex/pgfcirccurrent.tex
18810 % Copyright 2018-2026 by Romano Giannetti
18811 % Copyright 2015-2026 by Stefan Lindner
18812 % Copyright 2013-2026 by Stefan Erhardt
18813 % Copyright 2007-2026 by Massimo Redaelli
18814 %
18815 % This file may be distributed and/or modified
18816 %
18817 % 1. under the LaTeX Project Public License and/or
18818 % 2. under the GNU Public License.
18819 %
18820 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
18821
18822 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18823 %% Current handling
18824
18825 %% styles
18826 \ctikzset{bipole current style/.style={}}
18827 \tikzset{bipole current style/.code={
18828 \ctikzset{bipole current style/.style={#1}}
18829 }}
18830 \tikzset{bipole current append style/.code={
18831 \ctikzset{bipole current style/.append style={#1}}
18832 }}
18833
18834 %% Options
18835 \ctikzset{i^>/.style = {
18836 i = #1,
18837 \circuitikzbasekey/bipole/current/direction = forward,
18838 \circuitikzbasekey/bipole/current/x position = after,
18839 \circuitikzbasekey/bipole/current/y position = above
18840 }
18841 }
18842
18843 \ctikzset{i_>/.style = {
18844 i = #1,
18845 \circuitikzbasekey/bipole/current/direction = forward,
18846 \circuitikzbasekey/bipole/current/x position = after,
18847 \circuitikzbasekey/bipole/current/y position = below
18848 }
18849 }
18850
18851 \ctikzset{i>^/.style = {
18852 i = #1,
18853 \circuitikzbasekey/bipole/current/direction = forward,
18854 \circuitikzbasekey/bipole/current/x position = before,
18855 \circuitikzbasekey/bipole/current/y position = above
18856 }
18857 }
18858
18859 \ctikzset{i>_/.style = {
18860 i = #1,
18861 \circuitikzbasekey/bipole/current/direction = forward,
18862 \circuitikzbasekey/bipole/current/x position = before,
18863 \circuitikzbasekey/bipole/current/y position = below
18864 }
18865 }
18866
18867 \ctikzset{i^</.style = {
18868 i = #1,
18869 \circuitikzbasekey/bipole/current/direction = backward,
18870 \circuitikzbasekey/bipole/current/x position = after,
18871 \circuitikzbasekey/bipole/current/y position = above
18872 }
18873 }
18874
18875 \ctikzset{i_</.style = {
18876 i = #1,
18877 \circuitikzbasekey/bipole/current/direction = backward,
18878 \circuitikzbasekey/bipole/current/x position = after,
18879 \circuitikzbasekey/bipole/current/y position = below
18880 }
18881 }
18882
18883 \ctikzset{i<^/.style = {
18884 i = #1,
18885 \circuitikzbasekey/bipole/current/direction = backward,
18886 \circuitikzbasekey/bipole/current/x position = before,
18887 \circuitikzbasekey/bipole/current/y position = above
18888 }
18889 }
18890
18891 \ctikzset{i<_/.style = {
18892 i = #1,
18893 \circuitikzbasekey/bipole/current/direction = backward,
18894 \circuitikzbasekey/bipole/current/x position = before,
18895 \circuitikzbasekey/bipole/current/y position = below
18896 }
18897 }
18898
18899 \ctikzset{i/.code = {
18900 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
18901 \circuitikzbasekey/bipole/current/x position = after,
18902 \circuitikzbasekey/bipole/current/y position = above }
18903 \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
18904 \ctikzsetvalof{bipole/current/label/unit}{}
18905 \ifpgf@circ@siunitx
18906 \pgf@circ@handleSI{#1}
18907 \ifpgf@circ@siunitx@res
18908 \edef\pgf@temp{\pgf@circ@handleSI@val}
18909 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
18910 \edef\pgf@temp{\pgf@circ@handleSI@unit}
18911 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
18912 \else
18913 \fi
18914 \else
18915 \fi
18916 %reverse current direction for voltage sources
18917 \ifpgf@circ@oldvoltagedirection\else
18918 \ifpgf@circuit@bipole@isvoltage
18919 \ifpgf@circuit@bipole@voltage@backward
18920 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
18921 \circuitikzbasekey/bipole/current/x position = after,
18922 \circuitikzbasekey/bipole/current/y position = below }
18923 \else
18924 \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
18925 \circuitikzbasekey/bipole/current/x position = before,
18926 \circuitikzbasekey/bipole/current/y position = above }
18927 \fi\fi\fi
18928 }
18929 }
18930
18931 \ifpgf@circ@oldvoltagedirection
18932 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
18933 \else
18934 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
18935 \fi
18936 \ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
18937 \ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
18938 \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
18939
18940 %% Output routine
18941 \def\pgf@circ@drawcurrent{
18942 \pgfextra{
18943 \edef\pgf@circ@ffffff{\pgf@circ@direction}
18944 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
18945
18946 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
18947 \ifpgf@circuit@bipole@current@below
18948 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
18949 \fi
18950 \fi\fi
18951 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
18952 \ifpgf@circuit@bipole@current@below
18953 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
18954 \fi
18955 \fi\fi
18956 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
18957 \ifpgf@circuit@bipole@current@below
18958 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
18959 \fi
18960 \fi\fi
18961 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
18962 \ifpgf@circuit@bipole@current@below
18963 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
18964 \fi
18965 \fi\fi
18966 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
18967 \ifpgf@circuit@bipole@current@below
18968 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
18969 \fi
18970 \fi\fi
18971 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
18972 \ifpgf@circuit@bipole@current@below
18973 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
18974 \fi
18975 \fi\fi
18976 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
18977 \ifpgf@circuit@bipole@current@below
18978 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
18979 \fi
18980 \fi\fi
18981 \ifnum\pgfcircmathresult <5
18982 \ifpgf@circuit@bipole@current@below
18983 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
18984 \fi
18985 \fi
18986 \ifnum\pgfcircmathresult >355
18987 \ifpgf@circuit@bipole@current@below
18988 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
18989 \fi
18990 \fi
18991
18992 \ifpgf@circuit@bipole@current@below
18993 \def\pgf@circ@bipole@current@label@where{-90}
18994 \else
18995 \def\pgf@circ@bipole@current@label@where{+90}
18996 \fi
18997 }
18998
18999 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
19000 \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
19001 (\tikztostart)--(\tikztotarget)
19002 \else% normal bipole or source
19003 \ifpgf@circuit@bipole@current@before
19004 (\tikztostart)--(anchorstartnode)
19005 \else
19006 (anchorendnode)--(\tikztotarget)
19007 \fi
19008 \fi
19009 \ifpgf@circuit@bipole@current@backward
19010 \pgfextra{
19011 \pgfmathsubtract{\pgf@circ@ffffff}{180}
19012 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
19013 }
19014 \fi
19015 coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff,
19016 anchor=center](Iarrow)
19017 (Iarrow.\pgf@circ@bipole@current@label@where)
19018 node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
19019 (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}}
19020 }
19021
19022 %%%---------- close: tex/pgfcirccurrent
19023 %%%%%%%%%%% Springe nach tex/pgfcircflow
19024 %%%---------- open: tex/pgfcircflow.tex
19025 % Copyright 2018-2026 by Romano Giannetti
19026 % Copyright 2015-2026 by Stefan Lindner
19027 % Copyright 2013-2026 by Stefan Erhardt
19028 % Copyright 2007-2026 by Massimo Redaelli
19029 %
19030 % This file may be distributed and/or modified
19031 %
19032 % 1. under the LaTeX Project Public License and/or
19033 % 2. under the GNU Public License.
19034 %
19035 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
19036
19037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19038 %% flow handling
19039
19040 %% styles
19041 \ctikzset{bipole flow style/.style={}}
19042 \tikzset{bipole flow style/.code={
19043 \ctikzset{bipole flow style/.style={#1}}
19044 }}
19045 \tikzset{bipole flow append style/.code={
19046 \ctikzset{bipole flow style/.append style={#1}}
19047 }}
19048
19049 %% Options
19050 \ctikzset{f^>/.style = {
19051 f = #1,
19052 \circuitikzbasekey/bipole/flow/direction = forward,
19053 \circuitikzbasekey/bipole/flow/x position = after,
19054 \circuitikzbasekey/bipole/curflowrent/y position = above
19055 }
19056 }
19057
19058 \ctikzset{f_>/.style = {
19059 f = #1,
19060 \circuitikzbasekey/bipole/flow/direction = forward,
19061 \circuitikzbasekey/bipole/flow/x position = after,
19062 \circuitikzbasekey/bipole/flow/y position = below
19063 }
19064 }
19065
19066 \ctikzset{f>^/.style = {
19067 f = #1,
19068 \circuitikzbasekey/bipole/flow/direction = forward,
19069 \circuitikzbasekey/bipole/flow/x position = before,
19070 \circuitikzbasekey/bipole/flow/y position = above
19071 }
19072 }
19073
19074 \ctikzset{f>_/.style = {
19075 f = #1,
19076 \circuitikzbasekey/bipole/flow/direction = forward,
19077 \circuitikzbasekey/bipole/flow/x position = before,
19078 \circuitikzbasekey/bipole/flow/y position = below
19079 }
19080 }
19081
19082 \ctikzset{f^</.style = {
19083 f = #1,
19084 \circuitikzbasekey/bipole/flow/direction = backward,
19085 \circuitikzbasekey/bipole/flow/x position = after,
19086 \circuitikzbasekey/bipole/flow/y position = above
19087 }
19088 }
19089
19090 \ctikzset{f_</.style = {
19091 f = #1,
19092 \circuitikzbasekey/bipole/flow/direction = backward,
19093 \circuitikzbasekey/bipole/flow/x position = after,
19094 \circuitikzbasekey/bipole/flow/y position = below
19095 }
19096 }
19097
19098 \ctikzset{f<^/.style = {
19099 f = #1,
19100 \circuitikzbasekey/bipole/flow/direction = backward,
19101 \circuitikzbasekey/bipole/flow/x position = before,
19102 \circuitikzbasekey/bipole/flow/y position = above
19103 }
19104 }
19105
19106 \ctikzset{f<_/.style = {
19107 f = #1,
19108 \circuitikzbasekey/bipole/flow/direction = backward,
19109 \circuitikzbasekey/bipole/flow/x position = before,
19110 \circuitikzbasekey/bipole/flow/y position = below
19111 }
19112 }
19113
19114 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
19115 \ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
19116 \ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
19117 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
19118
19119 \ctikzset{f/.code = {
19120 \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
19121 \circuitikzbasekey/bipole/flow/x position = after,
19122 \circuitikzbasekey/bipole/flow/y position = above }
19123 \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
19124 \ctikzsetvalof{bipole/flow/label/unit}{}
19125 \ifpgf@circ@siunitx
19126 \pgf@circ@handleSI{#1}
19127 \ifpgf@circ@siunitx@res
19128 \edef\pgf@temp{\pgf@circ@handleSI@val}
19129 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
19130 \edef\pgf@temp{\pgf@circ@handleSI@unit}
19131 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
19132 \else
19133 \fi
19134 \else
19135 \fi
19136 }
19137 }
19138
19139 %% Output routine
19140 \def\pgf@circ@drawflow{
19141 \pgfextra{
19142 \edef\pgf@circ@ffffff{\pgf@circ@direction}
19143 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
19144
19145 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
19146 \ifpgf@circuit@bipole@flow@below
19147 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
19148 \fi
19149 \fi\fi
19150 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
19151 \ifpgf@circuit@bipole@flow@below
19152 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
19153 \fi
19154 \fi\fi
19155 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
19156 \ifpgf@circuit@bipole@flow@below
19157 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
19158 \fi
19159 \fi\fi
19160 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
19161 \ifpgf@circuit@bipole@flow@below
19162 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
19163 \fi
19164 \fi\fi
19165 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
19166 \ifpgf@circuit@bipole@flow@below
19167 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
19168 \fi
19169 \fi\fi
19170 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
19171 \ifpgf@circuit@bipole@flow@below
19172 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
19173 \fi
19174 \fi\fi
19175 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
19176 \ifpgf@circuit@bipole@flow@below
19177 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
19178 \fi
19179 \fi\fi
19180 \ifnum\pgfcircmathresult <5
19181 \ifpgf@circuit@bipole@flow@below
19182 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
19183 \fi
19184 \fi
19185 \ifnum\pgfcircmathresult >355
19186 \ifpgf@circuit@bipole@flow@below
19187 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
19188 \fi
19189 \fi
19190
19191 \ifpgf@circuit@bipole@flow@below
19192 \def\pgf@circ@bipole@flow@label@where{-90}
19193 \else
19194 \def\pgf@circ@bipole@flow@label@where{+90}
19195 \fi
19196 }
19197
19198 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
19199 \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
19200 (\tikztostart)--(\tikztotarget)
19201 \else% normal bipole or source
19202 \ifpgf@circuit@bipole@flow@before
19203 (\tikztostart)--(anchorstartnode)
19204 \else
19205 (anchorendnode)--(\tikztotarget)
19206 \fi
19207 \fi
19208 \pgfextra{
19209 \ifpgf@circuit@bipole@flow@backward
19210 \ifpgf@circuit@bipole@flow@below
19211 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
19212 \else
19213 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
19214 \fi
19215 \pgfmathsubtract{\pgf@circ@ffffff}{180}
19216 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
19217 \else
19218 \ifpgf@circuit@bipole@flow@below
19219 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
19220 \else
19221 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
19222 \fi
19223 \fi
19224 }
19225 coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos)
19226 (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
19227 (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}}
19228 }
19229
19230 %%%---------- close: tex/pgfcircflow
19231
19232 % notice that the default is nooldvoltagedirection; it's not explicitly set to allow for the warning
19233 \ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
19234
19235 \ProcessOptions\relax
19236
19237 %%%%%%%%%%% Springe nach tex/pgfcircpath
19238 %%%---------- open: tex/pgfcircpath.tex
19239 % Copyright 2018-2026 by Romano Giannetti
19240 % Copyright 2015-2026 by Stefan Lindner
19241 % Copyright 2013-2026 by Stefan Erhardt
19242 % Copyright 2007-2026 by Massimo Redaelli
19243 %
19244 % This file may be distributed and/or modified
19245 %
19246 % 1. under the LaTeX Project Public License and/or
19247 % 2. under the GNU Public License.
19248 %
19249 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
19250
19251
19252 \def\pgf@circ@direction{0.0}
19253
19254 % Names
19255 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
19256 \ctikzset{n/.code = {
19257 \pgfkeys{/tikz/circuitikz/bipole/name=#1}
19258 }}
19259
19260 % Reflect the node along
19261 \ctikzset{mirrored/.is choice}
19262 \ctikzset{mirror value/.initial=1}
19263 \ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
19264 \ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
19265 \ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
19266
19267 % Invert node along path
19268 \ctikzset{inverted/.is choice}
19269 \ctikzset{invert value/.initial=1}
19270 \ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
19271 \ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
19272 \ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
19273 \newif\ifpgf@circuit@bipole@inverted
19274 \ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
19275
19276 \newif\ifpgf@circuit@bipole@voltage@backward
19277 \ctikzset{bipole/voltage/direction/.is choice}
19278 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
19279 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
19280
19281 % Initialize paths
19282 \def\pgfcircresetpath{
19283 \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
19284 bipole/inverted=false, bipole/kind=,
19285 bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
19286 bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
19287 bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
19288 bipole/current/y position=above, bipole/current/direction=forward,
19289 mirrored=false
19290 }
19291 }
19292
19293 %% Helper function for path-function to ensure using anchors between nodes
19294 \def\set@explicit@center@anchor#1{
19295 \pgfutil@ifundefined{pgf@sh@ns@#1}
19296 {
19297 %This coordinate is no node(but a relative position or a coordinate), no further handling needed
19298 }{
19299 \pgfutil@in@.{#1}
19300 \ifpgfutil@in@
19301 % Anchor is used, do nothing!
19302 \else%
19303 \let\tikz@moveto@waiting=\relax
19304 \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
19305 \edef#1{#1.center}%ensure using center anchor
19306 \fi
19307 }
19308 }
19309
19310
19311 %% Generic bipole path
19312 %% I am not user what the second argument is needed for
19313 \def\pgf@circ@bipole@path#1#2{
19314
19315 \pgfextra{
19316 \set@explicit@center@anchor{\tikztostart}
19317 \set@explicit@center@anchor{\tikztotarget}
19318 \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
19319 \ctikzset{bipole/kind = #1}
19320 \edef\pgf@temp{\ctikzvalof{bipole/name}}
19321 \def\pgf@circ@temp{}
19322 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
19323 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
19324 \ctikzset{bipole/name = #1\pgf@circ@rand} % create it (re-usage should not create problem, but...)
19325 \fi
19326 }
19327
19328 (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
19329 (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
19330 \pgfextra{
19331 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
19332 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
19333 \pgfmathround{\pgfmathresult}
19334 \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
19335 \pgfsyssoftpath@setcurrentpath{\myp@th}
19336 }
19337 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
19338 \ifx\pgf@temp\pgf@circ@temp % if it is an open
19339 \else
19340 --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
19341 \fi
19342 ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
19343 node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
19344 (\ctikzvalof{bipole/name}) {}
19345 \ifpgf@circuit@bipole@inverted
19346 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
19347 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
19348 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
19349 \else
19350 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
19351 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
19352 \fi
19353 \else
19354 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
19355 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
19356 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
19357 \else
19358 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
19359 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
19360 \fi
19361 \fi
19362 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
19363 \ifx\pgf@temp\pgf@circ@temp % if it is an open
19364 \else
19365 (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
19366 (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
19367 \fi
19368
19369 \drawpoles
19370 \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
19371 \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
19372 \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
19373 \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
19374 \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
19375 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
19376 \ifx\pgf@temp\pgf@circ@temp % if it is an open
19377 (\ctikzvalof{bipole/name}end)%Move to end of path
19378 \else
19379 ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
19380 %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
19381
19382 \fi
19383 % reset
19384 \pgfextra{
19385 \pgfcircresetpath
19386 }
19387 \tikztonodes%draw pending nodes an path
19388 }
19389
19390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19391 %% Handling of terminals
19392
19393 \ctikzset{bipole/nodes/.is family}
19394 \ctikzset{bipole/nodes/left/.initial=none}
19395 \ctikzset{bipole/nodes/right/.initial=none}
19396 \tikzset{bipole nodes/.style n args={2}{%
19397 \circuitikzbasekey/bipole/nodes/left=#1,
19398 \circuitikzbasekey/bipole/nodes/right=#2
19399 }
19400 }
19401
19402 %% Easily usable styles
19403
19404 \ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
19405 \ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
19406 \ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
19407 \ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
19408 \ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
19409 \ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
19410 \ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
19411 \ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
19412 \ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
19413 \ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
19414 \ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
19415 \ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
19416 \ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
19417 \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
19418 \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
19419
19420 % rectjoinfill workarounds
19421
19422 \ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
19423 \ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
19424 \ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
19425 \ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
19426 \ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
19427 \ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
19428 \ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
19429 \ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
19430 \ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
19431
19432 \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
19433
19434 \def\drawpoles{
19435 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
19436 \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
19437 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
19438 \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
19439 }
19440
19441 %% Path definitions
19442 \def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
19443 \def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
19444 \def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
19445 \def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
19446 \def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
19447 \def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
19448 \def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
19449 \def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
19450 \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
19451 \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
19452 \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
19453 %% polar capacitor is deprectaed, use curved capacitor instead
19454 \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
19455 \def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}}
19456 \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
19457 \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
19458 \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
19459 \def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
19460 \def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
19461 \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
19462 \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
19463 \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
19464 \def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
19465 \def\pgf@circ@inductor@path#1{%
19466 \pgfextra{
19467 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
19468 \def\pgf@temp{european}%
19469 }
19470 \ifx\pgf@temp\pgf@circ@temp%
19471 \pgf@circ@europeaninductor@path{#1}%
19472 \else%
19473 \pgfextra{ \def\pgf@temp{cute} }%
19474 \ifx\pgf@temp\pgf@circ@temp%
19475 \pgf@circ@cuteinductor@path{#1}%
19476 \else%
19477 \pgf@circ@americaninductor@path{#1}%
19478 \fi%
19479 \fi%
19480 }
19481 \def\pgf@circ@vinductor@path#1{
19482 \pgfextra{
19483 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
19484 \def\pgf@temp{european}%
19485 }
19486 \ifx\pgf@temp\pgf@circ@temp%
19487 \pgf@circ@veuropeaninductor@path{#1}%
19488 \else%
19489 \pgfextra{ \def\pgf@temp{cute} }%
19490 \ifx\pgf@temp\pgf@circ@temp%
19491 \pgf@circ@vcuteinductor@path{#1}%
19492 \else%
19493 \pgf@circ@vamericaninductor@path{#1}%
19494 \fi%
19495 \fi%
19496 }
19497 \def\pgf@circ@inductivesens@path#1{%
19498 \pgfextra{
19499 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
19500 \def\pgf@temp{european}%
19501 }
19502 \ifx\pgf@temp\pgf@circ@temp%
19503 \pgf@circ@europeaninductivesens@path{#1}%
19504 \else%
19505 \pgfextra{ \def\pgf@temp{cute} }%
19506 \ifx\pgf@temp\pgf@circ@temp%
19507 \pgf@circ@cuteinductivesens@path{#1}%
19508 \else%
19509 \pgf@circ@americaninductivesens@path{#1}%
19510 \fi%
19511 \fi%
19512 }
19513 \def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
19514 \def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
19515 \def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
19516 \def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
19517 \def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
19518 \def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
19519 \def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
19520 \def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
19521 \def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
19522 \def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
19523 \def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
19524 \def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
19525 \def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
19526 \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
19527 \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
19528 \def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
19529 \def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
19530 \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
19531 \def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
19532 \def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
19533 \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
19534 \def\pgf@circ@ecsource@path#1{\pgf@circ@bipole@path{ecsource}{#1}}
19535 \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
19536 \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
19537 \def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
19538 \def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
19539 \def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
19540 \def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
19541 \def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
19542 \def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
19543 \def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
19544 \def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
19545 \def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
19546 \def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
19547 \def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
19548 \def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
19549 \def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
19550 \def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
19551 \def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
19552 \def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
19553 \def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
19554 \def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
19555 \def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
19556 \def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
19557 \def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
19558 \def\pgf@circ@empty@path#1{}
19559 \def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
19560 \def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
19561 \def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
19562 \def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
19563 \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
19564 \def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
19565 \def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
19566 \def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
19567 \def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
19568 \def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
19569 \def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
19570 \def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
19571 \def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
19572 \def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
19573
19574 \def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
19575 \def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
19576 \def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
19577
19578 \def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
19579 \def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
19580 \def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
19581 \def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
19582 \def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
19583 \def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
19584 \def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
19585 \def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
19586 \def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
19587 \def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
19588 \def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
19589 \def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
19590 \def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
19591 \def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
19592 \def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
19593 \def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
19594 \def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
19595 \def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
19596 \def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
19597
19598 %%Mechanical
19599 \def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
19600 \def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
19601 \def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
19602 \def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
19603
19604 %% Styles
19605
19606 \def\comnpatname{\ifpgf@circuit@compat *\else\fi}
19607 \def\compattikzset#1{\tikzset{\comnpatname#1}}
19608
19609 %\def\ctikzsetbipole#1#2{%
19610 % \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
19611 %}
19612
19613 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
19614 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
19615 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
19616 \compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
19617 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
19618 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
19619 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
19620 \compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
19621 \compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
19622 \compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
19623 \compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
19624 \compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
19625 \compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
19626 \compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
19627 \compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
19628 \compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
19629 \compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
19630 \compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
19631 \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
19632 \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
19633 \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
19634 % polar capacitor is deprecated, use curved capacitor instead
19635 \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
19636 \compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}}
19637 \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
19638 \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
19639 \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19640 \compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19641 \compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19642 \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
19643 \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
19644 \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
19645 \compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
19646 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
19647 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
19648 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
19649 \compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
19650 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
19651 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
19652 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
19653 \compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
19654 \compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
19655 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
19656 \compattikzset{transmission line/.style = {tline = #1}}
19657 \compattikzset{TL/.style = {tline = #1}}
19658 \compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
19659 \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}}
19660 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
19661 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19662 \compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19663 \compattikzset{empty controlled source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19664 \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}}
19665 \compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
19666 \compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19667 \compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19668 \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 }}
19669 \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 }}
19670 \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 }}
19671 \compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19672 \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}}
19673 \compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19674
19675 \compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
19676 \compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
19677 \compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
19678 \compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
19679
19680
19681 \compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
19682 \compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
19683 \compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
19684 \compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
19685 \compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
19686 \compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
19687 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
19688
19689 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
19690 \compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
19691
19692 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
19693 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
19694 \compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
19695 \compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
19696 \compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
19697
19698 \compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
19699 \compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
19700 \compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
19701 \compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
19702 \compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
19703 \compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
19704 \compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
19705 \compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
19706 \compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
19707 \compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
19708 \compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
19709 \compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
19710 \compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
19711 \compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
19712 \compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
19713 \compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
19714 \compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
19715 \compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
19716 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
19717
19718 % % % % % %
19719 % % Begin of Diodes
19720 % % % % % %
19721
19722 \def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
19723 \def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
19724 \def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
19725 \def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
19726 \def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
19727 \def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
19728 \def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
19729 \def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
19730 \def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
19731 \def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
19732 \def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
19733 \def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
19734 \def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
19735 \def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
19736 \def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
19737 \def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
19738 \def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
19739 \def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
19740
19741 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
19742 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
19743 \compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
19744 \compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
19745 \compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
19746 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
19747 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
19748 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
19749 \compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
19750 \compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
19751 \compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
19752
19753 \compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
19754 \compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
19755 \compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
19756 \compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
19757 \compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
19758 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
19759 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
19760 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
19761 \compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
19762 \compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
19763 \compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
19764
19765 \compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
19766 \compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
19767 \compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
19768 \compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
19769 \compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
19770 \compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
19771 \compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
19772 \compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
19773 \compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
19774 %\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
19775
19776 \def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
19777
19778 \compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
19779 \compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
19780 \compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
19781 \compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
19782 \compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
19783 \compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
19784 \compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
19785 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
19786 \compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
19787 \compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
19788 \compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
19789
19790 %% Define Shortcuts
19791 \compattikzset{Do/.style = {\comnpatname empty diode}}
19792 \compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
19793 \compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
19794 \compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
19795 \compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
19796 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
19797 \compattikzset{leDo/.style = {\comnpatname empty led}}
19798 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
19799 \compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
19800 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
19801 \compattikzset{Tro/.style = {\comnpatname empty triac}}
19802
19803 \compattikzset{D*/.style = {\comnpatname full diode}}
19804 \compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
19805 \compattikzset{zD*/.style = {\comnpatname full Zener diode}}
19806 \compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
19807 \compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
19808 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
19809 \compattikzset{leD*/.style = {\comnpatname full led}}
19810 \compattikzset{VC*/.style = {\comnpatname full varcap}}
19811 \compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
19812 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
19813 \compattikzset{Tr*/.style = {\comnpatname full triac}}
19814
19815 \compattikzset{D/.style = {\comnpatname diode}}
19816 \compattikzset{tD/.style = {\comnpatname tunnel diode}}
19817 \compattikzset{zD/.style = {\comnpatname Zener diode}}
19818 \compattikzset{zzD/.style = {\comnpatname ZZener diode}}
19819 \compattikzset{sD/.style = {\comnpatname Schottky diode}}
19820 \compattikzset{pD/.style = {\comnpatname photodiode}}
19821 \compattikzset{leD/.style = {\comnpatname led}}
19822 \compattikzset{VC/.style = {\comnpatname varcap}}
19823 \compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
19824 \compattikzset{Ty/.style = {\comnpatname thyristor}}
19825 \compattikzset{Tr/.style = {\comnpatname triac}}
19826
19827 \compattikzset{D-/.style = {\comnpatname stroke diode}}
19828 \compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
19829 \compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
19830 \compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
19831 \compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
19832 \compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
19833 \compattikzset{leD-/.style = {\comnpatname stroke led}}
19834 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
19835 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
19836 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
19837 \compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
19838
19839 % % % % % %
19840 % % End of Diodes
19841 % % % % % %
19842
19843
19844 \compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
19845 \compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
19846 \compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
19847 \compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
19848 \compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
19849 \compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
19850 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
19851 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
19852 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
19853 \compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
19854 \compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
19855 \compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
19856 \compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
19857 \compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
19858
19859 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
19860 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
19861 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
19862 \tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
19863
19864 % cute switches
19865 %% closed cute switch
19866 \def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
19867 \compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
19868 \compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
19869
19870 %% open cute switch
19871 \def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
19872 \compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
19873 \compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
19874
19875 %% closing cute switch
19876 \def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
19877 \compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
19878 \compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
19879
19880 %% opening cute switch
19881 \def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
19882 \compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
19883 \compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
19884
19885
19886 % short forms
19887 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19888 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19889 \compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
19890 \compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
19891
19892 \compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
19893 \compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
19894
19895 \compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
19896 \compattikzset{isource/.style = {\comnpatname current source = #1}}
19897 \compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
19898 \compattikzset{ecsource/.style = {\comnpatname empty controlled source = #1}}
19899 \compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
19900 \compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
19901 \compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
19902 \compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
19903 \compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
19904 \compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
19905 \compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
19906
19907 \compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
19908 \compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
19909 \compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
19910 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
19911
19912 \compattikzset{R/.style= {\comnpatname resistor = #1}}
19913 \compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
19914 \compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
19915 \compattikzset{thR/.style= {\comnpatname thermistor = #1}}
19916 \compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
19917 \compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
19918 \compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
19919 \compattikzset{C/.style = {\comnpatname capacitor = #1}}
19920 \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
19921 %% pC is deprecated, use cC instead
19922 \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
19923 \compattikzset{cC/.style = {\comnpatname curved capacitor = #1}}
19924 \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
19925 \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
19926 \compattikzset{L/.style = {\comnpatname inductor = #1}}
19927 \compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
19928 \compattikzset{V/.style = {\comnpatname voltage source = #1}}
19929 \compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
19930 \compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
19931 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
19932 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
19933 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
19934 \def\pgf@temp#1{
19935 \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
19936 \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
19937 \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
19938 \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
19939 }
19940 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
19941 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
19942
19943 %current sources
19944 \compattikzset{I/.style = {\comnpatname current source = #1}}
19945 \compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
19946 \compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
19947 \compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
19948 \def\pgf@temp#1{
19949 \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
19950 \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
19951 \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
19952 \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
19953 }
19954 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
19955 \pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
19956 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
19957
19958 % cute sources
19959 \def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
19960 \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}}
19961 \compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
19962 \compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
19963
19964 \def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
19965 \compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19966 \compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
19967 \compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
19968
19969 \def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
19970 \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}}
19971 \compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
19972 \compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
19973
19974 \def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
19975 \compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19976 \compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
19977 \compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
19978
19979 % noise sources
19980 \def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
19981 \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}}
19982 \compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
19983 \compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
19984
19985 \def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
19986 \compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
19987 \compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
19988 \compattikzset{nI/.style= {\comnpatname noise current source= #1}}
19989
19990 % resistive sensor american style
19991 \def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
19992 \compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
19993 \compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
19994 \compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
19995 \compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
19996
19997 \compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
19998 \compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
19999
20000 \compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
20001 \compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
20002 \compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
20003 \compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
20004 \compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
20005
20006 \compattikzset{Mr/.style = {\comnpatname memristor}}
20007
20008 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
20009 \compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
20010 \compattikzset{spst/.style = {\comnpatname switch = #1}}
20011
20012 \compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
20013
20014 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
20015 \compattikzset{vss/.style = {\comnpatname vee = #1}}
20016
20017 % activate the to-style crossing
20018 \def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
20019 \compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
20020 \compattikzset{xing/.style= {\comnpatname crossing= #1}}
20021
20022 %% loudspeaker and microphone
20023
20024 \def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
20025 \compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
20026
20027 \def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
20028 \compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
20029
20030 % more instrument
20031 \def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
20032 \compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
20033 \def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
20034 \compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
20035 \def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
20036 \compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
20037 % current loop probes
20038 \def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
20039 \compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
20040 \def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
20041 \compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
20042 % qucs-style probes
20043 \def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
20044 \compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
20045 \def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
20046 \compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
20047 \def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
20048 \compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
20049 % multiwire(s)
20050 \def\pgf@circ@bmultiwire@path#1{\pgf@circ@bipole@path{bmultiwire}{#1}}
20051 \compattikzset{bmultiwire/.style = {\circuitikzbasekey,
20052 /tikz/to path=\pgf@circ@bmultiwire@path, l=#1}}
20053 \def\pgf@circ@multiwire@path#1{\pgf@circ@bipole@path{multiwire}{#1}}
20054 \compattikzset{multiwire/.style = {\circuitikzbasekey,
20055 /tikz/to path=\pgf@circ@multiwire@path, l=#1}}
20056
20057 % reed switches
20058 \def\pgf@circ@reed@path#1{\pgf@circ@bipole@path{reed}{#1}}
20059 \compattikzset{reed/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@reed@path, l=#1}}
20060
20061 % Transistor like bipoles
20062
20063 \def\pgf@circ@trans@path#1#2{
20064 \pgfextra{
20065 \edef\pgf@temp{\ctikzvalof{bipole/name}}
20066 \def\pgf@circ@temp{#2}
20067 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
20068 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
20069 \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
20070 \fi
20071 }
20072 \ifpgf@circuit@bipole@inverted
20073 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
20074 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
20075 \else
20076 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
20077 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
20078 \fi
20079 \pgfextra{
20080 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
20081 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
20082 \pgfmathadd{\pgfmathresult}{-90}
20083 \pgfmathround{\pgfmathresult}
20084 \edef\pgf@circ@direction{\pgfmathresult}
20085 }
20086 ($(\tikztostart) ! .5 ! (\tikztotarget)$)
20087 node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
20088 (\ctikzvalof{bipole/name}) {}
20089 node {\ctikzvalof{bipole/label/name}}
20090 \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
20091 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
20092 (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
20093 \else
20094 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
20095 (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
20096 \fi
20097 \drawpoles
20098 \pgfextra{
20099 \pgfcircresetpath
20100 }
20101 (\tikztotarget) \tikztonodes % e si continua
20102 }
20103
20104
20105 \def\pgf@circ@definetranspath#1{
20106 \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
20107 }
20108
20109 \pgf@circ@definetranspath{elmech}
20110 \pgf@circ@definetranspath{nmos}
20111 \pgf@circ@definetranspath{pmos}
20112 \pgf@circ@definetranspath{hemt}
20113 \pgf@circ@definetranspath{npn}
20114 \pgf@circ@definetranspath{pnp}
20115 \pgf@circ@definetranspath{nfet}
20116 \pgf@circ@definetranspath{nigfete}
20117 \pgf@circ@definetranspath{nigfetd}
20118 \pgf@circ@definetranspath{nigfetebulk}
20119 \pgf@circ@definetranspath{pfet}
20120 \pgf@circ@definetranspath{pigfete}
20121 \pgf@circ@definetranspath{pigfetd}
20122 \pgf@circ@definetranspath{pigfetebulk}
20123 \pgf@circ@definetranspath{njfet}
20124 \pgf@circ@definetranspath{pjfet}
20125 \pgf@circ@definetranspath{pigbt}
20126 \pgf@circ@definetranspath{nigbt}
20127 \pgf@circ@definetranspath{Lpigbt}
20128 \pgf@circ@definetranspath{Lnigbt}
20129 %%%---------- close: tex/pgfcircpath
20130
20131 \ifpgf@circ@siunitx
20132 \RequirePackage{xstring}[2009/03/13]
20133 %\expandafter\let\csname angstrom\endcsname\relax
20134 \RequirePackage{siunitx}
20135 \fi
20136
20137 \ifpgf@circ@explicitvdir\else
20138 \PackageWarningNoLine{circuitikz}{%
20139 You did not specify one of the voltage directions:\MessageBreak
20140 \space\space oldvoltagedirection, nooldvoltagedirection, \MessageBreak
20141 \space\space RPvoltages or EFvoltages \MessageBreak
20142 Default directions may have changed, \MessageBreak
20143 please check the manual%
20144 }
20145 \fi
20146
20147 \newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
20148 %override (unused) circuitikz environment for compability to externalization)
20149 \let\circuitikz\tikzpicture
20150 \let\endcircuitikz\endtikzpicture
20151
20152 \endinput