Debian Codegraph @

texmf-dist/tex/latex/circuitikz/circuitikz-0.9.6-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
14 \NeedsTeXFormat{LaTeX2e}
15
16 \def\pgfcircversion{0.9.6}
17 \def\pgfcircversiondate{2019/11/09}
18
19
20 %% Version 3.0 of pgf/TikZ is required
21 \RequirePackage{tikz}
22 \usetikzlibrary{calc}
23 %
24 % "arrows" library is deprecated, and behave badly with
25 % arrows on short paths. Change to the new arrows.meta
26 % In pfgcirc.define, we will add the old definition of
27 % latex' which we have lost in the transition
28 %
29 \usetikzlibrary{arrows.meta, bending}
30
31 % The options are listed in the manual in this order
32
33 \DeclareOption{europeanvoltage}{
34 \ctikzset{voltage=european}
35 }
36
37 \DeclareOption{straightvoltages}{
38 \pgf@circuit@bipole@voltage@straighttrue
39 }
40
41 \DeclareOption{americanvoltage}{
42 \ctikzset{voltage=american}
43 }
44
45 \DeclareOption{europeancurrent}{
46 \ctikzset{current = european}
47 }
48
49 \DeclareOption{americancurrent}{
50 \ctikzset{current = american}
51 }
52
53
54
55 \DeclareOption{americanresistor}{
56 \ctikzset{resistor = american}
57 }
58
59 \DeclareOption{europeanresistor}{
60 \ctikzset{resistor = european}
61 }
62
63 \DeclareOption{americaninductor}{
64 \ctikzset{inductor = american}
65 }
66
67 \DeclareOption{europeaninductor}{
68 \ctikzset{inductor = european}
69 }
70
71 \DeclareOption{cuteinductor}{
72 \ctikzset{inductor = cute}
73 }
74
75 \DeclareOption{americanport}{
76 \ctikzset{logic ports = american}
77 }
78
79 \DeclareOption{europeanport}{
80 \ctikzset{logic ports = european}
81 }
82
83 \DeclareOption{european}{
84 \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
85 \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
86 }
87
88 \DeclareOption{american}{
89 \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
90 \ctikzset{logic ports = american}
91 }
92
93 \DeclareOption{fulldiodes}{
94 \ctikzset{diode = full}
95 }
96
97 \DeclareOption{emptydiodes}{
98 \ctikzset{diode = empty}
99 }
100
101 \DeclareOption{europeanvoltages}{
102 \ctikzset{voltage=european}
103 }
104
105 \DeclareOption{americanvoltages}{
106 \ctikzset{voltage=american}
107 }
108
109 \DeclareOption{europeancurrents}{
110 \ctikzset{current = european}
111 }
112
113 \DeclareOption{americancurrents}{
114 \ctikzset{current = american}
115 }
116
117 \DeclareOption{americanresistors}{
118 \ctikzset{resistor = american}
119 }
120
121 \DeclareOption{europeanresistors}{
122 \ctikzset{resistor = european}
123 }
124
125 \DeclareOption{americaninductors}{
126 \ctikzset{inductor = american}
127 }
128
129 \DeclareOption{europeaninductors}{
130 \ctikzset{inductor = european}
131 }
132
133 \DeclareOption{cuteinductors}{
134 \ctikzset{inductor = cute}
135 }
136
137 \DeclareOption{americanports}{
138 \ctikzset{logic ports = american}
139 }
140
141 \DeclareOption{europeanports}{
142 \ctikzset{logic ports = european}
143 }
144
145 \DeclareOption{americangfsurgearrester}{
146 \ctikzset{gas filled surge arrester choice = american}
147 }
148
149 \DeclareOption{europeangfsurgearrester}{
150 \ctikzset{gas filled surge arrester choice = european}
151 }
152
153 \DeclareOption{siunitx}{
154 \pgf@circ@siunitxtrue
155 }
156
157 \DeclareOption{nosiunitx}{
158 \pgf@circ@siunitxfalse
159 }
160
161 \DeclareOption{fulldiode}{
162 \ctikzset{diode = full}
163 }
164
165 \DeclareOption{emptydiode}{
166 \ctikzset{diode = empty}
167 }
168
169 \DeclareOption{strokediode}{
170 \ctikzset{diode = stroke}
171 }
172
173 \DeclareOption{arrowmos}{
174 \pgf@circuit@mos@arrowstrue
175 }
176
177 \DeclareOption{noarrowmos}{
178 \pgf@circuit@mos@arrowsfalse
179 }
180
181 \DeclareOption{fetbodydiode}{
182 \pgf@circuit@fet@bodydiodetrue
183 }
184
185 \DeclareOption{nofetbodydiode}{
186 \pgf@circuit@fet@bodydiodefalse
187 }
188
189 \DeclareOption{fetsolderdot}{
190 \pgf@circuit@fet@solderdottrue
191 }
192
193 \DeclareOption{nofetsolderdot}{
194 \pgf@circuit@fet@solderdotfalse
195 }
196
197 \DeclareOption{emptypmoscircle}{
198 \pgf@circuit@pmos@emptycircletrue
199 }
200
201
202 \DeclareOption{lazymos}{
203 \ctikzset{tripoles/nmos/width=.5}
204 \ctikzset{tripoles/nmos/gate height=.35}
205 \ctikzset{tripoles/nmos/base height=.35}
206 \ctikzset{tripoles/nmos/height/.initial=1.2}
207 \ctikzset{tripoles/nmos/base width=.5}
208 \ctikzset{tripoles/nmos/gate width=.65}
209
210 \ctikzset{tripoles/pmos/width=.5}
211 \ctikzset{tripoles/pmos/gate height=.35}
212 \ctikzset{tripoles/pmos/base height=.35}
213 \ctikzset{tripoles/pmos/height/.initial=1.2}
214 \ctikzset{tripoles/pmos/base width=.5}
215 \ctikzset{tripoles/pmos/gate width=.65}
216
217 \pgf@circuit@pmos@emptycircletrue
218 }
219
220 \DeclareOption{straightlabels}{
221 \ctikzset{label/align = straight}
222 }
223
224 \DeclareOption{rotatelabels}{
225 \ctikzset{label/align = rotate}
226 }
227
228 \DeclareOption{smartlabels}{
229 \ctikzset{label/align = smart}
230 }
231
232 \DeclareOption{compatibility}{
233 \pgf@circuit@compattrue
234 }
235
236 \DeclareOption{oldvoltagedirection}{
237 \pgf@circ@oldvoltagedirectiontrue
238 \pgf@circ@explicitvdirtrue
239 \pgf@circ@fixbatteriesfalse
240 }
241 \DeclareOption{nooldvoltagedirection}{
242 \pgf@circ@oldvoltagedirectionfalse
243 \pgf@circ@explicitvdirtrue
244 \pgf@circ@fixbatteriesfalse
245 }
246
247 \DeclareOption{RPvoltages}{
248 \pgf@circ@oldvoltagedirectiontrue
249 \pgf@circ@explicitvdirtrue
250 \pgf@circ@fixbatteriestrue
251 }
252 \DeclareOption{EFvoltages}{
253 \pgf@circ@oldvoltagedirectionfalse
254 \pgf@circ@explicitvdirtrue
255 \pgf@circ@fixbatteriestrue
256 }
257
258
259 \DeclareOption{betterproportions}{
260 \ctikzset{monopoles/ground/width/.initial=.15}
261
262 \ctikzset{bipoles/resistor/height/.initial=.23}
263 \ctikzset{bipoles/resistor/width/.initial=.6}
264 \ctikzset{bipoles/capacitor/height/.initial=.4}
265 \ctikzset{bipoles/capacitor/width/.initial=.1}
266 \ctikzset{bipoles/potentiometer/height/.initial=.6}
267 \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
268 \ctikzset{bipoles/potentiometer/width/.initial=.6}
269 \ctikzset{bipoles/photoresistor/height/.initial=.6}
270 \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
271 \ctikzset{bipoles/photoresistor/width/.initial=.6}
272 \ctikzset{bipoles/thermistor/main/.initial=.7}
273 \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
274 \ctikzset{bipoles/thermistor/width/.initial=.6}
275 \ctikzset{bipoles/thermistorntc/width/.initial=.6}
276 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
277 \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
278 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
279 \ctikzset{bipoles/thermistorptc/width/.initial=.6}
280 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
281 \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
282 \ctikzset{bipoles/varistor/main/.initial=.7}
283 \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
284 \ctikzset{bipoles/varistor/width/.initial=.6}
285 \ctikzset{bipoles/vresistor/height/.initial=.45}
286 \ctikzset{bipoles/vresistor/width/.initial=.6}
287 \ctikzset{bipoles/generic/height/.initial=.23}
288 \ctikzset{bipoles/generic/width/.initial=.6}
289 \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
290 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
291 \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
292 \ctikzset{bipoles/ageneric/height/.initial=.23}
293 \ctikzset{bipoles/ageneric/width/.initial=.6}
294 \ctikzset{bipoles/memristor/height/.initial=.23}
295 \ctikzset{bipoles/memristor/wave height/.initial=.375}
296 \ctikzset{bipoles/memristor/width/.initial=.60}
297 \ctikzset{bipoles/tgeneric/height/.initial=.525}
298 \ctikzset{bipoles/tgeneric/width/.initial=.6}
299 \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
300 \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
301 \ctikzset{bipoles/fullgeneric/height/.initial=.23}
302 \ctikzset{bipoles/fullgeneric/width/.initial=.6}
303 \ctikzset{bipoles/diode/height/.initial=.3}
304 \ctikzset{bipoles/diode/width/.initial=.25}
305 \ctikzset{bipoles/bidirectionaldiode/height/.initial=.66}
306 \ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
307 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
308 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
309
310 \ctikzset{tripoles/thyristor/height/.initial=.66}
311 \ctikzset{tripoles/thyristor/height 2/.initial=.3}
312 \ctikzset{tripoles/thyristor/width/.initial=.6}
313 \ctikzset{tripoles/thyristor/diode height/.initial=.3}
314 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
315 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
316
317 \ctikzset{tripoles/triac/height/.initial=.66}
318 \ctikzset{tripoles/triac/width/.initial=.6}
319 \ctikzset{tripoles/triac/diode width left/.initial=.3}
320 \ctikzset{tripoles/triac/diode width right/.initial=.3}
321 }
322
323 % This is a nice hack that prints all the shapes declared
324 % by the package. Very useful for coverage testing and debugging.
325 %
326 % \let\origpgfdeclareshape=\pgfdeclareshape
327 % \def\pgfdeclareshape#1{%
328 % \typeout{SHAPE:\space"#1"}%
329 % \origpgfdeclareshape{#1}
330 % }
331
332
333 %%%%%%%%%
334 %%%%%%%%%%% Springe nach tex/pgfcirc.defines
335 %%%---------- open: tex/pgfcirc.defines.tex
336 %% Key managements
337
338 \long\def\pgf@circ@comment#1{}
339
340 \def\circuitikzbasekey{/tikz/circuitikz}
341
342 \pgfkeys{\circuitikzbasekey/.is family}
343
344 \def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
345 \let\ctikzset\circuitikzset
346 \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
347 \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
348
349 %% Temporary Counters
350
351 \newcount\pgf@circ@count@a
352 \newcount\pgf@circ@count@b
353 \newcount\pgf@circ@count@c
354 %%%%%%%%%%%%
355 %% Dimensions
356
357 % coordinates
358 \newdimen\pgf@circ@res@up
359 \newdimen\pgf@circ@res@down
360 \newdimen\pgf@circ@res@zero
361 \newdimen\pgf@circ@res@left
362 \newdimen\pgf@circ@res@right
363 \newdimen\pgf@circ@res@other
364 \newdimen\pgf@circ@res@step
365 \newdimen\pgf@circ@res@temp
366 % inital thickness
367 \newdimen \pgfstartlinewidth
368
369 % arrow tips, ported over old arrows library (deprecated)
370 % see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
371 % this was the original definition of latex' tips, renamed to avoid clashes
372 %
373 \pgfarrowsdeclare{latexslim}{latexslim}
374 {
375 \pgfutil@tempdima=0.28pt%
376 \advance\pgfutil@tempdima by.3\pgflinewidth%
377 \pgfarrowsleftextend{+-4\pgfutil@tempdima}
378 \pgfarrowsrightextend{+6\pgfutil@tempdima}
379 }
380 {
381 \pgfutil@tempdima=0.28pt%
382 \advance\pgfutil@tempdima by.3\pgflinewidth%
383 \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
384 \pgfpathcurveto
385 {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
386 {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
387 {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
388 \pgfpathcurveto
389 {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
390 {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
391 {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
392 \pgfpathcurveto
393 {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
394 {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
395 {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
396 \pgfpathclose
397 \pgfusepathqfill
398 }
399
400 \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
401
402 \def\pgf@circ@setifdefinedfill#1#2{%
403 % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
404 % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
405 \ifdefined\ctikzclass
406 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
407 {% yes, it's defined
408 \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
409 \ifx\@@tmp\@@none % but it's none
410 \pgfusepath{#2}%
411 \else
412 \pgfsetfillcolor{\@@tmp}%
413 \pgfusepath{#1}%
414 \fi
415 }{% the class is defined but the fill key not; use #2
416 \pgfusepath{#2}%
417 }
418 \else
419 \pgfusepath{#2}%
420 \fi
421 }
422
423 %% Macro to fill or draw
424
425 \def\pgf@circ@draworfill{%
426 \ifx\tikz@fillcolor\pgfutil@empty
427 \pgf@circ@setifdefinedfill{draw,fill}{draw}
428 \else
429 \pgfsetfillcolor{\tikz@fillcolor}
430 \pgfusepath{draw, fill}
431 \fi
432 }
433
434 \def\pgf@circ@draworfillandclip{%
435 \ifx\tikz@fillcolor\pgfutil@empty
436 \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
437 \pgfusepath{draw, clip}
438 \else
439 \pgfsetfillcolor{\tikz@fillcolor}
440 \pgfusepath{draw, clip, fill}
441 \fi
442 }
443
444 \def\pgf@circ@maybefill{%
445 \ifx\tikz@fillcolor\pgfutil@empty
446 \pgf@circ@setifdefinedfill{fill}{discard}
447 \else
448 \pgfsetfillcolor{\tikz@fillcolor}
449 \pgfusepath{fill}
450 \fi
451 }
452
453 %% Macros for setting linewidth
454 % #1 is the legacy class (bipoles, tripoles) etc
455 % #2 is the reference linewidth
456 \def\pgf@circ@setlinewidth#1#2{%
457 \ifdefined\ctikzclass
458 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
459 {% yes, it's defined
460 \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
461 \ifx\@@tmp\@@none % but it's none
462 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
463 \else
464 \pgfsetlinewidth{\@@tmp #2}%
465 \fi
466 }{ % key not defined, do the legacy thing
467 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
468 }% Ok, do nothing
469 \else % no class
470 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
471 \fi
472 }
473 % use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
474 \ctikzset{none/thickness/.initial=1.0} % do not touch
475
476 %% font changes compatible with plain/LaTeX/ConTeXt
477 %% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605
478
479 \ifpgfutil@format@is@latex
480 \long\def\pgf@circ@font@tiny{\tiny}
481 \long\def\pgf@circ@font@small{\small}
482 \long\def\pgf@circ@font@bold{\textbf}
483 \long\def\pgf@circ@font@boldmath{\boldmath}
484 \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath}
485 \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath}
486 \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont}
487 \else\ifpgfutil@format@is@plain
488 \long\def\pgf@circ@font@tiny{\fiverm}
489 \long\def\pgf@circ@font@small{\sevenrm}
490 \long\def\pgf@circ@font@bold#1{{\bf#1}}
491 \long\def\pgf@circ@font@boldmath{\bf} % to be tested
492 \long\def\pgf@circ@font@sixbm{\sevenrm\bf} %
493 \long\def\pgf@circ@font@tenbm{\tenrm\bf} %
494 \long\def\pgf@circ@font@twelve{\twelverm} %
495 \else\ifpgfutil@format@is@context
496 \long\def\pgf@circ@font@tiny{\tfxx}
497 \long\def\pgf@circ@font@small{\tfx}
498 \long\def\pgf@circ@font@bold{\bold}
499 \long\def\pgf@circ@font@boldmath{\bold} % to be tested
500 \long\def\pgf@circ@font@sixbm{\tfx\bold} %
501 \long\def\pgf@circ@font@tenbm{\normal\bold}%
502 \long\def\pgf@circ@font@twelve{\tfa} %
503 \fi\fi\fi
504
505
506 % voltage options
507
508 \newif\ifpgf@circ@siunitx
509 \newif\ifpgf@circuit@compat
510 \newif\ifpgf@circ@oldvoltagedirection % default false
511 \newif\ifpgf@circ@explicitvdir
512 \newif\ifpgf@circ@fixbatteries
513
514 \ctikzset{voltage dir/.is choice}
515 \ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
516 \ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
517 \ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
518 \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
519 \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
520
521 % Option ">" for twoports
522 \newif\ifpgf@circuit@inputarrow
523 \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
524 \ctikzset{inputarrow/.is choice}
525 \ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
526 \ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
527
528 % Option "boxed" for nodes and twoports
529 \newif\ifpgf@circuit@boxed
530 \pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
531 \ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
532 \pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
533 \ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
534
535 % Option "dashed" for nodes and twoports
536 \newif\ifpgf@circuit@dashed
537 \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
538 \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
539
540 % Option "t=*" for nodes
541 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
542
543 \ctikzset{current arrow scale/.initial=16}
544
545 \ctikzset{bipoles/.is family}
546 \ctikzset{bipoles/border margin/.initial=1.1}
547 \ctikzset{bipoles/thickness/.initial=2}
548 \ctikzset{tripoles/thickness/.initial=2}
549 \ctikzset{quadpoles/thickness/.initial=2}
550 \ctikzset{nodes width/.initial=.04}
551
552 % Base len for all circuitikz
553 \newdimen\pgf@circ@Rlen
554 % scaled length for internal use in scalable shapes
555 \newdimen\pgf@circ@scaled@Rlen
556 \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}}
557 \pgf@circ@Rlen = 1.4cm
558 % by default scale is 1.0
559 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
560
561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
562 %% main style definitions
563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
564
565
566
567 % load a style file: search ctikzstyle-NAME.tex in path
568 \def\ctikzloadstyle#1{%
569 \edef\pgf@temp{#1}%
570 % guard against re-loading
571 \expandafter\ifx\csname pgf@circ@style@\pgf@temp @loaded\endcsname\relax%
572 \expandafter\global\expandafter\let\csname pgf@circ@style@\pgf@temp @loaded\endcsname=\pgfutil@empty
573 \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{%
574 \tikzerror{I did not find the circuitikz style #1}}%
575 \fi
576 }
577
578 % load and enact a style
579 \def\ctikzsetstyle#1{%
580 \ctikzloadstyle{#1}%
581 \tikzset{#1 circuit style}%
582 }
583
584 % global style parameters
585 \ctikzset{default/scale/.initial=1.0} % do not touch
586 \ctikzset{default/fill/.initial=none} % do not touch
587 \ctikzset{default/thickness/.initial=none} % do not touch
588 % default is use as the generic default style for bipoles
589
590 % mostly bipoles:
591
592 \ctikzset{resistors/scale/.initial=1.0}
593 \ctikzset{resistors/fill/.initial=none}
594 \ctikzset{resistors/thickness/.initial=none}
595
596 \ctikzset{capacitors/scale/.initial=1.0}
597 \ctikzset{capacitors/fill/.initial=none}
598 \ctikzset{capacitors/thickness/.initial=none}
599
600 \ctikzset{inductors/scale/.initial=1.0}
601 \ctikzset{inductors/fill/.initial=none}
602 \ctikzset{inductors/thickness/.initial=none}
603
604 \ctikzset{diodes/scale/.initial=1.0}
605 \ctikzset{diodes/fill/.initial=none}
606 \ctikzset{diodes/thickness/.initial=none}
607
608 \ctikzset{batteries/scale/.initial=1.0}
609 \ctikzset{batteries/fill/.initial=none}
610 \ctikzset{batteries/thickness/.initial=none}
611
612 \ctikzset{sources/scale/.initial=1.0}
613 \ctikzset{sources/fill/.initial=none}
614 \ctikzset{sources/thickness/.initial=none}
615
616 \ctikzset{csources/scale/.initial=1.0}
617 \ctikzset{csources/fill/.initial=none}
618 \ctikzset{csources/thickness/.initial=none}
619
620 \ctikzset{instruments/scale/.initial=1.0}
621 \ctikzset{instruments/fill/.initial=none}
622 \ctikzset{instruments/thickness/.initial=none}
623
624 \ctikzset{mechanicals/scale/.initial=1.0}
625 \ctikzset{mechanicals/fill/.initial=none}
626 \ctikzset{mechanicals/thickness/.initial=none}
627
628 \ctikzset{misc/scale/.initial=1.0}
629 \ctikzset{misc/fill/.initial=none}
630 \ctikzset{misc/thickness/.initial=none}
631
632 \ctikzset{blocks/scale/.initial=1.0}
633 \ctikzset{blocks/fill/.initial=none}
634 \ctikzset{blocks/thickness/.initial=none}
635
636 % mostly nodes
637
638 \ctikzset{grounds/scale/.initial=1.0}
639 \ctikzset{grounds/fill/.initial=none}
640 \ctikzset{grounds/thickness/.initial=none}
641
642 \ctikzset{power supplies/scale/.initial=1.0}
643 \ctikzset{power supplies/fill/.initial=none}
644 \ctikzset{power supplies/thickness/.initial=none}
645
646 \ctikzset{transistors/scale/.initial=1.0}
647 \ctikzset{transistors/fill/.initial=none}
648 \ctikzset{transistors/thickness/.initial=none}
649
650 \ctikzset{tubes/scale/.initial=1.0}
651 \ctikzset{tubes/fill/.initial=none}
652 \ctikzset{tubes/thickness/.initial=none}
653
654 \ctikzset{RF/scale/.initial=1.0}
655 \ctikzset{RF/fill/.initial=none}
656 \ctikzset{RF/thickness/.initial=none}
657
658 \ctikzset{electromechanicals/scale/.initial=1.0}
659 \ctikzset{electromechanicals/fill/.initial=none}
660 \ctikzset{electromechanicals/thickness/.initial=none}
661
662 % transformers go with inductors
663 \ctikzset{amplifiers/scale/.initial=1.0}
664 \ctikzset{amplifiers/fill/.initial=none}
665 \ctikzset{amplifiers/thickness/.initial=none}
666
667 \ctikzset{switches/scale/.initial=1.0}
668 \ctikzset{switches/fill/.initial=none}
669 \ctikzset{switches/thickness/.initial=none}
670
671 \ctikzset{logic ports/scale/.initial=1.0}
672 \ctikzset{logic ports/fill/.initial=none}
673 \ctikzset{logic ports/thickness/.initial=none}
674
675 \ctikzset{chips/scale/.initial=1.0}
676 \ctikzset{chips/fill/.initial=none}
677 \ctikzset{chips/thickness/.initial=none}
678
679 \ctikzset{displays/scale/.initial=1.0}
680 \ctikzset{displays/fill/.initial=none}
681 \ctikzset{displays/thickness/.initial=none}
682
683 % grounds and power supplies
684
685 \ctikzset{monopoles/.is family}
686 \ctikzset{monopoles/ground/width/.initial=.25}
687 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
688 \ctikzset{monopoles/ground/thickness/.initial=2}
689 \ctikzset{monopoles/rground/thickness/.initial=2}
690 \ctikzset{monopoles/tground/thickness/.initial=3}
691 \ctikzset{monopoles/vcc/width/.initial=.2}
692 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
693 \ctikzset{monopoles/vee/arrow/.initial=legacy}
694 \ctikzset{monopoles/match/width/.initial=.4}
695 \ctikzset{monopoles/chassis/width/.initial=.25}
696 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
697 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
698 \ctikzset{monopoles/antenna/width/.initial=.25}
699 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
700 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
701 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
702 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
703 \ctikzset{monopoles/txantenna/width/.initial=.25}
704 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
705 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
706 \ctikzset{monopoles/rxantenna/width/.initial=.25}
707 \ctikzset{monopoles/bareantenna/width/.initial=.25}
708 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
709 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
710 \ctikzset{monopoles/waves/width/.initial=0.5}
711
712 % microstrips
713 \ctikzset{bipoles/mstline/height/.initial=0.3}
714 \ctikzset{bipoles/mstline/width/.initial=1.2}
715 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
716 \ctikzset{monopoles/msport/width/.initial=.5}
717 \ctikzset{monopoles/msrstub/height/.initial=1.0}
718 \ctikzset{monopoles/msrstub/width/.initial=0.6}
719
720 % microphone and loudspeaker
721 \ctikzset{bipoles/loudspeaker/height/.initial=.8}
722 \ctikzset{bipoles/loudspeaker/depth/.initial=.3}
723 \ctikzset{bipoles/loudspeaker/width/.initial=.8}
724 \ctikzset{bipoles/mic/height/.initial=1.2}
725 \ctikzset{bipoles/mic/depth/.initial=.0}
726 \ctikzset{bipoles/mic/width/.initial=.8}
727
728 % Zig Zag resistors
729 \ctikzset{resistors/zigs/.initial=3}
730 \ctikzset{resistors/width/.code={%
731 \ctikzset{bipoles/resistor/width=#1}%
732 \ctikzset{bipoles/vresistor/width=#1}%
733 \ctikzset{bipoles/potentiometer/width=#1}%
734 \ctikzset{bipoles/resistivesens/width=#1}%
735 \ctikzset{bipoles/photoresistor/width=#1}%
736 \ctikzset{bipoles/thermistor/width=#1}%
737 \ctikzset{bipoles/thermistorntc/width=#1}%
738 \ctikzset{bipoles/thermistorptc/width=#1}%
739 \ctikzset{bipoles/varistor/width=#1}%
740 \ctikzset{bipoles/generic/width=#1}%
741 \ctikzset{bipoles/generic potentiometer/width=#1}%
742 \ctikzset{bipoles/ageneric/width=#1}%
743 \ctikzset{bipoles/tgeneric/width=#1}%
744 }}
745 \ctikzset{wiper pos/.code={%
746 \ctikzset{bipoles/potentiometer/wiper pos=#1}%
747 \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
748 }}
749 % zigzag resistor
750 \ctikzset{bipoles/resistor/height/.initial=.3}
751 \ctikzset{bipoles/resistor/width/.initial=.8}
752 \ctikzset{bipoles/potentiometer/height/.initial=.8}
753 \ctikzset{bipoles/potentiometer/height 2/.initial=.3}
754 \ctikzset{bipoles/potentiometer/width/.initial=.8}
755 \ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
756 \ctikzset{bipoles/vresistor/height/.initial=.6}
757 \ctikzset{bipoles/vresistor/width/.initial=.8}
758 \ctikzset{bipoles/resistivesens/height/.initial=.6}
759 \ctikzset{bipoles/resistivesens/width/.initial=.8}
760 % square resistors
761 \ctikzset{bipoles/photoresistor/height/.initial=.6}
762 \ctikzset{bipoles/photoresistor/height 2/.initial=.3}
763 \ctikzset{bipoles/photoresistor/width/.initial=.8}
764 \ctikzset{bipoles/thermistor/main/.initial=.7}
765 \ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
766 \ctikzset{bipoles/thermistorntc/width/.initial=.8}
767 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
768 \ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
769 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
770 \ctikzset{bipoles/thermistorptc/width/.initial=.8}
771 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
772 \ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
773 \ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
774 \ctikzset{bipoles/thermistor/width/.initial=.8}
775 \ctikzset{bipoles/varistor/main/.initial=.7}
776 \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
777 \ctikzset{bipoles/varistor/width/.initial=.8}
778 \ctikzset{bipoles/generic/height/.initial=.30}
779 \ctikzset{bipoles/generic/width/.initial=.80}
780 \ctikzset{bipoles/generic potentiometer/height/.initial=.80}
781 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
782 \ctikzset{bipoles/generic potentiometer/width/.initial=.80}
783 \ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
784 \ctikzset{bipoles/ageneric/height/.initial=.30}
785 \ctikzset{bipoles/tgeneric/height/.initial=.70}
786 \ctikzset{bipoles/tgeneric/width/.initial=.80}
787 \ctikzset{bipoles/ageneric/width/.initial=.80}
788
789 %% Capacitors
790 \ctikzset{bipoles/capacitor/height/.initial=.6}
791 \ctikzset{bipoles/capacitor/width/.initial=.2}
792 \ctikzset{bipoles/ecapacitor/height/.initial=.5}
793 \ctikzset{bipoles/ecapacitor/width/.initial=.2}
794 \ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm}
795 %%% pcapacitor is deprecated
796 \ctikzset{bipoles/pcapacitor/height/.initial=.6}
797 \ctikzset{bipoles/pcapacitor/width/.initial=.2}
798 \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
799 \ctikzset{bipoles/ccapacitor/height/.initial=.6}
800 \ctikzset{bipoles/ccapacitor/width/.initial=.12}
801 \ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
802 \ctikzset{bipoles/vcapacitor/height/.initial=.6}
803 \ctikzset{bipoles/vcapacitor/width/.initial=.5}
804 \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
805 \ctikzset{bipoles/piezoelectric/height/.initial=.7}
806 \ctikzset{bipoles/piezoelectric/width/.initial=.5}
807
808 % Inductors
809 \ctikzset{inductors/coils/.code={%
810 \ctikzset{bipoles/cuteinductor/coils=#1}%
811 \ctikzset{bipoles/cutechoke/coils=#1}%
812 \ctikzset{bipoles/americaninductor/coils=#1}%
813 \ctikzset{bipoles/vcuteinductor/coils=#1}%
814 \ctikzset{bipoles/vamericaninductor/coils=#1}%
815 }}
816 \ctikzset{inductors/width/.code={%
817 \ctikzset{bipoles/cuteinductor/width=#1}%
818 \ctikzset{bipoles/cutechoke/width=#1}%
819 \ctikzset{bipoles/americaninductor/width=#1}%
820 \ctikzset{bipoles/vcuteinductor/width=#1}%
821 \ctikzset{bipoles/vamericaninductor/width=#1}%
822 \ctikzset{bipoles/fullgeneric/width=#1}%
823 \ctikzset{bipoles/tfullgeneric/width=#1}%
824 }}
825 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
826 \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
827 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
828 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
829 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
830 %% Cute choke settings
831 \ctikzset{bipoles/cutechoke/height/.initial=.3}
832 \ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
833 \ctikzset{bipoles/cutechoke/width/.initial=.6}
834 \ctikzset{bipoles/cutechoke/coils/.initial=5}
835 \ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
836 \ctikzset{bipoles/cutechoke/cstep/.initial=.3}
837 \ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
838 \ctikzset{bipoles/cutechoke/cthick/.initial=1}
839 \newif\ifpgf@circuit@bipole@twolineschoke
840 \pgf@circuit@bipole@twolineschokefalse
841 \pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
842 \ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
843 \pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
844 \ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
845 %
846 \ctikzset{bipoles/americaninductor/height/.initial=.3}
847 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
848 \ctikzset{bipoles/americaninductor/width/.initial=.8}
849 \ctikzset{bipoles/americaninductor/coils/.initial=4}
850 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
851 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
852 \ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
853 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
854 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
855 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
856 \ctikzset{bipoles/vamericaninductor/height/.initial=.6}
857 \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
858 \ctikzset{bipoles/vamericaninductor/width/.initial=.8}
859 \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
860 \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
861 \ctikzset{bipoles/tfullgeneric/height/.initial=.70}
862 \ctikzset{bipoles/tfullgeneric/width/.initial=.80}
863 \ctikzset{bipoles/fullgeneric/height/.initial=.30}
864 \ctikzset{bipoles/fullgeneric/width/.initial=.80}
865
866 % Sources
867
868 \ctikzset{bipoles/esource/height/.initial=.60}
869 \ctikzset{bipoles/esource/width/.initial=.60}
870 \ctikzset{bipoles/pvsource/height/.initial=.60}
871 \ctikzset{bipoles/pvsource/width/.initial=.60}
872 \ctikzset{bipoles/isource/height/.initial=.60}
873 \ctikzset{bipoles/isource/width/.initial=.60}
874 \ctikzset{bipoles/oosource/height/.initial=.60}
875 \ctikzset{bipoles/oosource/width/.initial=.60}
876 \ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
877 \ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
878 \ctikzset{bipoles/dcisource/angle/.initial=80}
879 \ctikzset{bipoles/dcisource/height/.initial=.60}
880 \ctikzset{bipoles/dcisource/width/.initial=.60}
881 \ctikzset{bipoles/dcvsource/height/.initial=.60}
882 \ctikzset{bipoles/dcvsource/width/.initial=.60}
883 \ctikzset{bipoles/vsourcetri/height/.initial=.60}
884 \ctikzset{bipoles/vsourcetri/width/.initial=.60}
885 \ctikzset{bipoles/isourceam/height/.initial=.60}
886 \ctikzset{bipoles/isourceam/width/.initial=.60}
887 \ctikzset{bipoles/vsource/height/.initial=.60}
888 \ctikzset{bipoles/vsource/width/.initial=.60}
889 \ctikzset{bipoles/vsourceam/height/.initial=.60}
890 \ctikzset{bipoles/vsourceam/width/.initial=.60}
891 \ctikzset{bipoles/vsourceam/margin/.initial=.7}
892 \ctikzset{bipoles/isourcesin/height/.initial=.60}
893 \ctikzset{bipoles/isourcesin/width/.initial=.60}
894 \ctikzset{bipoles/vsourcesin/height/.initial=.60}
895 \ctikzset{bipoles/vsourcesin/width/.initial=.60}
896 \ctikzset{bipoles/vsourcesquare/height/.initial=.60}
897 \ctikzset{bipoles/vsourcesquare/width/.initial=.60}
898 \ctikzset{bipoles/cisource/height/.initial=.7}
899 \ctikzset{bipoles/cisource/width/.initial=.7}
900 \ctikzset{bipoles/cisourceam/height/.initial=.7}
901 \ctikzset{bipoles/cisourceam/width/.initial=.7}
902 \ctikzset{bipoles/ecsource/height/.initial=.7}
903 \ctikzset{bipoles/ecsource/width/.initial=.7}
904 \ctikzset{bipoles/cvsource/height/.initial=.7}
905 \ctikzset{bipoles/cvsource/width/.initial=.7}
906 \ctikzset{bipoles/cvsourceam/height/.initial=.7}
907 \ctikzset{bipoles/cvsourceam/width/.initial=.7}
908 \ctikzset{bipoles/cvsourceam/margin/.initial=.7}
909 \ctikzset{bipoles/cvsourceam/text scale/.initial=1}
910 \ctikzset{bipoles/cisourcesin/width/.initial=.7}
911 \ctikzset{bipoles/cvsourcesin/height/.initial=.7}
912 \ctikzset{bipoles/cvsourcesin/width/.initial=.7}
913 \ctikzset{bipoles/battery/height/.initial=.6}
914 \ctikzset{bipoles/battery/width/.initial=.3}
915 \ctikzset{bipoles/battery1/height/.initial=.6}
916 \ctikzset{bipoles/battery1/width/.initial=.3}
917 \ctikzset{bipoles/battery2/height/.initial=.6}
918 \ctikzset{bipoles/battery2/width/.initial=.3}
919
920 % diodes
921
922 \ctikzset{bipoles/diode/height/.initial=.50}
923 \ctikzset{bipoles/diode/width/.initial=.40}
924 \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
925 \ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
926 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
927 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
928 \ctikzset{bipoles/varcap/height/.initial=.50}
929 \ctikzset{bipoles/varcap/width/.initial=.45}
930
931 % switches
932
933 \ctikzset{bipoles/spst/height/.initial=.35}
934 \ctikzset{bipoles/spst/width/.initial=.35}
935 \ctikzset{bipoles/spst/depth/.initial=.2}
936 \ctikzset{bipoles/nos/height/.initial=.3}
937 \ctikzset{bipoles/nos/width/.initial=.35}
938 \ctikzset{bipoles/nos/depth/.initial=.2}
939 \ctikzset{bipoles/ncs/height/.initial=.35}
940 \ctikzset{bipoles/ncs/width/.initial=.35}
941 \ctikzset{bipoles/ncs/depth/.initial=.2}
942
943 % misc
944
945 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
946 \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
947 \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
948 \ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
949 \ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
950 \ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
951 \ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
952 \ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
953 \ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
954 \ctikzset{bipoles/fuse/height/.initial=.20}
955 \ctikzset{bipoles/fuse/width/.initial=.50}
956 \ctikzset{bipoles/afuse/height/.initial=.20}
957 \ctikzset{bipoles/afuse/width/.initial=.50}
958 \ctikzset{bipoles/memristor/height/.initial=.30}
959 \ctikzset{bipoles/memristor/wave height/.initial=.5}
960 \ctikzset{bipoles/memristor/width/.initial=.80}
961 \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
962 \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
963 \ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
964 \ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
965 \ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
966 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
967 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
968 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
969 \ctikzset{bipoles/ammeter/height/.initial=.60}
970 \ctikzset{bipoles/ammeter/width/.initial=.60}
971 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
972 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
973 \ctikzset{bipoles/voltmeter/height/.initial=.60}
974 \ctikzset{bipoles/voltmeter/width/.initial=.60}
975 \ctikzset{bipoles/smeter/height/.initial=.60}
976 \ctikzset{bipoles/smeter/width/.initial=.60}
977 \ctikzset{bipoles/qmeter/depth/.initial=.40}
978 \ctikzset{bipoles/qmeter/height/.initial=.80}
979 \ctikzset{bipoles/qmeter/width/.initial=.60}
980 \ctikzset{bipoles/iloop/width/.initial=.40}
981 \ctikzset{bipoles/iloop/height/.initial=.60}
982 \ctikzset{bipoles/oscope/height/.initial=.60}
983 \ctikzset{bipoles/oscope/width/.initial=.60}
984 \ctikzset{bipoles/buffer/height/.initial=1}
985 \ctikzset{bipoles/buffer/width/.initial=1}
986 \ctikzset{bipoles/not port/width/.initial=1}
987 \ctikzset{bipoles/not port/height/.initial=.8}
988 \ctikzset{bipoles/not port/circle width/.initial=.15}
989 \ctikzset{bipoles/lamp/height/.initial=.60}
990 \ctikzset{bipoles/lamp/width/.initial=.60}
991 \ctikzset{bipoles/bulb/height/.initial=.8}
992 \ctikzset{bipoles/bulb/width/.initial=.8}
993 \ctikzset{bipoles/tline/height/.initial=.3}
994 \ctikzset{bipoles/tline/width/.initial=.8}
995 \ctikzset{bipoles/squid/height/.initial=.60}
996 \ctikzset{bipoles/squid/width/.initial=.60}
997 \ctikzset{bipoles/barrier/height/.initial=.60}
998 \ctikzset{bipoles/barrier/width/.initial=.60}
999 \ctikzset{bipoles/thermocouple/height/.initial=.250}
1000 \ctikzset{bipoles/thermocouple/height 2/.initial=.60}
1001 \ctikzset{bipoles/thermocouple/width/.initial=.140}
1002 \ctikzset{bipoles/pushbutton/height/.initial=.5}
1003 \ctikzset{bipoles/pushbutton/height 2/.initial=.2}
1004 \ctikzset{bipoles/pushbutton/width/.initial=.50}
1005
1006 \ctikzset{bipoles/twoport/width/.initial=.7}
1007 \ctikzset{bipoles/twoport/height/.initial=.7}
1008 \ctikzset{bipoles/twoport/text/.initial=}
1009 \ctikzset{bipoles/vco/width/.initial=.7}
1010 \ctikzset{bipoles/bandpass/width/.initial=.7}
1011 \ctikzset{bipoles/bandstop/width/.initial=.7}
1012 \ctikzset{bipoles/highpass/width/.initial=.7}
1013 \ctikzset{bipoles/lowpass/width/.initial=.7}
1014 \ctikzset{bipoles/adc/width/.initial=.7}
1015 \ctikzset{bipoles/dac/width/.initial=.7}
1016 \ctikzset{bipoles/dsp/width/.initial=.7}
1017 \ctikzset{bipoles/fft/width/.initial=.7}
1018 \ctikzset{bipoles/amp/width/.initial=.7}
1019 \ctikzset{bipoles/vamp/width/.initial=.7}
1020 \ctikzset{bipoles/piattenuator/width/.initial=.7}
1021 \ctikzset{bipoles/vpiattenuator/width/.initial=.7}
1022 \ctikzset{bipoles/tattenuator/width/.initial=.7}
1023 \ctikzset{bipoles/vtattenuator/width/.initial=.7}
1024 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
1025 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
1026 \ctikzset{bipoles/detector/width/.initial=.7}
1027
1028 % crossing wires
1029 \ctikzset{bipoles/crossing/size/.initial=.2}
1030
1031 % Transistors starts here
1032
1033 \newif\ifpgf@circuit@trans@depletiontype
1034 \pgf@circuit@trans@depletiontypefalse
1035
1036 \newif\ifpgf@circuit@mos@arrows
1037 \ctikzset{tripoles/mos style/.is choice}
1038 \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
1039 \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
1040 \pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
1041 \pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
1042
1043 % Option solderdot for fet
1044 \newif\ifpgf@circuit@fet@solderdot
1045 \pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
1046 \ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
1047 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
1048 \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
1049
1050 % Option bodydiode for fet
1051 \newif\ifpgf@circuit@fet@bodydiode
1052 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
1053 \ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
1054 \pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
1055 \ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
1056
1057 % Option draw fet without gate connection
1058 \newif\ifpgf@circuit@bpt@drawgate
1059 \pgf@circuit@bpt@drawgatetrue
1060 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1061 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1062 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1063 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
1064
1065 % Option draw bpt without base connection
1066 \newif\ifpgf@circuit@bpt@drawbase
1067 \pgf@circuit@bpt@drawbasetrue
1068 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1069 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1070 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1071 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
1072
1073 % Option draw bpt with optical input
1074 \newif\ifpgf@circuit@bpt@drawphoto
1075 \pgf@circuit@bpt@drawphotofalse
1076 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1077 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1078 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1079 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
1080
1081 % Option draw fet without bulk connection -- Added by Burak Kelleci
1082 \newif\ifpgf@circuit@bpt@drawbulk
1083 \pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
1084 \ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
1085 \pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
1086 \ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
1087
1088 % Option draw pmos with empty circle
1089 \newif\ifpgf@circuit@pmos@emptycircle
1090 \pgf@circuit@pmos@emptycirclefalse
1091 \ctikzset{tripoles/pmos style/.is choice}
1092 \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
1093 \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
1094 % Option draw pmos with no circle
1095 \newif\ifpgf@circuit@pmos@nocircle
1096 \pgf@circuit@pmos@nocirclefalse
1097 \pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
1098 \ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
1099 % back to normal
1100 \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
1101 \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
1102 % arrows at the end, the correct way
1103 \newif\ifpgf@circuit@trans@arrowatend
1104 \pgf@circuit@trans@arrowatendfalse
1105 \ctikzset{transistors/arrow pos/.is choice}
1106 \ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}}
1107 \ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}}
1108
1109 \newif\ifpgf@circuit@trans@ntype
1110 \pgf@circuit@trans@ntypetrue %default true
1111 %\newif\ifpgf@circuit@trans@ptype
1112 %\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
1113 \ctikzset{tripoles/nmos/width/.initial=.7}
1114 \ctikzset{tripoles/nmos/gate height/.initial=.35}
1115 \ctikzset{tripoles/nmos/base height/.initial=.5}
1116 \ctikzset{tripoles/nmos/conn height/.initial=0}
1117 \ctikzset{tripoles/nmos/height/.initial=1.1}
1118 \ctikzset{tripoles/nmos/base width/.initial=.5}
1119 \ctikzset{tripoles/nmos/gate width/.initial=.62}
1120 \ctikzset{tripoles/nmos/arrow pos/.initial=.6}
1121 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
1122 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
1123 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
1124 \ctikzset{tripoles/nmos/curr direction/.initial=1}
1125
1126 \ctikzset{tripoles/pmos/width/.initial=.7}
1127 \ctikzset{tripoles/pmos/gate height/.initial=.35}
1128 \ctikzset{tripoles/pmos/base height/.initial=.5}
1129 \ctikzset{tripoles/pmos/conn height/.initial=0}
1130 \ctikzset{tripoles/pmos/height/.initial=1.1}
1131 \ctikzset{tripoles/pmos/base width/.initial=.5}
1132 \ctikzset{tripoles/pmos/gate width/.initial=.62}
1133 \ctikzset{tripoles/pmos/arrow pos/.initial=.4}
1134 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
1135 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
1136 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
1137 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
1138
1139 \ctikzset{tripoles/hemt/width/.initial=.7}
1140 \ctikzset{tripoles/hemt/gate height/.initial=.35}
1141 \ctikzset{tripoles/hemt/base height/.initial=.5}
1142 \ctikzset{tripoles/hemt/conn height/.initial=0}
1143 \ctikzset{tripoles/hemt/height/.initial=1.1}
1144 \ctikzset{tripoles/hemt/base width/.initial=.5}
1145 \ctikzset{tripoles/hemt/gate width/.initial=.62}
1146 \ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
1147 \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
1148 \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
1149 \ctikzset{tripoles/hemt/curr direction/.initial=1}
1150
1151 \ctikzset{tripoles/nfet/width/.initial=.7}
1152 \ctikzset{tripoles/nfet/gate height/.initial=.35}
1153 \ctikzset{tripoles/nfet/base height/.initial=.5}
1154 \ctikzset{tripoles/nfet/conn height/.initial=0}
1155 \ctikzset{tripoles/nfet/height/.initial=1.1}
1156 \ctikzset{tripoles/nfet/base width/.initial=.5}
1157 \ctikzset{tripoles/nfet/gate width/.initial=.62}
1158 \ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
1159 \ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
1160 \ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
1161 \ctikzset{tripoles/nfet/curr direction/.initial=1}
1162
1163 \ctikzset{tripoles/pfet/width/.initial=.7}
1164 \ctikzset{tripoles/pfet/gate height/.initial=.35}
1165 \ctikzset{tripoles/pfet/base height/.initial=.5}
1166 \ctikzset{tripoles/pfet/conn height/.initial=0}
1167 \ctikzset{tripoles/pfet/height/.initial=1.1}
1168 \ctikzset{tripoles/pfet/base width/.initial=.5}
1169 \ctikzset{tripoles/pfet/gate width/.initial=.62}
1170 \ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
1171 \ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
1172 \ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
1173 \ctikzset{tripoles/pfet/curr direction/.initial=-1}
1174
1175 \ctikzset{tripoles/nigfete/width/.initial=.7}
1176 \ctikzset{tripoles/nigfete/gate height/.initial=.35}
1177 \ctikzset{tripoles/nigfete/base height/.initial=.5}
1178 \ctikzset{tripoles/nigfete/conn height/.initial=.35}
1179 \ctikzset{tripoles/nigfete/height/.initial=1.1}
1180 \ctikzset{tripoles/nigfete/base width/.initial=.5}
1181 \ctikzset{tripoles/nigfete/gate width/.initial=.62}
1182 \ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
1183 \ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
1184 \ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
1185 \ctikzset{tripoles/nigfete/curr direction/.initial=1}
1186
1187 \ctikzset{tripoles/nigfetd/width/.initial=.7}
1188 \ctikzset{tripoles/nigfetd/gate height/.initial=.35}
1189 \ctikzset{tripoles/nigfetd/base height/.initial=.5}
1190 \ctikzset{tripoles/nigfetd/conn height/.initial=.35}
1191 \ctikzset{tripoles/nigfetd/height/.initial=1.1}
1192 \ctikzset{tripoles/nigfetd/base width/.initial=.5}
1193 \ctikzset{tripoles/nigfetd/gate width/.initial=.62}
1194 \ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
1195 \ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
1196 \ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
1197 \ctikzset{tripoles/nigfetd/curr direction/.initial=1}
1198
1199 \ctikzset{tripoles/nigfetebulk/width/.initial=.7}
1200 \ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
1201 \ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
1202 \ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
1203 \ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
1204 \ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
1205 \ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
1206 \ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
1207 \ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
1208 \ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
1209 \ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
1210
1211 \ctikzset{tripoles/pigfete/width/.initial=.7}
1212 \ctikzset{tripoles/pigfete/gate height/.initial=.35}
1213 \ctikzset{tripoles/pigfete/base height/.initial=.5}
1214 \ctikzset{tripoles/pigfete/conn height/.initial=.35}
1215 \ctikzset{tripoles/pigfete/height/.initial=1.1}
1216 \ctikzset{tripoles/pigfete/base width/.initial=.5}
1217 \ctikzset{tripoles/pigfete/gate width/.initial=.62}
1218 \ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
1219 \ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
1220 \ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
1221 \ctikzset{tripoles/pigfete/curr direction/.initial=-1}
1222
1223 \ctikzset{tripoles/pigfetd/width/.initial=.7}
1224 \ctikzset{tripoles/pigfetd/gate height/.initial=.35}
1225 \ctikzset{tripoles/pigfetd/base height/.initial=.5}
1226 \ctikzset{tripoles/pigfetd/conn height/.initial=.35}
1227 \ctikzset{tripoles/pigfetd/height/.initial=1.1}
1228 \ctikzset{tripoles/pigfetd/base width/.initial=.5}
1229 \ctikzset{tripoles/pigfetd/gate width/.initial=.62}
1230 \ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
1231 \ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
1232 \ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
1233 \ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
1234
1235 \ctikzset{tripoles/pigfetebulk/width/.initial=.7}
1236 \ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
1237 \ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
1238 \ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
1239 \ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
1240 \ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
1241 \ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
1242 \ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
1243 \ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
1244 \ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
1245 \ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
1246
1247 \ctikzset{tripoles/npn/width/.initial=.6}
1248 \ctikzset{tripoles/npn/base height/.initial=.45}
1249 \ctikzset{tripoles/npn/base height 2/.initial=.15}
1250 \ctikzset{tripoles/npn/base height/.initial=.4}
1251 \ctikzset{tripoles/npn/conn height/.initial=0}
1252 \ctikzset{tripoles/npn/height/.initial=1.1}
1253 \ctikzset{tripoles/npn/base width/.initial=.5}
1254 \ctikzset{tripoles/npn/arrow pos/.initial=.5}
1255 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
1256 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
1257 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
1258 \ctikzset{tripoles/npn/curr direction/.initial=1}
1259
1260 \ctikzset{tripoles/pnp/width/.initial=.6}
1261 \ctikzset{tripoles/pnp/base height/.initial=.45}
1262 \ctikzset{tripoles/pnp/base height 2/.initial=.15}
1263 \ctikzset{tripoles/pnp/base height/.initial=.4}
1264 \ctikzset{tripoles/pnp/conn height/.initial=0}
1265 \ctikzset{tripoles/pnp/height/.initial=1.1}
1266 \ctikzset{tripoles/pnp/base width/.initial=.5}
1267 \ctikzset{tripoles/pnp/arrow pos/.initial=.5}
1268 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
1269 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
1270 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
1271 \ctikzset{tripoles/pnp/curr direction/.initial=-1}
1272
1273 \ctikzset{tripoles/pigbt/width/.initial=.6}
1274 \ctikzset{tripoles/pigbt/gate height/.initial=.45}
1275 \ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
1276 \ctikzset{tripoles/pigbt/base height/.initial=.4}
1277 \ctikzset{tripoles/pigbt/conn height/.initial=0}
1278 \ctikzset{tripoles/pigbt/height/.initial=1.1}
1279 \ctikzset{tripoles/pigbt/gate width/.initial=.62}
1280 \ctikzset{tripoles/pigbt/base width/.initial=.5}
1281 \ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
1282 \ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
1283 \ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
1284 \ctikzset{tripoles/pigbt/curr direction/.initial=-1}
1285
1286 \ctikzset{tripoles/nigbt/width/.initial=.6}
1287 \ctikzset{tripoles/nigbt/gate height/.initial=.45}
1288 \ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
1289 \ctikzset{tripoles/nigbt/base height/.initial=.4}
1290 \ctikzset{tripoles/nigbt/conn height/.initial=0}
1291 \ctikzset{tripoles/nigbt/height/.initial=1.1}
1292 \ctikzset{tripoles/nigbt/gate width/.initial=.62}
1293 \ctikzset{tripoles/nigbt/base width/.initial=.5}
1294 \ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
1295 \ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
1296 \ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
1297 \ctikzset{tripoles/nigbt/curr direction/.initial=1}
1298
1299 \ctikzset{tripoles/Lpigbt/width/.initial=.6}
1300 \ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
1301 \ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
1302 \ctikzset{tripoles/Lpigbt/base height/.initial=.4}
1303 \ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
1304 \ctikzset{tripoles/Lpigbt/height/.initial=1.1}
1305 \ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
1306 \ctikzset{tripoles/Lpigbt/base width/.initial=.5}
1307 \ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
1308 \ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
1309 \ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
1310 \ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
1311
1312 \ctikzset{tripoles/Lnigbt/width/.initial=.6}
1313 \ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
1314 \ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
1315 \ctikzset{tripoles/Lnigbt/base height/.initial=.4}
1316 \ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
1317 \ctikzset{tripoles/Lnigbt/height/.initial=1.1}
1318 \ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
1319 \ctikzset{tripoles/Lnigbt/base width/.initial=.5}
1320 \ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
1321 \ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
1322 \ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
1323 \ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
1324
1325 \ctikzset{tripoles/njfet/width/.initial=.7}
1326 \ctikzset{tripoles/njfet/gate height/.initial=.5}
1327 \ctikzset{tripoles/njfet/gate height 2/.initial=.35}
1328 \ctikzset{tripoles/njfet/gate width/.initial=.5}
1329 \ctikzset{tripoles/njfet/conn height/.initial=.35}
1330 \ctikzset{tripoles/njfet/height/.initial=1.1}
1331 \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
1332 \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
1333 \ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
1334 \ctikzset{tripoles/njfet/curr direction/.initial=1}
1335
1336 \ctikzset{tripoles/pjfet/width/.initial=.7}
1337 \ctikzset{tripoles/pjfet/gate height/.initial=.5}
1338 \ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
1339 \ctikzset{tripoles/pjfet/gate width/.initial=.5}
1340 \ctikzset{tripoles/pjfet/conn height/.initial=.35}
1341 \ctikzset{tripoles/pjfet/height/.initial=1.1}
1342 \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
1343 \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
1344 \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
1345 \ctikzset{tripoles/pjfet/curr direction/.initial=-1}
1346
1347 \ctikzset{tripoles/isfet/width/.initial=1}
1348 \ctikzset{tripoles/isfet/gate height/.initial=.35}
1349 \ctikzset{tripoles/isfet/base height/.initial=.5}
1350 \ctikzset{tripoles/isfet/height/.initial=1.1}
1351 \ctikzset{tripoles/isfet/base width/.initial=.3}
1352 \ctikzset{tripoles/isfet/gate width/.initial=.5}
1353 \ctikzset{tripoles/isfet/conn height/.initial=0}
1354 \ctikzset{tripoles/isfet/wave width/.initial=.16}
1355 \ctikzset{tripoles/isfet/wave amp/.initial=.06}
1356 \ctikzset{tripoles/isfet/waves y sep/.initial=.22}
1357 \ctikzset{tripoles/isfet/waves x sep/.initial=.8}
1358 \ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
1359 \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
1360 \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
1361 \ctikzset{tripoles/isfet/curr direction/.initial=1}
1362 %
1363 % multi-emitter and multi-collector BJTs by Romano Giannetti
1364 %
1365 \ctikzset{tripoles/bjt/emitters/.initial=1}
1366 \ctikzset{tripoles/bjt/collectors/.initial=1}
1367 \pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
1368 \pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
1369 \ctikzset{tripoles/bjt/pins width/.initial=0.3}
1370 \pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
1371 \ctikzset{tripoles/bjt/multi height/.initial=.5}
1372 \pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
1373 %
1374 \ctikzset{tripoles/bjt/width/.initial=.3}
1375 \ctikzset{tripoles/bjt/base height 2/.initial=.4}
1376 \ctikzset{tripoles/bjt/base height/.initial=1.1}
1377 \ctikzset{tripoles/bjt/height/.initial=.4}
1378 \ctikzset{tripoles/bjt/base width/.initial=1}
1379 \ctikzset{tripoles/bjt/arrow pos/.initial=.5}
1380 % do NOT touch these two!
1381 \ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
1382 \ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1}
1383
1384 %% transistors stop here
1385
1386 %% Logic ports
1387
1388 \newif\ifpgf@circuit@europeanlogicport
1389 \ctikzset{logic ports/.is choice}
1390 \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
1391 \tikzset{and port/.style={shape=european and port}}%
1392 \tikzset{or port/.style={shape=european or port}}%
1393 \tikzset{xor port/.style={shape=european xor port}}%
1394 \tikzset{buffer port/.style={shape=european buffer port}}%
1395 \tikzset{not port/.style={shape=european not port}}%
1396 \tikzset{nand port/.style={shape=european nand port}}%
1397 \tikzset{nor port/.style={shape=european nor port}}%
1398 \tikzset{xnor port/.style={shape=european xnor port}}%
1399 }}
1400 \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
1401 \tikzset{and port/.style={shape=american and port}}%
1402 \tikzset{or port/.style={shape=american or port}}%
1403 \tikzset{xor port/.style={shape=american xor port}}%
1404 \tikzset{buffer port/.style={shape=american buffer port}}%
1405 \tikzset{not port/.style={shape=american not port}}%
1406 \tikzset{nand port/.style={shape=american nand port}}%
1407 \tikzset{nor port/.style={shape=american nor port}}%
1408 \tikzset{xnor port/.style={shape=american xnor port}}%
1409 }}
1410
1411 \ctikzset{logic ports origin/.is choice}
1412 \ctikzset{logic ports origin/legacy/.code={
1413 \ctikzset{tripoles/american and port/origin/.initial=0.8}%
1414 \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
1415 \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
1416 \ctikzset{tripoles/american or port/origin/.initial=0.8}%
1417 \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
1418 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
1419 \ctikzset{tripoles/european and port/origin/.initial=0.8}%
1420 \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
1421 \ctikzset{tripoles/european or port/origin/.initial=0.8}%
1422 \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
1423 \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
1424 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
1425 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
1426 \ctikzset{tripoles/european not port/origin/.initial=0.8}%
1427 }%
1428 }
1429 \ctikzset{logic ports origin/center/.code={%
1430 \ctikzset{tripoles/american and port/origin/.initial=0}%
1431 \ctikzset{tripoles/american nand port/origin/.initial=0}%
1432 \ctikzset{tripoles/american nor port/origin/.initial=0}%
1433 \ctikzset{tripoles/american or port/origin/.initial=0}%
1434 \ctikzset{tripoles/american xor port/origin/.initial=0}%
1435 \ctikzset{tripoles/american xnor port/origin/.initial=0}%
1436 \ctikzset{tripoles/european and port/origin/.initial=0}%
1437 \ctikzset{tripoles/european nand port/origin/.initial=0}%
1438 \ctikzset{tripoles/european or port/origin/.initial=0}%
1439 \ctikzset{tripoles/european nor port/origin/.initial=0}%
1440 \ctikzset{tripoles/european xor port/origin/.initial=0}%
1441 \ctikzset{tripoles/european xnor port/origin/.initial=0}%
1442 \ctikzset{tripoles/european buffer port/origin/.initial=0}%
1443 \ctikzset{tripoles/european not port/origin/.initial=0}%
1444 }%
1445 }
1446
1447
1448 \ctikzset{tripoles/american and port/width/.initial=1.1}
1449 \ctikzset{tripoles/american and port/height/.initial=.8}
1450 \ctikzset{tripoles/american and port/port width/.initial=.7}
1451 \ctikzset{tripoles/american and port/input height/.initial=.5}
1452 \ctikzset{tripoles/american nand port/width/.initial=1.1}
1453 \ctikzset{tripoles/american nand port/height/.initial=.8}
1454 \ctikzset{tripoles/american nand port/port width/.initial=.7}
1455 \ctikzset{tripoles/american nand port/circle width/.initial=.15}
1456 \ctikzset{tripoles/american nand port/input height/.initial=.5}
1457 \ctikzset{tripoles/american or port/width/.initial=1.1}
1458 \ctikzset{tripoles/american or port/height/.initial=.8}
1459 \ctikzset{tripoles/american or port/port width/.initial=.7}
1460 \ctikzset{tripoles/american or port/input height/.initial=.5}
1461 \ctikzset{tripoles/american or port/input skip/.initial=.25}
1462 \ctikzset{tripoles/american or port/aaa/.initial=.6}
1463 \ctikzset{tripoles/american or port/bbb/.initial=.4}
1464 \ctikzset{tripoles/american or port/ccc/.initial=.5}
1465 \ctikzset{tripoles/american or port/ddd/.initial=.0}
1466 \ctikzset{tripoles/american nor port/width/.initial=1.1}
1467 \ctikzset{tripoles/american nor port/height/.initial=.8}
1468 \ctikzset{tripoles/american nor port/port width/.initial=.7}
1469 \ctikzset{tripoles/american nor port/input height/.initial=.5}
1470 \ctikzset{tripoles/american nor port/input skip/.initial=.25}
1471 \ctikzset{tripoles/american nor port/circle width/.initial=.15}
1472 \ctikzset{tripoles/american nor port/aaa/.initial=.6}
1473 \ctikzset{tripoles/american nor port/bbb/.initial=.4}
1474 \ctikzset{tripoles/american nor port/ccc/.initial=.5}
1475 \ctikzset{tripoles/american nor port/ddd/.initial=.0}
1476 \ctikzset{tripoles/american xor port/width/.initial=1.1}
1477 \ctikzset{tripoles/american xor port/height/.initial=.8}
1478 \ctikzset{tripoles/american xor port/port width/.initial=.7}
1479 \ctikzset{tripoles/american xor port/input height/.initial=.5}
1480 \ctikzset{tripoles/american xor port/input skip/.initial=.15}
1481 \ctikzset{tripoles/american xor port/distance/.initial=.1}
1482 \ctikzset{tripoles/american xnor port/width/.initial=1.1}
1483 \ctikzset{tripoles/american xnor port/height/.initial=.8}
1484 \ctikzset{tripoles/american xnor port/port width/.initial=.7}
1485 \ctikzset{tripoles/american xnor port/input height/.initial=.5}
1486 \ctikzset{tripoles/american xnor port/input skip/.initial=.15}
1487 \ctikzset{tripoles/american xnor port/distance/.initial=.1}
1488 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
1489 \ctikzset{tripoles/american and port/origin/.initial=0.8}
1490 \ctikzset{tripoles/american and port/inputs/.initial=2}
1491 % variable number of inputs
1492 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
1493 \ctikzset{tripoles/american nand port/inputs/.initial=2}
1494 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
1495 \ctikzset{tripoles/american nor port/inputs/.initial=2}
1496 \ctikzset{tripoles/american nor port/angle/.initial=70}
1497 \ctikzset{tripoles/american nor port/inner/.initial=0.3}
1498 \ctikzset{tripoles/american or port/origin/.initial=0.8}
1499 \ctikzset{tripoles/american or port/inputs/.initial=2}
1500 \ctikzset{tripoles/american or port/angle/.initial=70}
1501 \ctikzset{tripoles/american or port/inner/.initial=0.3}
1502 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
1503 \ctikzset{tripoles/american xor port/inputs/.initial=2}
1504 \ctikzset{tripoles/american xor port/angle/.initial=70}
1505 \ctikzset{tripoles/american xor port/inner/.initial=0.3}
1506 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
1507 \ctikzset{tripoles/american xnor port/inputs/.initial=2}
1508 \ctikzset{tripoles/american xnor port/angle/.initial=70}
1509 \ctikzset{tripoles/american xnor port/inner/.initial=0.3}
1510
1511 \ctikzset{tripoles/european and port/width/.initial=1.4}
1512 \ctikzset{tripoles/european and port/height/.initial=.65}
1513 \ctikzset{tripoles/european and port/reserved/.initial=.6}
1514 \ctikzset{tripoles/european and port/input height/.initial=.6}
1515 \ctikzset{tripoles/european or port/width/.initial=1.4}
1516 \ctikzset{tripoles/european or port/height/.initial=.65}
1517 \ctikzset{tripoles/european or port/reserved/.initial=.6}
1518 \ctikzset{tripoles/european or port/input height/.initial=.6}
1519 \ctikzset{tripoles/european xor port/width/.initial=1.4}
1520 \ctikzset{tripoles/european xor port/height/.initial=.65}
1521 \ctikzset{tripoles/european xor port/reserved/.initial=.6}
1522 \ctikzset{tripoles/european xor port/input height/.initial=.6}
1523 \ctikzset{tripoles/european nand port/width/.initial=1.4}
1524 \ctikzset{tripoles/european nand port/not height/.initial=.3}
1525 \ctikzset{tripoles/european nand port/not width/.initial=.8}
1526 \ctikzset{tripoles/european nand port/height/.initial=.65}
1527 \ctikzset{tripoles/european nand port/reserved/.initial=.6}
1528 \ctikzset{tripoles/european nand port/input height/.initial=.6}
1529 \ctikzset{tripoles/european buffer port/width/.initial=1.4}
1530 \ctikzset{tripoles/european buffer port/not height/.initial=.3}
1531 \ctikzset{tripoles/european buffer port/not width/.initial=.8}
1532 \ctikzset{tripoles/european buffer port/height/.initial=.65}
1533 \ctikzset{tripoles/european buffer port/reserved/.initial=.6}
1534 \ctikzset{tripoles/european buffer port/input height/.initial=0}
1535 \ctikzset{tripoles/european not port/width/.initial=1.4}
1536 \ctikzset{tripoles/european not port/not height/.initial=.3}
1537 \ctikzset{tripoles/european not port/not width/.initial=.8}
1538 \ctikzset{tripoles/european not port/height/.initial=.65}
1539 \ctikzset{tripoles/european not port/reserved/.initial=.6}
1540 \ctikzset{tripoles/european not port/input height/.initial=0}
1541 \ctikzset{tripoles/european xnor port/width/.initial=1.4}
1542 \ctikzset{tripoles/european xnor port/not height/.initial=.3}
1543 \ctikzset{tripoles/european xnor port/not width/.initial=.8}
1544 \ctikzset{tripoles/european xnor port/height/.initial=.65}
1545 \ctikzset{tripoles/european xnor port/reserved/.initial=.6}
1546 \ctikzset{tripoles/european xnor port/input height/.initial=.6}
1547 \ctikzset{tripoles/european nor port/width/.initial=1.4}
1548 \ctikzset{tripoles/european nor port/not height/.initial=.3}
1549 \ctikzset{tripoles/european nor port/not width/.initial=.8}
1550 \ctikzset{tripoles/european nor port/height/.initial=.65}
1551 \ctikzset{tripoles/european nor port/reserved/.initial=.6}
1552 \ctikzset{tripoles/european nor port/input height/.initial=.6}
1553 % variable number of inputs
1554 \ctikzset{tripoles/european and port/origin/.initial=0.8}
1555 \ctikzset{tripoles/european and port/inputs/.initial=2}
1556 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
1557 \ctikzset{tripoles/european nand port/inputs/.initial=2}
1558 \ctikzset{tripoles/european or port/origin/.initial=0.8}
1559 \ctikzset{tripoles/european or port/inputs/.initial=2}
1560 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
1561 \ctikzset{tripoles/european nor port/inputs/.initial=2}
1562 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
1563 \ctikzset{tripoles/european xor port/inputs/.initial=2}
1564 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
1565 \ctikzset{tripoles/european xnor port/inputs/.initial=2}
1566 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}
1567 \ctikzset{tripoles/european buffer port/inputs/.initial=1}%
1568 \ctikzset{tripoles/european not port/origin/.initial=0.8}
1569 \ctikzset{tripoles/european not port/inputs/.initial=1}%
1570 %%% parameters that are not used anymore after multi-input
1571 %%% gates --- left for compatibility of source code.
1572 \ctikzset{tripoles/american xor port/aaa/.initial=.6}
1573 \ctikzset{tripoles/american xor port/bbb/.initial=.4}
1574 \ctikzset{tripoles/american xor port/ccc/.initial=.5}
1575 \ctikzset{tripoles/american xor port/ddd/.initial=.0}
1576 \ctikzset{tripoles/american xnor port/aaa/.initial=.6}
1577 \ctikzset{tripoles/american xnor port/bbb/.initial=.4}
1578 \ctikzset{tripoles/american xnor port/ccc/.initial=.5}
1579 \ctikzset{tripoles/american xnor port/ddd/.initial=.0}
1580 % switches for logic gates
1581 %
1582 \pgfkeys{/tikz/number inputs/.initial=0}
1583 \pgfkeys{/tikz/number inputs/.default=0}
1584 %
1585 % switches for op amps
1586 % changing input polarity
1587 %
1588 \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
1589 \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1590 \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1591 \pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1592 \ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1593 %
1594 % changing output polarity (for fully diff objects)
1595 %
1596 \newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
1597 \pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1598 \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1599 \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1600 \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1601
1602 % Operational amplifier
1603 \ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
1604 \ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
1605 \ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
1606 \ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
1607 \ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
1608 \ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1609
1610 % Fully differential operational amplifier
1611 \ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
1612 \ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
1613 \ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
1614 \ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
1615 \ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
1616 \ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
1617 \ctikzset{tripoles/fd op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1618
1619 \ctikzset{tripoles/en amp/width/.initial=1.7}
1620 \ctikzset{tripoles/en amp/port width/.initial=.7}
1621 \ctikzset{tripoles/en amp/height/.initial=1.6}
1622 \ctikzset{tripoles/en amp/input height/.initial=.3}
1623 \ctikzset{tripoles/en amp/up pos/.initial=.45}
1624 \ctikzset{tripoles/en amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1625 \ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed!
1626 \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
1627 \tikzset{
1628 en amp text/.code = {%
1629 \ctikzsetvalof{tripoles/en amp/text}{#1}%
1630 },
1631 en amp text A/.code = {%
1632 \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
1633 },
1634 }
1635
1636 % Transconductance amplifier
1637 \ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
1638 \ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
1639 \ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
1640 \ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
1641 \ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
1642 \ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
1643 \ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1644
1645 % Instrumentation amplifier
1646 \ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
1647 \ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
1648 \ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
1649 \ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1650 \ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
1651 \ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
1652 \ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1653 \ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1654
1655 % Instrumentation amplifier with differential output
1656 \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
1657 \ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
1658 \ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
1659 \ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1660 \ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
1661 \ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
1662 \ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
1663 \ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1664 \ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1665
1666 % Instrumentation amplifier with gain resistor terminals
1667 \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
1668 \ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
1669 \ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
1670 \ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
1671 \ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
1672 \ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
1673 \ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
1674 \ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
1675 \ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1676
1677 % Plain amplifier
1678 \ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
1679 \ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
1680 \ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
1681 \ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
1682 \ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
1683
1684 \ctikzset{tripoles/thyristor/height/.initial=1.10}
1685 \ctikzset{tripoles/thyristor/height 2/.initial=.5}
1686 \ctikzset{tripoles/thyristor/width/.initial=1.0}
1687 \ctikzset{tripoles/thyristor/diode height/.initial=.5}
1688 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
1689 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
1690
1691 \ctikzset{tripoles/triac/height/.initial=1.1}
1692 \ctikzset{tripoles/triac/width/.initial=1}
1693 \ctikzset{tripoles/triac/diode width left/.initial=.3}
1694 \ctikzset{tripoles/triac/diode width right/.initial=.3}
1695
1696 %% Cute switches
1697 \ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
1698 \ctikzset{bipoles/cuteswitch/height/.initial=.6}
1699 \ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
1700 \ctikzset{bipoles/cuteswitch/width/.initial=.50}
1701 \ctikzset{bipoles/cuteswitch/thickness/.initial=1}
1702
1703 \ctikzset{tripoles/spdt/width/.initial=.85}
1704 \ctikzset{tripoles/spdt/height/.initial=.45}
1705 \ctikzset{tripoles/spdt/margin/.initial=.45}
1706
1707 \ctikzset{tripoles/toggleswitch/height/.initial=.8}
1708 \ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
1709 \ctikzset{tripoles/toggleswitch/width/.initial=.80}
1710
1711 \ctikzset{tripoles/mixer/width/.initial=0.7}
1712 \ctikzset{tripoles/adder/width/.initial=0.7}
1713 \ctikzset{tripoles/circulator/width/.initial=.7}
1714 \ctikzset{tripoles/oscillator/width/.initial=.7}
1715
1716
1717 \ctikzset{tripoles/wilkinson/height/.initial=1.3}
1718 \ctikzset{tripoles/wilkinson/width/.initial=1.3}
1719
1720 \ctikzset{quadpoles/transformer/inner/.initial=0.4}
1721 \ctikzset{quadpoles/transformer/width/.initial=1.5}
1722 \ctikzset{quadpoles/transformer/width1/.initial=.4}
1723 \ctikzset{quadpoles/transformer/height/.initial=1.5}
1724 \ctikzset{quadpoles/transformer/height1/.initial=.8}
1725 \ctikzset{quadpoles/transformer core/inner/.initial=0.4}
1726 \ctikzset{quadpoles/transformer core/width/.initial=1.5}
1727 \ctikzset{quadpoles/transformer core/height/.initial=1.5}
1728 \ctikzset{quadpoles/transformer core/core height/.initial=.5}
1729 \ctikzset{quadpoles/transformer core/core width/.initial=.05}
1730 \ctikzset{quadpoles/gyrator/inner/.initial=0.4}
1731 \ctikzset{quadpoles/gyrator/width/.initial=1.5}
1732 \ctikzset{quadpoles/gyrator/height/.initial=1.5}
1733 \ctikzset{quadpoles/fourport/width/.initial=1.3}
1734 \ctikzset{quadpoles/fourport/height/.initial=1.3}
1735 \ctikzset{quadpoles/coupler/width/.initial=1.3}
1736 \ctikzset{quadpoles/coupler/height/.initial=1.3}
1737 \ctikzset{quadpoles/coupler2/width/.initial=1.3}
1738 \ctikzset{quadpoles/coupler2/height/.initial=1.3}
1739
1740 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
1741
1742 \ctikzset{quadpoles style/.is choice}
1743 \ctikzset{quadpoles style/inward/.code={% default value
1744 \ctikzset{quadpoles/transformer/inner=0.4}%
1745 \ctikzset{quadpoles/transformer/width=1.5}%
1746 \ctikzset{quadpoles/transformer core/inner=0.4}%
1747 \ctikzset{quadpoles/transformer core/width=1.5}%
1748 \ctikzset{quadpoles/gyrator/inner=0.4}%
1749 \ctikzset{quadpoles/gyrator/width=1.5}%
1750 }%
1751 }
1752 \ctikzset{quadpoles style/inline/.code={% now horizontal baffle
1753 \ctikzset{quadpoles/transformer/inner=1}%
1754 \ctikzset{quadpoles/transformer/width=0.6}%
1755 \ctikzset{quadpoles/transformer core/inner=1}%
1756 \ctikzset{quadpoles/transformer core/width=0.6}%
1757 \ctikzset{quadpoles/gyrator/inner=1} % FIXME
1758 \ctikzset{quadpoles/gyrator/width=0.6}%
1759 }%
1760 }
1761
1762 %
1763 % multipoles
1764 %
1765 \ctikzset{multipoles/thickness/.initial=2}
1766 \ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny}
1767 % DIP (dual in line package) chips
1768 \ctikzset{multipoles/dipchip/width/.initial=1.2}
1769 \ctikzset{multipoles/dipchip/num pins/.initial=8}
1770 \ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
1771 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
1772 % QFP (quad flat package) chips
1773 \ctikzset{multipoles/qfpchip/num pins/.initial=8}
1774 \ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
1775 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
1776 % chip numbers
1777 \newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
1778 \pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1779 \ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1780 \pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1781 \ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1782 \newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
1783 \pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1784 \ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1785 \pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1786 \ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1787 % external chip pins
1788 \ctikzset{multipoles/external pins thickness/.initial=1}
1789 \ctikzset{multipoles/external pins width/.initial=0.2}
1790 \ctikzset{multipoles/external pad fraction/.initial=0}
1791 \pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
1792 \pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
1793 % topmarks
1794 \newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
1795 \pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1796 \ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1797 \pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1798 \ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1799
1800 % rotary switch by Romano
1801 \ctikzset{multipoles/rotary/thickness/.initial=1}
1802 \ctikzset{multipoles/rotary/shape/.initial=ocirc}
1803 \ctikzset{multipoles/rotary/channels/.initial=5}
1804 \ctikzset{multipoles/rotary/angle/.initial=60}
1805 \ctikzset{multipoles/rotary/wiper/.initial=20}
1806 \ctikzset{multipoles/rotary/arrow/.is choice}
1807 \newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
1808 \newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
1809 \newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
1810 \ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
1811 \ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
1812 \ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
1813 \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
1814
1815 \tikzset{%
1816 rotary switch/.style args={#1in#2wiper#3}{%
1817 shape=rotaryswitch,
1818 /tikz/circuitikz/multipoles/rotary/channels=#1,
1819 /tikz/circuitikz/multipoles/rotary/angle=#2,
1820 /tikz/circuitikz/multipoles/rotary/wiper=#3,
1821 },
1822 rotary switch -/.style args={#1in#2wiper#3}{
1823 rotary switch=#1 in #2 wiper #3,
1824 /tikz/circuitikz/multipoles/rotary/arrow=none,
1825 },
1826 rotary switch <-/.style args={#1in#2wiper#3}{
1827 rotary switch=#1 in #2 wiper #3,
1828 /tikz/circuitikz/multipoles/rotary/arrow=ccw,
1829 },
1830 rotary switch ->/.style args={#1in#2wiper#3}{
1831 rotary switch=#1 in #2 wiper #3,
1832 /tikz/circuitikz/multipoles/rotary/arrow=cw,
1833 },
1834 rotary switch <->/.style args={#1in#2wiper#3}{
1835 rotary switch=#1 in #2 wiper #3,
1836 /tikz/circuitikz/multipoles/rotary/arrow=both,
1837 },
1838 % Notice that these should be the same as the initial values of the keys
1839 rotary switch/.default={5 in 60 wiper 20},
1840 rotary switch -/.default={5 in 60 wiper 20},
1841 rotary switch <-/.default={5 in 60 wiper 20},
1842 rotary switch ->/.default={5 in 60 wiper 20},
1843 rotary switch <->/.default={5 in 60 wiper 20},
1844 }
1845
1846 % %Mechanical section
1847 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
1848 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
1849 \ctikzset{bipoles/spring/height/.initial=.5}
1850 \ctikzset{bipoles/spring/width/.initial=.5}
1851 \ctikzset{bipoles/mass/height/.initial=.55}
1852 \ctikzset{bipoles/mass/box height/.initial=.4}
1853 \ctikzset{bipoles/mass/width/.initial=.5}
1854
1855 \ctikzset{bipoles/damper/height/.initial=.35}
1856 \ctikzset{bipoles/damper/length/.initial=.3}
1857 \ctikzset{bipoles/damper/width/.initial=.4}
1858
1859
1860 \ctikzset{bipole/.is family}
1861 \ctikzset{bipole/kind/.initial=}
1862 \ctikzset{bipole/name/.initial=}
1863 \newif\ifpgf@circuit@bipole@isvoltage
1864 \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
1865 \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
1866 \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
1867 \newif\ifpgf@circuit@bipole@strokedsymbol
1868 \ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
1869 \newif\ifpgf@circuit@bipole@iscurrent
1870 \ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
1871
1872 \ctikzset{bipole/voltage/.is family}
1873 \newif\ifpgf@circuit@bipole@voltage@backward
1874 \ctikzset{bipole/voltage/direction/.is choice}
1875 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
1876 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
1877 \newif\ifpgf@circuit@bipole@voltage@below
1878 \ctikzset{bipole/voltage/position/.is choice}
1879 \ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
1880 \ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
1881
1882 \ctikzset{bipole/voltage/label/unit/.initial=}
1883 \ctikzset{bipole/voltage/label/name/.initial=}
1884
1885 \ctikzset{bipole/current/.is family}
1886 \newif\ifpgf@circuit@bipole@current@backward
1887 \ctikzset{bipole/current/direction/.is choice}
1888 \ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
1889 \ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
1890 \newif\ifpgf@circuit@bipole@current@before
1891 \ctikzset{bipole/current/x position/.is choice}
1892 \ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
1893 \ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
1894 \newif\ifpgf@circuit@bipole@current@below
1895 \ctikzset{bipole/current/y position/.is choice}
1896 \ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
1897 \ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
1898 \ctikzset{bipole/current/label/unit/.initial=}
1899 \ctikzset{bipole/current/label/name/.initial=}
1900
1901 \ctikzset{bipole/flow/.is family}
1902 \newif\ifpgf@circuit@bipole@flow@backward
1903 \ctikzset{bipole/flow/direction/.is choice}
1904 \ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
1905 \ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
1906 \newif\ifpgf@circuit@bipole@flow@before
1907 \ctikzset{bipole/flow/x position/.is choice}
1908 \ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
1909 \ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
1910 \newif\ifpgf@circuit@bipole@flow@below
1911 \ctikzset{bipole/flow/y position/.is choice}
1912 \ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
1913 \ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
1914 \ctikzset{bipole/flow/label/unit/.initial=}
1915 \ctikzset{bipole/flow/label/name/.initial=}
1916 \ctikzset{flow/distance/.initial = .5}
1917 \ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
1918
1919 \ctikzset{bipole/label/.is family}
1920 \ctikzset{bipole/label/position/.initial=90}
1921 \ctikzset{bipole/label/unit/.initial=}
1922 \ctikzset{bipole/label/name/.initial=}
1923 \ctikzset{bipole/annotation/.is family}
1924 \ctikzset{bipole/annotation/position/.initial=-90}
1925 \ctikzset{bipole/annotation/unit/.initial=}
1926 \ctikzset{bipole/annotation/name/.initial=}
1927
1928 \newif\ifpgf@circuit@europeanresistor
1929 \ctikzset{resistor/.is choice}
1930 \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
1931 \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
1932
1933 \ctikzset{inductor/.is choice}
1934 \ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
1935 \ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
1936 \ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
1937
1938 \newif\ifpgf@circuit@strokediode
1939 \newif\ifpgf@circuit@fulldiode
1940 \pgf@circuit@strokediodefalse
1941 \pgf@circuit@fulldiodefalse
1942
1943 \ctikzset{diode/.is choice}
1944 \ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
1945 \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
1946 \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
1947
1948 \tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
1949 \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
1950 \tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
1951
1952 \ctikzset{thickness/.initial=2}
1953 \ctikzset{color/.initial=black}
1954 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
1955
1956 \newif\ifpgf@circ@siunitx
1957 \newif\ifpgf@circ@siunitx@res
1958
1959 \ctikzset{straight/.is choice}
1960 \ctikzset{straightvoltage value/.initial=true}
1961 \ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
1962 \ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
1963 \ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
1964 \newif\ifpgf@circuit@bipole@voltage@straight
1965 \ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
1966
1967
1968 \ctikzset{voltage/.is family}
1969 \ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
1970 \ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
1971 \ctikzset{voltage/bump a/.initial=1.2}
1972 \ctikzset{voltage/bump b/.initial=1.5}
1973 \ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
1974 \ctikzset{voltage shift/.style={voltage/shift=#1}}
1975 \tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
1976 \ctikzset{voltage/european label distance/.initial=1.4}
1977 \ctikzset{voltage/american label distance/.initial=1.1}
1978 % shaping the +/- sign, see pgfcircvoltage.tex
1979 \ctikzset{voltage/american font/.initial={}}
1980 \ctikzset{voltage/american plus/.initial={$+$}}
1981 \ctikzset{voltage/american minus/.initial={$-$}}
1982
1983 % special cases
1984 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
1985 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
1986 \ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
1987 %\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
1988 \ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
1989 \ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
1990 \ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
1991 \ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
1992 \ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
1993 \ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
1994 \ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
1995 \ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
1996 \ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
1997 \ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
1998 \ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
1999 %\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
2000 \ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
2001 \ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
2002 %\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
2003 \ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
2004 \ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
2005 %\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
2006 \ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
2007 \ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
2008 %\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
2009 \ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
2010 \ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
2011 %\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
2012 \ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
2013 %\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
2014 \ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
2015
2016 \ctikzset{current/.is family}
2017 \ctikzset{current/distance/.initial = .5}
2018
2019
2020 \tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
2021 \tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
2022 \tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
2023 \tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
2024 \tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
2025 \tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
2026
2027 \newif\ifpgf@circuit@europeangfsurgearrester
2028 \ctikzset{gas filled surge arrester choice/.is choice}
2029 \ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}}
2030 \ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}}
2031
2032 \tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
2033 \tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
2034 \tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
2035 \tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
2036 \tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
2037 \tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
2038 \tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
2039 \tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
2040 \tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
2041 \tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
2042
2043 % I should try to make the tree clearer (this voltage conflicts with the options above)
2044
2045 \newif\ifpgf@circuit@europeanvoltage
2046 \ctikzset{voltage/.is choice}
2047 \ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}}
2048 \ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}}
2049
2050 \newif\ifpgf@circuit@europeancurrent
2051 \ctikzset{current/.is choice}
2052 \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse}
2053 \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue}
2054
2055 % noise sources
2056 \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
2057
2058 \ctikzset{label/align/.is choice}
2059 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
2060 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
2061 \ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
2062
2063 % seven segment displays by RGtti
2064
2065 \newif\ifpgf@circ@sevenseg@dot
2066 \newif\ifpgf@circ@sevenseg@box
2067 \def\pgf@circ@sevenseg@dotstate{empty}
2068 \ctikzset{seven seg/.is family}
2069 \ctikzset{seven seg/dot/.is choice}
2070 % none means no dot, not space for it. Empty means no dot, but space
2071 \ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
2072 \ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
2073 \ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
2074 \ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
2075 %
2076 \ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
2077 \ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
2078 \ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
2079 \ctikzset{seven seg/box sep/.initial=1pt}% external box gap
2080 \ctikzset{seven seg/color on/.initial=red}% color for segment "on"
2081 \ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
2082 \ctikzset{seven seg/box/.is choice}
2083 \ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
2084 \ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
2085
2086 \ctikzset{seven seg/bits/.initial=0000000}
2087
2088 \ctikzset{seven seg/value/.code={%
2089 \edef\@@tmp{#1}%
2090 \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
2091 \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
2092 \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
2093 \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
2094 \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
2095 \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
2096 \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
2097 \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
2098 \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
2099 \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
2100 \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2101 \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2102 \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2103 \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2104 \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2105 \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2106 \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2107 \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2108 \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2109 \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2110 \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2111 \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2112 \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
2113 \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
2114 \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
2115 \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
2116 \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
2117 \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
2118 \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
2119 }}
2120
2121 \tikzset{%
2122 seven segment val/.style args={#1dot#2box#3}{%
2123 shape=bare7seg,
2124 /tikz/circuitikz/seven seg/value=#1,
2125 /tikz/circuitikz/seven seg/dot=#2,
2126 /tikz/circuitikz/seven seg/box=#3,
2127 },
2128 seven segment bits/.style args={#1dot#2box#3}{%
2129 shape=bare7seg,
2130 /tikz/circuitikz/seven seg/bits=#1,
2131 /tikz/circuitikz/seven seg/dot=#2,
2132 /tikz/circuitikz/seven seg/box=#3,
2133 },
2134 }
2135
2136
2137 %%%%%%%%%% new
2138 \pgfkeys{\circuitikzbasekey/.search also={/tikz}}
2139
2140 % Electronic tubes: diodetube, triode, tetrode and pentode
2141 \ctikzset{tubes/width/.initial=1} % relative width
2142 \ctikzset{tubes/height/.initial=1.4} % relative height
2143 \ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
2144 \ctikzset{tubes/anode distance/.initial=0.40} % distance from center
2145 \ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
2146 \ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
2147 \ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
2148 \ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
2149 \ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
2150 \ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
2151 \ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
2152 \ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
2153 \ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
2154 \ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
2155 \ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
2156
2157 \newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
2158 \pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
2159 \ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
2160 \newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
2161 \pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
2162 \ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
2163 \newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
2164 \pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
2165 \ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
2166
2167 %%%---------- close: tex/pgfcirc.defines
2168 %%%%%%%%%%% Springe nach tex/pgfcircutils
2169 %%%---------- open: tex/pgfcircutils.tex
2170 % Copyright 2007-2009 by Massimo Redaelli
2171 %
2172 % This file may be distributed and/or modified
2173 %
2174 % 1. under the LaTeX Project Public License and/or
2175 % 2. under the GNU Public License.
2176 %
2177 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2178
2179 %\def\pgf@circ@handleSI#1{%
2180 % \pgf@circ@siunitx@resfalse
2181 %
2182 % \edef\len{\stringlength[e]{#1}}
2183 %\testmatchingchar[e]{#1}{\len}{>}%
2184 %\ifmatchingchar%
2185 % \ifnum\findchars{#1}{<}=0
2186 % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
2187 %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
2188 %\pgf@circ@siunitx@restrue
2189 % \else
2190 % \fi
2191 %\else
2192 %\fi
2193 %}
2194
2195 \def\pgf@circ@handleSI#1{
2196 \noexpandarg
2197 \def\pgf@temp{}
2198 \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
2199 \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
2200
2201 \ifnum\pgf@circ@handleSI@unit@len=0
2202 \pgf@circ@siunitx@resfalse
2203 \else
2204 \IfEndWith{#1}{>}{
2205 \pgf@circ@siunitx@restrue
2206 \noexpandarg
2207 \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
2208 %\typeout{si |#1|}
2209 }{
2210 \pgf@circ@siunitx@resfalse
2211 %\typeout{no si |#1|}
2212 }
2213 \fi
2214 }
2215
2216 \def\pgf@circ@ifkeyempty#1{
2217 \pgfextra{
2218 \ctikzset{#1/.get=\pgf@circ@temp}
2219 \edef\pgf@temp{}
2220 }
2221 \ifx\pgf@circ@temp\pgf@temp
2222 }
2223
2224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2225 %% Math routines
2226
2227 \def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
2228
2229 %%%---------- close: tex/pgfcircutils
2230
2231 %%%%%%%%%%% Springe nach tex/pgfcircshapes
2232 %%%---------- open: tex/pgfcircshapes.tex
2233 % Copyright 2007-2009 by Massimo Redaelli
2234 %
2235 % This file may be distributed and/or modified
2236 %
2237 % 1. under the LaTeX Project Public License and/or
2238 % 2. under the GNU Public License.
2239 %
2240 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2241
2242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2243 %% Other shapes
2244
2245 %% Nothing
2246
2247 \pgfdeclareshape{emptyshape}{
2248 \savedanchor{\northeast}{%
2249 \pgf@x=.5\wd\pgfnodeparttextbox%
2250 \pgf@y=.5\ht\pgfnodeparttextbox%
2251 }
2252 \anchor{north}{\northeast\pgf@x=0cm\relax}
2253 \anchor{east}{\northeast\pgf@y=0cm\relax}
2254 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2255 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2256 \anchor{north east}{\northeast}
2257 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2258 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2259 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2260 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
2261 \anchor{center}{
2262 \pgfpointorigin
2263 }
2264 }
2265
2266 %% Full terminal
2267
2268 \pgfdeclareshape{circ}{
2269 \anchor{center}{
2270 \pgfpointorigin
2271 }
2272 \savedanchor\northwest{%
2273 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2274 \pgf@x=-\pgf@y
2275 }
2276 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2277 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2278 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2279 \anchor{west}{ \northwest \pgf@y=0pt }
2280 \anchor{w}{ \northwest \pgf@y=0pt }
2281 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2282 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2283 \anchor{north}{ \northwest \pgf@x=0pt }
2284 \anchor{n}{ \northwest \pgf@x=0pt }
2285 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2286 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2287 \anchor{north west}{ \northwest }
2288 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2289 \anchorborder{
2290 \pgf@circ@res@left=\pgf@x
2291 \pgf@circ@res@up=\pgf@y
2292 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2293 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2294 }
2295 \behindforegroundpath{
2296
2297 \pgfscope
2298 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2299 \pgfsetcolor{\ctikzvalof{color}}
2300 \pgfsetfillopacity{1.0}
2301 \pgfusepath{draw,fill}
2302 \endpgfscope
2303
2304 }
2305 }
2306
2307 %% Empty terminal
2308
2309 \pgfdeclareshape{ocirc}{
2310 \anchor{center}{
2311 \pgfpointorigin
2312 }
2313 \savedanchor\northwest{%
2314 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2315 \pgf@x=-\pgf@y
2316 }
2317 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2318 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2319 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2320 \anchor{west}{ \northwest \pgf@y=0pt }
2321 \anchor{w}{ \northwest \pgf@y=0pt }
2322 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2323 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2324 \anchor{north}{ \northwest \pgf@x=0pt }
2325 \anchor{n}{ \northwest \pgf@x=0pt }
2326 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2327 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2328 \anchor{north west}{ \northwest }
2329 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2330 \anchorborder{
2331 \pgf@circ@res@left=\pgf@x
2332 \pgf@circ@res@up=\pgf@y
2333 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2334 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2335 }
2336
2337 \behindforegroundpath{
2338
2339 \pgfscope
2340 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2341 \pgfsetcolor{\ctikzvalof{color}}
2342 \ifx\tikz@fillcolor\pgfutil@empty
2343 % set the default fill color to white
2344 \pgfsetfillcolor{white}
2345 % ...but override it if the class is defined!
2346 % note that this element has no class, but will inherit it when used
2347 % into another component
2348 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2349 \else
2350 \pgfsetfillcolor{\tikz@fillcolor}
2351 \fi
2352 \pgfsetfillopacity{1.0}
2353 \pgfusepath{draw,fill}
2354 \endpgfscope
2355
2356 }
2357 }
2358
2359 %% Diamond terminal
2360
2361 \pgfdeclareshape{diamondpole}{
2362 \anchor{center}{
2363 \pgfpointorigin
2364 }
2365 \savedanchor\northwest{%
2366 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2367 \pgf@x=-\pgf@y
2368 }
2369 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2370 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2371 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2372 \anchor{west}{ \northwest \pgf@y=0pt }
2373 \anchor{w}{ \northwest \pgf@y=0pt }
2374 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2375 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2376 \anchor{north}{ \northwest \pgf@x=0pt }
2377 \anchor{n}{ \northwest \pgf@x=0pt }
2378 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2379 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2380 \anchor{north west}{ \northwest }
2381 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2382 \anchorborder{
2383 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2384 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2385 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2386 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2387 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2388 \pgfextracty{\pgf@circ@res@up}{\northwest}
2389 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2390 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2391 \pgfpointintersectionoflines
2392 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2393 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2394 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2395 \pgf@x=\@@switchx\pgf@x
2396 \pgf@y=\@@switchy\pgf@y
2397 }
2398 \behindforegroundpath{
2399 \pgfscope
2400 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2401 \pgftransformrotate{45}
2402 \pgfpathrectanglecorners
2403 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2404 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2405 \pgfsetcolor{\ctikzvalof{color}}
2406 \pgfsetfillopacity{1.0}
2407 \pgfusepath{draw,fill}
2408 \endpgfscope
2409 }
2410 }
2411
2412 %% Diamond terminal, unfilled
2413
2414 \pgfdeclareshape{odiamondpole}{
2415 \anchor{center}{
2416 \pgfpointorigin
2417 }
2418 \savedanchor\northwest{%
2419 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2420 \pgf@x=-\pgf@y
2421 }
2422 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2423 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2424 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2425 \anchor{west}{ \northwest \pgf@y=0pt }
2426 \anchor{w}{ \northwest \pgf@y=0pt }
2427 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2428 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2429 \anchor{north}{ \northwest \pgf@x=0pt }
2430 \anchor{n}{ \northwest \pgf@x=0pt }
2431 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2432 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2433 \anchor{north west}{ \northwest }
2434 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2435 \anchorborder{
2436 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2437 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2438 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2439 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2440 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2441 \pgfextracty{\pgf@circ@res@up}{\northwest}
2442 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2443 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2444 \pgfpointintersectionoflines
2445 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2446 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2447 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2448 \pgf@x=\@@switchx\pgf@x
2449 \pgf@y=\@@switchy\pgf@y
2450 }
2451 \behindforegroundpath{
2452 \pgfscope
2453 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2454 \pgftransformrotate{45}
2455 \pgfpathrectanglecorners
2456 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2457 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2458 \pgfsetcolor{\ctikzvalof{color}}
2459 \ifx\tikz@fillcolor\pgfutil@empty
2460 % set the default fill color to white
2461 \pgfsetfillcolor{white}
2462 % ...but override it if the class is defined!
2463 % note that this element has no class, but will inherit it when used
2464 % into another component
2465 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2466 \else
2467 \pgfsetfillcolor{\tikz@fillcolor}
2468 \fi
2469 \pgfsetfillopacity{1.0}
2470 \pgfusepath{draw,fill}
2471 \endpgfscope
2472 }
2473 }
2474
2475 %% square terminal, filled
2476
2477 \pgfdeclareshape{squarepole}{
2478 \anchor{center}{
2479 \pgfpointorigin
2480 }
2481 \savedanchor\northwest{%
2482 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2483 \pgf@x=-\pgf@y
2484 }
2485 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2486 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2487 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2488 \anchor{west}{ \northwest \pgf@y=0pt }
2489 \anchor{w}{ \northwest \pgf@y=0pt }
2490 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2491 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2492 \anchor{north}{ \northwest \pgf@x=0pt }
2493 \anchor{n}{ \northwest \pgf@x=0pt }
2494 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2495 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2496 \anchor{north west}{ \northwest }
2497 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2498 \anchorborder{
2499 \pgf@xa=\pgf@x
2500 \pgf@ya=\pgf@y
2501 \pgfextracty{\pgf@circ@res@up}{\northwest}
2502 \pgfpointborderrectangle
2503 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2504 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2505 }
2506 \behindforegroundpath{
2507 \pgfscope
2508 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2509 \pgfpathrectanglecorners
2510 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2511 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2512 \pgfsetcolor{\ctikzvalof{color}}
2513 \pgfsetfillopacity{1.0}
2514 \pgfusepath{draw,fill}
2515 \endpgfscope
2516 }
2517 }
2518 %% square terminal, unfilled
2519
2520 \pgfdeclareshape{osquarepole}{
2521 \anchor{center}{
2522 \pgfpointorigin
2523 }
2524 \savedanchor\northwest{%
2525 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2526 \pgf@x=-\pgf@y
2527 }
2528 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2529 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2530 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2531 \anchor{west}{ \northwest \pgf@y=0pt }
2532 \anchor{w}{ \northwest \pgf@y=0pt }
2533 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2534 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2535 \anchor{north}{ \northwest \pgf@x=0pt }
2536 \anchor{n}{ \northwest \pgf@x=0pt }
2537 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2538 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2539 \anchor{north west}{ \northwest }
2540 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2541 \anchorborder{
2542 \pgf@xa=\pgf@x
2543 \pgf@ya=\pgf@y
2544 \pgfextracty{\pgf@circ@res@up}{\northwest}
2545 \pgfpointborderrectangle
2546 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2547 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2548 }
2549 \behindforegroundpath{
2550 \pgfscope
2551 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2552 \pgfpathrectanglecorners
2553 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2554 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2555 \pgfsetcolor{\ctikzvalof{color}}
2556 \ifx\tikz@fillcolor\pgfutil@empty
2557 % set the default fill color to white
2558 \pgfsetfillcolor{white}
2559 % ...but override it if the class is defined!
2560 % note that this element has no class, but will inherit it when used
2561 % into another component
2562 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2563 \else
2564 \pgfsetfillcolor{\tikz@fillcolor}
2565 \fi
2566 \pgfsetfillopacity{1.0}
2567 \pgfusepath{draw,fill}
2568 \endpgfscope
2569 }
2570 }
2571 % BNC connector
2572
2573 \pgfdeclareshape{bnc}{
2574 \anchor{center}{
2575 \pgfpointorigin
2576 }
2577 % BNC size is 2.5 times the size of the internal "ocirc"
2578 \savedanchor\northwest{%
2579 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2580 \pgf@y=2.5\pgf@y
2581 \pgf@x=-\pgf@y
2582 }
2583 % center is on the opening
2584 \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2585 \anchor{zero}{ \pgfpointorigin }
2586 \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2587 \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2588 % geo-anchors
2589 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2590 \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2591 \anchor{west}{ \northwest \pgf@y=0pt }
2592 \anchor{left}{ \northwest \pgf@y=0pt }
2593 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2594 \anchor{north}{ \northwest \pgf@x=0pt }
2595 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2596 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2597 \anchor{north west}{ \northwest }
2598 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2599 % put the node text above and centered
2600 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2601 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2602 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2603 }
2604 }
2605 \anchorborder{
2606 \pgf@circ@res@left=\pgf@x
2607 \pgf@circ@res@up=\pgf@y
2608 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2609 }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2610 }
2611 \behindforegroundpath{
2612 \pgfextracty{\pgf@circ@res@other}{\northwest}
2613 \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
2614 \pgfscope
2615 \pgfstartlinewidth=\pgflinewidth
2616 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
2617 \pgfsetcolor{\ctikzvalof{color}}
2618 % external circle
2619 \pgfscope
2620 % clipping path: first a rectangle bigger then the shape
2621 % to avoid problems with the line thickness
2622 \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
2623 {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
2624 % next the opening to the right
2625 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
2626 {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
2627 % do the difference and clip before drawing
2628 \pgfseteorule
2629 \pgfusepath{clip}
2630 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
2631 \pgfusepath{draw}
2632 \endpgfscope
2633 % internal circle
2634 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
2635 \pgf@circ@draworfill
2636 % and the contact line to the right
2637 \pgfsetlinewidth{\pgfstartlinewidth}
2638 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2639 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
2640 \pgfusepath{draw}
2641 \endpgfscope
2642 }
2643 }
2644
2645 %% Fill for correct rectangular joins
2646
2647 \pgfdeclareshape{rectjoinfill}{
2648 \savedanchor{\northeast}{%
2649 \pgf@x=.5\pgflinewidth%
2650 \pgf@y=.5\pgflinewidth%
2651 }
2652 \anchor{north}{\northeast\pgf@x=0cm\relax}
2653 \anchor{east}{\northeast\pgf@y=0cm\relax}
2654 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2655 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2656 \anchor{north east}{\northeast}
2657 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2658 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2659 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2660 \anchor{center}{
2661 \pgfpointorigin
2662 }
2663 \anchorborder{
2664 \pgf@circ@res@left=\pgf@x
2665 \pgf@circ@res@up=\pgf@y
2666 }
2667 \behindforegroundpath{
2668 \pgfscope
2669 \pgfpathrectanglecorners
2670 {\pgfpoint{0}{.5\pgflinewidth}}
2671 {\pgfpoint{0}{-.5\pgflinewidth}}
2672 \pgfsetcolor{\ctikzvalof{color}}
2673 \pgfusepath{draw,fill}
2674 \endpgfscope
2675 }
2676 }
2677
2678 %% transistor arrow
2679
2680 \def\pgf@circ@find@linescale{
2681 % find the scale inverse of the scale factor: line width do not scale
2682 % with scale=..., transform shape so we have to counteract it.
2683 \iftikz@fullytransformed % this is true if `transform shape` is active
2684 % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
2685 % Note that this trick is not working inside a `spy` environment...
2686 \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
2687 \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}%
2688 \else
2689 \pgfmathsetmacro{\@@factor}{1.0}
2690 \fi
2691 }
2692
2693 \pgfdeclareshape{trarrow}{%
2694 % this arrow is only filled but grows with the linewidth, more or less
2695 % like currarrow do
2696 \savedanchor{\northeast}{%
2697 \pgf@circ@res@step = \pgf@circ@Rlen
2698 \pgf@circ@find@linescale
2699 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2700 \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth}
2701 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2702 }
2703 % The arrow size should be more or less the same of a currarrow, which is
2704 % both filled and stroke, for backward output compatibility (more or less)
2705 %
2706 % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale}
2707 % |-\__ currarrow as the tip at (W,0)
2708 % | | and the upper tail at (-0.7*W, 0.8*W)
2709 % | \__ it then "overshoot" do to the linew width L
2710 % | \__ xangle \alpha
2711 % ---0------->
2712 %
2713 % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
2714 % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
2715 % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
2716 %
2717 \savedanchor{\northwest}{%
2718 \pgf@circ@res@step = \pgf@circ@Rlen
2719 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2720 \pgf@circ@find@linescale
2721 \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth}
2722 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2723 }
2724 \savedanchor{\tip}{%
2725 \pgf@circ@res@step = \pgf@circ@Rlen
2726 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2727 \pgf@circ@find@linescale
2728 \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt}
2729 }
2730 \anchor{north}{\northeast\pgf@x=0cm\relax}
2731 \anchor{east}{\northeast\pgf@y=0cm\relax}
2732 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2733 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2734 \anchor{north east}{\northeast}
2735 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2736 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2737 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2738 \anchor{center}{
2739 \pgfpointorigin
2740 }
2741 \anchor{tip}{
2742 \tip
2743 }
2744 \anchor{btip}{% this anchor is behind the tip of half a linewidth
2745 \tip
2746 \pgf@circ@find@linescale
2747 \pgf@circ@res@temp=\@@factor\pgflinewidth
2748 \advance\pgf@x by -.5\pgf@circ@res@temp
2749 }
2750 \behindforegroundpath{
2751 \pgfscope
2752 \northwest
2753 \pgf@circ@res@up=\pgf@y
2754 \pgf@circ@res@left=\pgf@x
2755 \tip
2756 \pgf@circ@res@step = \pgf@x
2757 %
2758 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2759 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
2760 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2761 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
2762 \pgfpathclose
2763 \pgfsetcolor{\ctikzvalof{color}}
2764 \pgfusepath{fill} % just fill
2765 \endpgfscope
2766 }
2767 }
2768
2769 %% Current arrow
2770
2771 \pgfdeclareshape{currarrow}{
2772 \savedanchor{\northeast}{%
2773 \pgf@circ@res@step = \pgf@circ@Rlen
2774 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2775 \pgf@x=.5\pgf@circ@res@step
2776 \pgf@y=\pgf@x%
2777 }
2778 \anchor{north}{\northeast\pgf@x=0cm\relax}
2779 \anchor{east}{\northeast\pgf@y=0cm\relax}
2780 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2781 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2782 \anchor{north east}{\northeast}
2783 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2784 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2785 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2786 \anchor{center}{
2787 \pgfpointorigin
2788 }
2789 \anchor{tip}{
2790 \pgfpointorigin
2791 \pgf@circ@res@step = \pgf@circ@Rlen
2792 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2793 \pgf@x =\pgf@circ@res@step
2794 }
2795 \behindforegroundpath{
2796 \pgfscope
2797 \pgf@circ@res@step = \pgf@circ@Rlen
2798 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2799
2800 \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2801 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2802 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2803 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2804 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2805 \pgfsetcolor{\ctikzvalof{color}}
2806 \pgfusepath{draw,fill}
2807
2808 \endpgfscope
2809 }
2810 }
2811
2812 %% Flow arrow
2813
2814 \pgfdeclareshape{flowarrow}{
2815 \savedanchor{\northeast}{%
2816 \pgf@circ@res@step = \pgf@circ@Rlen
2817 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2818 \pgf@y=.5\pgf@circ@res@step
2819 \pgf@circ@res@step = \pgf@circ@Rlen
2820 \divide \pgf@circ@res@step by 4
2821 \pgf@x=\pgf@circ@res@step%
2822 }
2823 \anchor{north}{\northeast\pgf@x=0cm\relax}
2824 \anchor{east}{\northeast\pgf@y=0cm\relax}
2825 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2826 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2827 \anchor{north east}{\northeast}
2828 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2829 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2830 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2831 \anchor{text}{% text centered above
2832 \pgfpointorigin
2833 \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
2834 }
2835 \anchor{center}{
2836 \pgfpointorigin
2837 }
2838 \anchor{tip}{
2839 \pgfpointorigin
2840 \pgf@circ@res@step = \pgf@circ@Rlen
2841 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2842 \pgf@x =\pgf@circ@res@step
2843 }
2844 \behindforegroundpath{
2845 \pgfscope
2846 \pgf@circ@res@step = \pgf@circ@Rlen
2847 \divide \pgf@circ@res@step by 4
2848 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
2849 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2850 \pgfsetcolor{\ctikzvalof{color}}
2851 \pgfusepath{draw}
2852 \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
2853 \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
2854 \endpgfscope
2855 }
2856 }
2857
2858 %% Input arrow
2859
2860 \pgfdeclareshape{inputarrow}{
2861 \savedanchor{\northeast}{% this is really not northeast, really -northwest
2862 \pgf@circ@res@step = \pgf@circ@Rlen
2863 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2864 \pgf@y=.5\pgf@circ@res@step
2865 \pgf@x=1.7\pgf@circ@res@step
2866 }
2867 \anchor{north}{\northeast\pgf@x=0cm\relax}
2868 \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
2869 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2870 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2871 \anchor{north east}{\northeast\pgf@x=0cm\relax}
2872 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2873 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
2874 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2875 \savedanchor{\tip}{
2876 \pgfpointorigin
2877 }
2878 \anchor{center}{
2879 \tip
2880 }
2881 \anchor{tip}{
2882 \tip
2883 }
2884 \behindforegroundpath{
2885
2886 \pgfscope
2887 \pgf@circ@res@step = \pgf@circ@Rlen
2888 \divide \pgf@circ@res@step by 16
2889
2890 \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2891 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2892 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
2893 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2894 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2895 \pgfsetcolor{\ctikzvalof{color}}
2896 \pgfusepath{fill}
2897
2898 \endpgfscope
2899 }
2900 }
2901
2902
2903 %% box
2904
2905 \pgfdeclareshape{box}{
2906 \anchor{center}{
2907 \pgfpointorigin
2908 }
2909 \behindforegroundpath{
2910
2911 \pgfscope
2912 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
2913 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2914 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2915 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2916 \pgf@circ@draworfill
2917 \endpgfscope
2918 }
2919 }
2920
2921 %% box scaled with blocks
2922
2923 \pgfdeclareshape{blockbox}{
2924 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}}
2925 \anchor{center}{
2926 \pgfpointorigin
2927 }
2928 \behindforegroundpath{
2929 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
2930 \pgfscope
2931 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
2932 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2933 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2934 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2935 \pgf@circ@draworfill
2936 \endpgfscope
2937 }
2938 }
2939
2940 % full nodes for wire crossing
2941
2942 \pgfdeclareshape{jump crossing}
2943 {
2944 \savedanchor\northwest{%
2945 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2946 \pgf@y=.5\pgf@y
2947 \pgf@x=-\pgf@y
2948 }
2949 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2950 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2951 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2952 \anchor{west}{ \northwest \pgf@y=0pt }
2953 \anchor{w}{ \northwest \pgf@y=0pt }
2954 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2955 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2956 \anchor{north}{ \northwest \pgf@x=0pt }
2957 \anchor{n}{ \northwest \pgf@x=0pt }
2958 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2959 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2960 \anchor{north west}{ \northwest }
2961 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2962 \behindbackgroundpath{
2963 \northwest
2964 \pgf@circ@res@up = \pgf@y
2965 \pgf@circ@res@down = -\pgf@y
2966 \pgf@circ@res@right = -\pgf@x
2967 \pgf@circ@res@left = \pgf@x
2968 % horizontal jumper
2969 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2970 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
2971 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
2972 \pgfsetbeveljoin
2973 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2974 % vertical, broken path
2975 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2976 \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
2977 \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
2978 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2979 \pgfusepath{draw}
2980
2981 }
2982 }
2983 \pgfdeclareshape{plain crossing}
2984 {
2985 \savedanchor\northwest{%
2986 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2987 \pgf@y=.5\pgf@y
2988 \pgf@x=-\pgf@y
2989 }
2990 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2991 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2992 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2993 \anchor{west}{ \northwest \pgf@y=0pt }
2994 \anchor{w}{ \northwest \pgf@y=0pt }
2995 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2996 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2997 \anchor{north}{ \northwest \pgf@x=0pt }
2998 \anchor{n}{ \northwest \pgf@x=0pt }
2999 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
3000 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
3001 \anchor{north west}{ \northwest }
3002 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
3003 \behindbackgroundpath{
3004 \northwest
3005 \pgf@circ@res@up = \pgf@y
3006 \pgf@circ@res@down = -\pgf@y
3007 \pgf@circ@res@right = -\pgf@x
3008 \pgf@circ@res@left = \pgf@x
3009 % horizontal jumper
3010 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3011 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
3012 % vertical, broken path
3013 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
3014 \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
3015 \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
3016 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
3017 \pgfusepath{draw}
3018
3019 }
3020 }
3021
3022 %%%---------- close: tex/pgfcircshapes
3023 %%%%%%%%%%% Springe nach tex/pgfcircmonopoles
3024 %%%---------- open: tex/pgfcircmonopoles.tex
3025 % Copyright 2007-2009 by Massimo Redaelli
3026 %
3027 % This file may be distributed and/or modified
3028 %
3029 % 1. under the LaTeX Project Public License and/or
3030 % 2. under the GNU Public License.
3031 %
3032 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
3033
3034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3035 %% Monopoles
3036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3037
3038 %%%%%%%%%%%%%
3039 %% Grounds
3040 %%%%%%%%%%%%%
3041
3042
3043 %% Ground symbol
3044 % #1 -> name
3045 % #2 -> width
3046 % #3 -> depth
3047 % #4 -> code
3048 \long\def\pgf@circ@declareground#1#2#3#4{
3049 \pgfdeclareshape{#1}{
3050 \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
3051 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3052 \savedanchor{\southeast}{
3053 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3054 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3055 \pgf@x=#2\pgf@x
3056 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3057 \pgf@y=-#3\pgf@y
3058 }
3059 \anchor{north}{\pgfpointorigin}
3060 \anchor{north east}{\southeast\pgf@y=0pt\relax}
3061 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
3062 \anchor{south east}{\southeast}
3063 \anchor{south}{\southeast\pgf@x=0pt\relax}
3064 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3065 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
3066 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
3067 \anchor{left}{\pgfpointorigin}
3068 \anchor{right}{\pgfpointorigin}
3069 \anchor{center}{\pgfpointorigin}
3070 \behindforegroundpath{
3071 \pgf@circ@scaled@Rlen=\scaledRlen
3072 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
3073 \pgfscope
3074 \pgfstartlinewidth=\pgflinewidth
3075 #4
3076 \endpgfscope
3077 }
3078 }
3079 }
3080
3081
3082 \pgf@circ@declareground{ground}{0.6}{1.6}{
3083 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3084 \pgfpathmoveto{\pgfpointorigin}
3085 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
3086 \pgfusepath{draw}
3087 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3088 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3089 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3090 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3091 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3092 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3093 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3094 \pgfusepath{draw}
3095 }
3096
3097 \pgf@circ@declareground{tlground}{0.6}{0.4}{
3098 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3099 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
3100 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
3101 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
3102 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
3103 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
3104 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
3105 \pgfusepath{draw}
3106 }
3107
3108
3109 \pgf@circ@declareground{rground}{0.6}{1}{
3110 \pgfpathmoveto{\pgfpointorigin}
3111 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3112 \pgfusepath{draw}
3113
3114 \pgfstartlinewidth=\pgflinewidth
3115 \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
3116
3117 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3118 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3119 \pgfsetroundcap\pgfusepath{draw}
3120 }
3121
3122 \pgf@circ@declareground{tground}{0.6}{0}{
3123 \pgfpathmoveto{\pgfpointorigin}
3124 \pgfusepath{draw}
3125
3126 \pgfstartlinewidth=\pgflinewidth
3127 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3128
3129 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
3130 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
3131 \pgfusepath{draw}
3132 }
3133
3134 \pgf@circ@declareground{sground}{0.6}{1.8}{
3135 \pgfpathmoveto{\pgfpointorigin}
3136 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3137 \pgfusepath{draw}
3138
3139 \pgfstartlinewidth=\pgflinewidth
3140 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3141
3142 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3143 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
3144 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
3145 \pgfpathclose
3146 \pgf@circ@draworfill
3147 }
3148
3149 % noiseless ground
3150 \pgf@circ@declareground{nground}{0.9}{1.6}{
3151 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3152 \pgfpathmoveto{\pgfpointorigin}
3153 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
3154 \pgfusepath{draw}
3155 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3156 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3157 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3158 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3159 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3160 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3161 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3162 \pgfusepath{draw}
3163 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
3164 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
3165 \pgfusepath{draw}
3166 }
3167
3168 % protective ground
3169 \pgf@circ@declareground{pground}{0.9}{1.8}{
3170 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3171 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
3172 \pgf@circ@draworfill
3173 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3174 \pgfpathmoveto{\pgfpointorigin}
3175 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
3176 \pgfusepath{draw}
3177 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3178 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3179 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3180 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3181 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
3182 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3183 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
3184 \pgfusepath{draw}
3185 }
3186
3187 % chassis ground
3188 \pgf@circ@declareground{cground}{1}{2}{
3189 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
3190 \pgfpathmoveto{\pgfpointorigin}
3191 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3192 \pgfusepath{draw}
3193 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
3194 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3195 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3196 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3197 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3198 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
3199 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
3200 \pgfusepath{draw}
3201 }
3202
3203 % Contributed by @fotesan https://github.com/fotesan
3204 % european ground
3205 \pgf@circ@declareground{eground}{1.1}{1.7}{
3206 \pgfpathmoveto{\pgfpointorigin}
3207 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3208 \pgfusepath{draw}
3209
3210 \pgfstartlinewidth=\pgflinewidth
3211 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3212
3213 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3214 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3215 \pgfusepath{draw}
3216
3217 \pgfsetlinewidth{\pgfstartlinewidth}
3218 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3219 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3220 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3221 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3222 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3223 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3224 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3225 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3226 \pgfusepath{draw}
3227 }
3228
3229 \pgf@circ@declareground{eground2}{1.1}{1.7}{
3230 \pgfpathmoveto{\pgfpointorigin}
3231 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
3232 \pgfusepath{draw}
3233
3234 \pgfstartlinewidth=\pgflinewidth
3235 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
3236
3237 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3238 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
3239 \pgfusepath{draw}
3240
3241 \pgfsetlinewidth{\pgfstartlinewidth}
3242 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3243 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3244 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3245 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3246 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
3247 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3248 \pgfusepath{draw}
3249 }
3250
3251 %%%%%%%%%%%%%%%%%%
3252 %% Power supplies
3253 %%%%%%%%%%%%%%%%%%
3254
3255 % Vcc
3256 \pgfdeclareshape{vcc}{
3257 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
3258 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3259 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
3260 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
3261 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
3262 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
3263 }
3264 \savedanchor{\northeast}{%
3265 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3266 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3267 \pgf@x=.5\pgf@circ@res@step
3268 \pgf@y=3\pgf@x%
3269 }
3270 \anchor{north}{\northeast\pgf@x=0cm\relax}
3271 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3272 \anchor{south}{\pgfpointorigin}
3273 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3274 \anchor{north east}{\northeast}
3275 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3276 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3277 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3278 \anchor{center}{\pgfpointorigin}
3279 \anchor{left}{\pgfpointorigin}
3280 \anchor{right}{\pgfpointorigin}
3281 \anchor{text}{
3282 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3283 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3284 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3285 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
3286 \pgf@x=0pt
3287 \pgf@y=2\pgf@circ@res@step
3288 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
3289 \pgf@x=-.5\wd\pgfnodeparttextbox
3290 }
3291 \behindforegroundpath{
3292 \pgf@circ@scaled@Rlen=\scaledRlen
3293 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3294 \pgfscope
3295 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
3296 \ifx\pgf@temp\pgf@circ@temp
3297 \pgfstartlinewidth=\pgflinewidth
3298 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3299
3300 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3301 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
3302 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
3303 \pgfusepath{draw}
3304
3305 \pgfsetlinewidth{\pgfstartlinewidth}
3306 \else
3307 \pgfsetarrowsend{\pgf@circ@temp}
3308 \fi
3309 \pgfpathmoveto{\pgfpointorigin}
3310 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
3311 \pgfusepath{draw}
3312 \endpgfscope
3313 }
3314 }
3315
3316 % Vee
3317 \pgfdeclareshape{vee}{
3318 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
3319 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3320 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
3321 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
3322 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
3323 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
3324 }
3325 \savedanchor{\northeast}{%
3326 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3327 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3328 \pgf@x=.5\pgf@circ@res@step
3329 \pgf@y=-3\pgf@x%
3330 }
3331 \anchor{south}{\northeast\pgf@x=0cm\relax}
3332 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3333 \anchor{north}{\pgfpointorigin}
3334 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3335 \anchor{south east}{\northeast}
3336 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
3337 \anchor{north east}{\northeast\pgf@y=0pt\relax}
3338 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3339 \anchor{center}{\pgfpointorigin}
3340 \anchor{left}{\pgfpointorigin}
3341 \anchor{right}{\pgfpointorigin}
3342 \anchor{text}{
3343 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3344 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3345 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3346 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3347 \pgf@x=0pt
3348 \pgf@y=-2\pgf@circ@res@step
3349 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
3350 \pgf@x=-.5\wd\pgfnodeparttextbox
3351 }
3352
3353 \behindforegroundpath{
3354 \pgf@circ@scaled@Rlen=\scaledRlen
3355 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3356 \pgfscope
3357 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
3358 \ifx\pgf@temp\pgf@circ@temp
3359
3360 \pgfstartlinewidth=\pgflinewidth
3361 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3362
3363 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3364 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
3365 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3366 \pgfusepath{draw}
3367 \pgfsetlinewidth{\pgfstartlinewidth}
3368 \else
3369 \pgfsetarrowsend{\pgf@circ@temp}
3370 \fi
3371 \pgfpathmoveto{\pgfpointorigin}
3372 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3373 \pgfusepath{draw}
3374 \endpgfscope
3375 }
3376 }
3377
3378 %%%%%%%%%%%%%%%%
3379 %% RF elements
3380 %%%%%%%%%%%%%%%%
3381
3382 % Legacy tlinestub
3383 % Contributed by Leonardo Azzinnari
3384 \pgfdeclareshape{tlinestub}{
3385 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3386 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3387 \savedanchor{\northeast}{%
3388 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3389 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3390 \pgf@x=1.2\pgf@circ@res@step
3391 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3392 \pgf@y=.2\pgf@circ@res@step%
3393 }
3394 % the center is on the left side of the shape for facility of usage
3395 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3396 \anchor{east}{\northeast\pgf@y=0cm\relax}
3397 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
3398 \anchor{west}{\pgfpointorigin}
3399 \anchor{north east}{\northeast}
3400 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3401 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3402 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
3403 \anchor{center}{\pgfpointorigin}
3404 \behindforegroundpath{
3405 \pgfstartlinewidth=\pgflinewidth
3406
3407 \pgf@circ@scaled@Rlen=\scaledRlen
3408 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3409 \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
3410
3411 \pgfscope\begin{pgftransparencygroup}
3412 \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}}
3413 \pgf@circ@maybefill
3414 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3415 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3416 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
3417 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
3418 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3419 \pgf@circ@draworfill
3420 \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}}
3421 \pgfusepath{draw}
3422 \end{pgftransparencygroup} \endpgfscope
3423 \pgfpathmoveto{\pgfpointorigin}
3424 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
3425 \pgfusepath{draw}
3426 }
3427 }
3428
3429 %% New antennas without tails
3430
3431 % main body of antennas
3432 \def\pgf@circ@antennabody{%
3433 \pgfstartlinewidth=\pgflinewidth
3434 \pgf@circ@scaled@Rlen=\scaledRlen
3435 \pgfsetcolor{\ctikzvalof{color}}
3436 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3437 \pgfscope
3438 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3439 \pgfpathmoveto{\pgfpointorigin}
3440 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
3441 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
3442 \pgfsetbeveljoin
3443 \pgfpathclose
3444 \pgf@circ@draworfill
3445 \endpgfscope
3446 \pgfsetlinewidth{\pgfstartlinewidth}
3447 \pgfpathmoveto{\pgfpointorigin}
3448 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
3449 \pgfusepath{draw}
3450 }
3451
3452 % Waves for the antennas.
3453 \def\pgf@circ@antennawaves{%
3454 \pgfscope
3455 % define a triangle for clipping the waves
3456 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3457 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
3458 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3459 \pgfpathclose
3460 \pgfusepath{clip}
3461 % ...and build the waves as clipped circles
3462 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3463 \pgfmathloop%
3464 \ifnum\pgf@circ@count@a>2
3465 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
3466 \advance\pgf@circ@count@a-1\relax%
3467 \repeatpgfmathloop
3468 \pgfusepath{draw}
3469 \endpgfscope
3470 }
3471
3472 % additional shape with the waves
3473 \pgfdeclareshape{waves}{
3474 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3475 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3476 \anchor{center}{\pgfpointorigin}
3477 \savedanchor{\northeast}{
3478 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3479 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3480 \pgf@x=\pgf@circ@res@step
3481 \pgf@y=\pgf@circ@res@step
3482 }
3483 \anchor{text}{
3484 \northeast
3485 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3486 }
3487 \anchor{top}{\northeast\pgf@x=0pt}
3488 \anchor{right}{\northeast\pgf@y=0pt}
3489 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3490 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3491 \anchor{north}{\northeast\pgf@x=0pt}
3492 \anchor{north east}{\northeast}
3493 \anchor{east}{\northeast\pgf@y=0pt}
3494 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3495 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3496 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
3497 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3498 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3499 \behindforegroundpath{
3500 \pgf@circ@scaled@Rlen=\scaledRlen
3501 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3502 \pgf@circ@res@step=0.5\pgf@circ@res@step
3503 \pgfsetcolor{\ctikzvalof{color}}
3504 \pgfscope
3505 % define a triangle for clipping the waves
3506 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
3507 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
3508 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
3509 \pgfpathclose
3510 \pgfusepath{clip}
3511 % ...and build the waves as clipped circles
3512 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3513 \pgfmathloop%
3514 \ifnum\c@pgf@counta>1
3515 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
3516 \advance\c@pgf@counta-1\relax%
3517 \repeatpgfmathloop
3518 \pgfusepath{draw}
3519 \endpgfscope
3520 }
3521 }
3522
3523 % the three types of antennas: simple, TX, RX. Notice that you can flip them...
3524
3525 \pgfdeclareshape{bareantenna}{
3526 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3527 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3528 \anchor{center}{\pgfpointorigin}
3529 \savedanchor{\northeast}{
3530 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3531 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3532 \pgf@x=\pgf@circ@res@step
3533 \pgf@y=2\pgf@circ@res@step
3534 }
3535 \anchor{text}{
3536 \northeast
3537 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3538 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3539 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3540 }
3541 \anchor{top}{\northeast\pgf@x=0pt}
3542 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3543 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3544 \anchor{bottom}{\pgfpointorigin}
3545 \anchor{north}{\northeast\pgf@x=0pt}
3546 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3547 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3548 \anchor{south}{\pgfpointorigin}
3549 \anchor{north east}{\northeast}
3550 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3551 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3552 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3553 \behindforegroundpath{
3554 \pgf@circ@antennabody
3555 }
3556 }
3557
3558 \pgfdeclareshape{bareTXantenna}{
3559 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3560 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3561 \anchor{center}{\pgfpointorigin}
3562 \savedanchor{\northeast}{
3563 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3564 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3565 \pgf@x=\pgf@circ@res@step
3566 \pgf@y=2\pgf@circ@res@step
3567 }
3568 \savedanchor{\savedwaves}{
3569 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3570 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3571 \pgf@x=4.2\pgf@circ@res@step
3572 \pgf@y=\pgf@circ@res@step
3573 }
3574 \anchor{text}{
3575 \northeast
3576 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3577 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3578 \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
3579 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3580 }
3581 \anchor{waves}{\savedwaves}
3582 \anchor{top}{\northeast\pgf@x=0pt}
3583 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3584 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3585 \anchor{bottom}{\pgfpointorigin}
3586 \anchor{north}{\northeast\pgf@x=0pt}
3587 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3588 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3589 \anchor{south}{\pgfpointorigin}
3590 \anchor{north east}{\northeast}
3591 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3592 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3593 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3594 \behindforegroundpath{
3595 \pgf@circ@antennabody
3596 \pgf@circ@antennawaves
3597 }
3598 }
3599
3600 \pgfdeclareshape{bareRXantenna}{
3601 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3602 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3603 \anchor{center}{\pgfpointorigin}
3604 \savedanchor{\northeast}{
3605 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3606 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3607 \pgf@x=\pgf@circ@res@step
3608 \pgf@y=2\pgf@circ@res@step
3609 }
3610 \savedanchor{\savedwaves}{
3611 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3612 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3613 \pgf@x=-4.2\pgf@circ@res@step
3614 \pgf@y=\pgf@circ@res@step
3615 }
3616 \anchor{text}{
3617 \northeast
3618 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3619 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3620 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3621 }
3622 \anchor{waves}{\savedwaves}
3623 \anchor{top}{\northeast\pgf@x=0pt}
3624 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3625 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3626 \anchor{bottom}{\pgfpointorigin}
3627 \anchor{north}{\northeast\pgf@x=0pt}
3628 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3629 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3630 \anchor{south}{\pgfpointorigin}
3631 \anchor{north east}{\northeast}
3632 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3633 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3634 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3635 \behindforegroundpath{
3636 \pgf@circ@antennabody
3637 \pgftransformxshift{-5.2\pgf@circ@res@step}
3638 \pgf@circ@antennawaves
3639 }
3640 }
3641
3642 % Microstrip monopoles
3643
3644 \pgfdeclareshape{mslstub}{
3645 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3646 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3647 \savedanchor{\southeast}{
3648 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3649 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3650 \pgf@x=.5\pgf@x
3651 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3652 \pgf@y=-.5\pgf@y
3653 }
3654 \savedanchor{\northwest}{
3655 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3656 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3657 \pgf@x=-.5\pgf@x
3658 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3659 \pgf@y=.5\pgf@y
3660 }
3661 \anchor{north}{\northwest\pgf@x=0pt\relax}
3662 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3663 \anchor{east}{\southeast\pgf@y=0pt\relax}
3664 \anchor{south east}{\southeast}
3665 \anchor{south}{\southeast\pgf@x=0pt\relax}
3666 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3667 \anchor{west}{\northwest\pgf@y=0pt\relax}
3668 \anchor{north west}{\northwest}
3669 %
3670 \anchor{center}{\northwest\pgf@y=0pt\relax}
3671 \anchor{left}{\northwest\pgf@y=0pt\relax}
3672 \anchor{right}{\southeast\pgf@y=0pt\relax}
3673 % put the node text above and centered
3674 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3675 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3676 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3677 }
3678 }
3679 \behindbackgroundpath{
3680 \pgfextracty{\pgf@circ@res@up}{\northwest}
3681 \pgfextractx{\pgf@circ@res@right}{\southeast}
3682 \pgfextractx{\pgf@circ@res@left}{\northwest}
3683 \pgfextracty{\pgf@circ@res@down}{\southeast}
3684 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3685 \pgfstartlinewidth=\pgflinewidth
3686 \pgfscope
3687 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3688 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3689 \pgf@circ@draworfill
3690 \endpgfscope
3691 }
3692 }
3693
3694 \pgfdeclareshape{msrstub}{
3695 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3696 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3697 \savedanchor{\southeast}{
3698 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3699 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3700 \pgf@x=.5\pgf@x
3701 \pgf@y=0pt\relax
3702 }
3703 \savedanchor{\northwest}{
3704 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3705 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3706 \pgf@x=-.5\pgf@x
3707 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
3708 \pgf@y=.5\pgf@y
3709 }
3710 \anchor{north}{\northwest\pgf@x=0pt\relax}
3711 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3712 \anchor{east}{\southeast\pgf@y=0pt\relax}
3713 \anchor{south east}{\southeast}
3714 \anchor{south}{\southeast\pgf@x=0pt\relax}
3715 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3716 \anchor{west}{\northwest\pgf@y=0pt\relax}
3717 \anchor{north west}{\northwest}
3718 %
3719 \anchor{center}{\pgfpointorigin}
3720 \anchor{left}{\pgfpointorigin}
3721 \anchor{right}{\pgfpointorigin}
3722 % put the node text above and centered
3723 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3724 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3725 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3726 }
3727 }
3728 \behindbackgroundpath{
3729 \pgfextracty{\pgf@circ@res@up}{\northwest}
3730 \pgfextractx{\pgf@circ@res@right}{\southeast}
3731 \pgfextractx{\pgf@circ@res@left}{\northwest}
3732 \pgfextracty{\pgf@circ@res@down}{\southeast}
3733 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3734 \pgfstartlinewidth=\pgflinewidth
3735 \pgfscope
3736 \pgfpathmoveto{\pgfpointorigin}
3737 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3738 \pgfusepath{draw}
3739 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3740 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
3741 \pgfpatharc{135}{45}{\pgf@circ@res@step}
3742 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
3743 \pgfpatharc{45}{135}{\pgf@circ@res@up}
3744 \pgfclosepath
3745 \pgf@circ@draworfill
3746 \endpgfscope
3747 }
3748 }
3749
3750 \pgfdeclareshape{msport}{
3751 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3752 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3753 \savedanchor{\southeast}{
3754 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3755 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3756 \pgf@x=.5\pgf@x
3757 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3758 \pgf@y=-.5\pgf@y
3759 }
3760 \savedanchor{\northwest}{
3761 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3762 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3763 \pgf@x=-.5\pgf@x
3764 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3765 \pgf@y=.5\pgf@y
3766 }
3767 \anchor{north}{\northwest\pgf@x=0pt\relax}
3768 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3769 \anchor{east}{\southeast\pgf@y=0pt\relax}
3770 \anchor{south east}{\southeast}
3771 \anchor{south}{\southeast\pgf@x=0pt\relax}
3772 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3773 \anchor{west}{\northwest\pgf@y=0pt\relax}
3774 \anchor{north west}{\northwest}
3775 %
3776 \anchor{center}{\northwest\pgf@y=0pt\relax}
3777 \anchor{left}{\northwest\pgf@y=0pt\relax}
3778 \anchor{right}{\southeast\pgf@y=0pt\relax}
3779 % put the node text above and centered
3780 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3781 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3782 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3783 }
3784 }
3785 \behindbackgroundpath{
3786 \pgfextracty{\pgf@circ@res@up}{\northwest}
3787 \pgfextractx{\pgf@circ@res@right}{\southeast}
3788 \pgfextractx{\pgf@circ@res@left}{\northwest}
3789 \pgfextracty{\pgf@circ@res@down}{\southeast}
3790 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
3791 \pgfstartlinewidth=\pgflinewidth
3792 \pgfscope
3793 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3794 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3795 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
3796 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3797 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3798 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
3799 \pgfpathclose
3800 \pgf@circ@draworfill
3801 \endpgfscope
3802 }
3803 }
3804
3805 % Legacy antennas (with tails)
3806 \def\pgf@circ@shift@antenna@xy#1#2{%
3807 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
3808 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
3809 \relax}
3810
3811 % Legacy antenna
3812 \pgfdeclareshape{antenna}{
3813 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3814 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3815 \anchor{center}{\pgfpointorigin}
3816 \savedanchor{\northeast}{
3817 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3818 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3819 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3820 \pgf@y=4\pgf@circ@res@step
3821 }
3822 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
3823 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
3824 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
3825 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
3826 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3827 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3828 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
3829 \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}}
3830 \anchor{text}{
3831 \northeast
3832 \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
3833 \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
3834 }
3835 \behindforegroundpath{
3836 \pgfstartlinewidth=\pgflinewidth
3837 \pgf@circ@scaled@Rlen=\scaledRlen
3838 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3839
3840 \pgftransformxshift{ -4\pgf@circ@res@step }
3841
3842 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3843 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3844
3845 \pgfusepath{draw}
3846
3847 \pgfscope
3848 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3849 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3850 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3851 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3852 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3853 \pgfsetcolor{\ctikzvalof{color}}
3854 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3855 \pgfusepath{draw}
3856 \endpgfscope
3857 \pgfsetlinewidth{\pgfstartlinewidth}
3858
3859 }
3860 }
3861
3862 % Legacy TX antenna
3863 \pgfdeclareshape{txantenna}{
3864 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3865 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3866 \anchor{center}{\pgfpointorigin}
3867 \savedanchor{\northeast}{
3868 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3869 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3870 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3871 \pgf@y=4\pgf@circ@res@step
3872 }
3873 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3874 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3875 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3876 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3877 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
3878 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3879 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3880 \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}}
3881 \anchor{text}{
3882 \northeast
3883 \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
3884 \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
3885 }
3886 \behindforegroundpath{
3887 \pgfstartlinewidth=\pgflinewidth
3888 \pgf@circ@scaled@Rlen=\scaledRlen
3889 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
3890
3891 \pgfpathmoveto{\pgfpointorigin}
3892 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3893 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3894 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3895
3896 \pgfusepath{draw}
3897
3898 \pgfscope
3899 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3900 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3901 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3902 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3903 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3904 \pgfsetcolor{\ctikzvalof{color}}
3905 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3906 \pgfusepath{draw}
3907 \endpgfscope
3908 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
3909 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3910 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3911 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
3912 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3913 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
3914 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3915 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
3916 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
3917 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
3918 \pgfusepath{draw}
3919 \pgfsetlinewidth{\pgfstartlinewidth}
3920
3921 }
3922 }
3923
3924 % Legacy RX antenna
3925 \pgfdeclareshape{rxantenna}{
3926 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3927 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3928 \anchor{center}{\pgfpointorigin}
3929 \savedanchor{\northeast}{
3930 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3931 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3932 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3933 \pgf@y=4\pgf@circ@res@step
3934 }
3935 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3936 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3937 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3938 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3939 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
3940 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3941 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3942 \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}}
3943 \anchor{text}{
3944 \northeast
3945 \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
3946 \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
3947 }
3948 \behindforegroundpath{
3949 \pgfstartlinewidth=\pgflinewidth
3950 \pgf@circ@scaled@Rlen=\scaledRlen
3951 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
3952
3953 \pgfpathmoveto{\pgfpointorigin}
3954 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3955 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3956 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3957
3958 \pgfusepath{draw}
3959
3960 \pgfscope
3961 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3962 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3963 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3964 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3965 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3966 \pgfsetcolor{\ctikzvalof{color}}
3967 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3968 \pgfusepath{draw}
3969 \endpgfscope
3970
3971 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
3972 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3973 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3974 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
3975 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3976 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
3977 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3978 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
3979 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
3980 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
3981 \pgfusepath{draw}
3982 \pgfsetlinewidth{\pgfstartlinewidth}
3983 }
3984 }
3985
3986 % Legacy match
3987 \pgfdeclareshape{match}{
3988 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3989 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3990 \savedanchor{\northeast}{%
3991 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3992 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
3993 \pgf@x=2\pgf@circ@res@step
3994 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
3995 \pgf@y=.5\pgf@circ@res@step%
3996 }
3997 % the center is on the left side of the shape for facility of usage
3998 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3999 \anchor{east}{\northeast\pgf@y=0cm\relax}
4000 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
4001 \anchor{west}{\pgfpointorigin}
4002 \anchor{north east}{\northeast}
4003 \anchor{north west}{\northeast\pgf@x=0cm\relax}
4004 \anchor{south east}{\northeast\pgf@y=0pt\relax}
4005 \anchor{south west}{\pgfpointorigin}
4006 \anchor{center}{
4007 \pgfpointorigin
4008 }
4009 \anchor{text}{
4010 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
4011 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
4012 \pgf@x=1.5\pgf@x
4013 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
4014 \pgf@y=-1.5\ht\pgfnodeparttextbox
4015 }
4016 \behindforegroundpath{
4017 \pgf@circ@scaled@Rlen=\scaledRlen
4018 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
4019
4020 \pgfscope
4021 \pgfpathmoveto{\pgfpointorigin}
4022 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
4023 \pgfusepath{draw}
4024
4025 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
4026 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
4027 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
4028 \pgfusepath{fill}
4029
4030 \pgfsetlinewidth{\pgfstartlinewidth}
4031 \endpgfscope
4032 }
4033 }
4034
4035 %%%---------- close: tex/pgfcircmonopoles
4036 %%%%%%%%%%% Springe nach tex/pgfcircbipoles
4037 %%%---------- open: tex/pgfcircbipoles.tex
4038 % Copyright 2007-2009 by Massimo Redaelli
4039 %
4040 % This file may be distributed and/or modified
4041 %
4042 % 1. under the LaTeX Project Public License and/or
4043 % 2. under the GNU Public License.
4044 %
4045 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
4046
4047 %% Generic macro for defining a bipole shape
4048 % #1 - additional anchors
4049 % #2 - lower y-size of the bipole (from the center).
4050 % #3 - #shape is the name of the shape
4051 % #4 - upper y-size of the bipole (from the center)
4052 % #5 - width of the bipole
4053 % #6 - macros drawing the bipole
4054 %
4055 \long\def\pgfcircdeclarebipole{%
4056 \pgfcircdeclarebipolescaled{default}}
4057
4058 %% Generic macro for defining a bipole shape
4059 % #1 - scale factor
4060 % #2 - additional anchors
4061 % #3 - lower y-size of the bipole (from the center).
4062 % #4 - #shape is the name of the shape
4063 % #5 - upper y-size of the bipole (from the center)
4064 % #6 - width of the bipole
4065 % #7 - macros drawing the bipole
4066 %
4067 \long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
4068 \pgfdeclareshape{#4shape}{
4069 \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
4070 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
4071 \savedanchor{\northeast}{
4072 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4073 \pgf@y=#5\pgf@circ@scaled@Rlen
4074 \pgf@y=.5\pgf@y
4075 \pgf@x=#6\pgf@circ@scaled@Rlen
4076 \pgf@x=.5\pgf@x
4077 }
4078 \savedanchor{\northeastborder}{
4079 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4080 \pgf@y=#5\pgf@circ@scaled@Rlen
4081 \pgf@y=.5\pgf@y
4082 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
4083 \pgf@x=#6\pgf@circ@scaled@Rlen
4084 \pgf@x=.5\pgf@x
4085 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
4086 }
4087 \savedanchor{\southwestborder}{
4088 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4089 \pgf@y=-#3\pgf@circ@scaled@Rlen
4090 \pgf@y=.5\pgf@y
4091 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
4092 \pgf@x=-#6\pgf@circ@scaled@Rlen
4093 \pgf@x=.5\pgf@x
4094 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
4095 }
4096 \savedanchor{\southwest}{
4097 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4098 \pgf@y=-#3\pgf@circ@scaled@Rlen
4099 \pgf@y=.5\pgf@y
4100 \pgf@x=-#6\pgf@circ@scaled@Rlen
4101 \pgf@x=.5\pgf@x
4102 }
4103 \savedanchor{\centerpoint}{
4104 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4105 \pgf@circ@res@down=-#3\pgf@circ@scaled@Rlen
4106 \pgf@circ@res@up=#5\pgf@circ@scaled@Rlen
4107 \pgfpointorigin
4108 \pgf@y=\pgf@circ@res@up
4109 \advance\pgf@y by\pgf@circ@res@down
4110 \pgf@y=.5\pgf@y
4111 }
4112 \anchor{center}{\pgfpointorigin}
4113 \anchor{n}{
4114 \northeast
4115 \pgf@x=0cm
4116 }
4117 \anchor{north east}{
4118 \northeast
4119 }
4120 \anchor{north west}{
4121 \northeast
4122 \pgf@x=-\pgf@x
4123 }
4124 \anchor{ne}{
4125 \northeast
4126 }
4127 \anchor{nw}{
4128 \northeast
4129 \pgf@x=-\pgf@x
4130 }
4131 \anchor{e}{
4132 \northeast
4133 \pgf@y=0cm
4134 }
4135 \anchor{s}{
4136 \southwest
4137 \pgf@x=0cm
4138 }
4139 \anchor{south east}{
4140 \southwest
4141 \pgf@x=-\pgf@x
4142 }
4143 \anchor{south west}{
4144 \southwest
4145 }
4146 \anchor{se}{
4147 \southwest
4148 \pgf@x=-\pgf@x
4149 }
4150 \anchor{sw}{
4151 \southwest
4152 }
4153 \anchor{w}{
4154 \southwest
4155 \pgf@y=0cm
4156 }
4157 \anchor{north}{
4158 \northeast
4159 \pgf@x=0cm
4160 }
4161 \anchor{east}{
4162 \northeast
4163 \pgf@y=0cm
4164 }
4165 \anchor{south}{
4166 \southwest
4167 \pgf@x=0cm
4168 }
4169 \anchor{west}{
4170 \southwest
4171 \pgf@y=0cm
4172 }
4173 \anchor{right}{
4174 \northeast
4175 \pgf@y=0cm
4176 }
4177 \anchor{above}{
4178 \northeast
4179 \pgf@x=0cm
4180 }
4181 \anchor{left}{
4182 \southwest
4183 \pgf@y=0cm
4184 }
4185 \anchor{below}{
4186 \southwest
4187 \pgf@x=0cm
4188 }
4189 \anchor{a}{
4190 \northeast
4191 \pgf@y=0cm
4192 }
4193 \anchor{b}{
4194 \southwest
4195 \pgf@y=0cm
4196 }
4197 \savedanchor{\textanchor}{%
4198 \pgf@y=\ht\pgfnodeparttextbox
4199 \pgf@x=-.5\wd\pgfnodeparttextbox
4200 }
4201 \anchor{text}{
4202 \textanchor
4203 }
4204 \anchorborder{%
4205 \ifpgf@circuit@bipole@inverted
4206 \pgf@circ@res@left=-\pgf@x
4207 \pgf@circ@res@right=-\pgf@y
4208 \else
4209 \pgf@circ@res@left=\pgf@x
4210 \pgf@circ@res@right=\pgf@y
4211 \fi
4212 \ifdim\pgf@circ@res@right>0cm
4213 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
4214 \else
4215 \southwestborder
4216 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
4217 \fi
4218 }
4219
4220 #2
4221
4222 \backgroundpath{
4223 \pgfsetcolor{\ctikzvalof{color}}
4224
4225 \northeast
4226 \pgf@circ@res@up = \pgf@y
4227 \pgf@circ@res@zero = 0cm
4228 \pgf@circ@res@left = -\pgf@x
4229 \pgf@circ@res@right = \pgf@x
4230 \southwest
4231 \pgf@circ@res@down = \pgf@y
4232 \pgf@circ@scaled@Rlen=\scaledRlen
4233 \pgfstartlinewidth=\pgflinewidth
4234 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
4235 #7
4236
4237 \pgfsetlinewidth{\pgfstartlinewidth}
4238 }
4239 }
4240 }
4241
4242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4243 %% Standard bipole shapes declarations
4244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4245
4246 %%%%%%%%%%%%%%%%%%%%%%%%
4247 % Resistive components
4248 %%%%%%%%%%%%%%%%%%%%%%%%
4249
4250 %% Short circuit
4251
4252 %%% NOTICE that the short is really NOT drawn; we trust the fact that its
4253 %%% natural length is zero.
4254 \pgfcircdeclarebipole
4255 {}
4256 {0}
4257 {short}
4258 {0}
4259 {0}
4260 { }
4261
4262 %% Open circuit
4263 \pgfcircdeclarebipole
4264 {}
4265 {\ctikzvalof{bipoles/open/height}}
4266 {open}
4267 {\ctikzvalof{bipoles/open/height}}
4268 {\ctikzvalof{bipoles/open/width}}
4269 { }
4270
4271 %% Generic bipole - used as resistor by some (bleah)
4272 \pgfcircdeclarebipolescaled{resistors}
4273 {}
4274 {\ctikzvalof{bipoles/generic/height}}
4275 {generic}
4276 {\ctikzvalof{bipoles/generic/height}}
4277 {\ctikzvalof{bipoles/generic/width}}
4278 {
4279 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4280 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4281 \pgf@circ@draworfill
4282 }
4283
4284 %% Generic empty tunable
4285 \pgfcircdeclarebipolescaled{resistors}
4286 {}
4287 {\ctikzvalof{bipoles/tgeneric/height}}
4288 {tgeneric}
4289 {\ctikzvalof{bipoles/tgeneric/height}}
4290 {\ctikzvalof{bipoles/tgeneric/width}}
4291 {
4292 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
4293 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4294 \pgf@circ@draworfill
4295 \pgfscope
4296 \pgfsetarrowsend{latexslim}
4297 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
4298 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
4299 \pgfusepath{draw}
4300 \endpgfscope
4301 }
4302
4303 %% Generic asymmetric bipole
4304 \pgfcircdeclarebipolescaled{resistors}
4305 {}
4306 {\ctikzvalof{bipoles/ageneric/height}}
4307 {ageneric}
4308 {\ctikzvalof{bipoles/ageneric/height}}
4309 {\ctikzvalof{bipoles/ageneric/width}}
4310 {
4311 \pgfscope
4312 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4313 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4314 \pgf@circ@draworfill
4315 \endpgfscope
4316
4317 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4318 \pgfusepath{stroke,fill}
4319 }
4320
4321 %% Memristor
4322 \pgfcircdeclarebipolescaled{resistors}
4323 {}
4324 {\ctikzvalof{bipoles/memristor/height}}
4325 {memristor}
4326 {\ctikzvalof{bipoles/memristor/height}}
4327 {\ctikzvalof{bipoles/memristor/width}}
4328 {
4329 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4330 \divide \pgf@circ@res@step by 14
4331
4332 \pgfscope
4333 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4334 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4335 \pgf@circ@draworfill
4336 \endpgfscope
4337 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4338 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
4339 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4340 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4341 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4342 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4343 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4344 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4345 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
4346 \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
4347
4348 \pgfusepath{draw}
4349
4350 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4351 \pgfusepath{stroke,fill}
4352 }
4353
4354 %% Photoresistor
4355 \pgfcircdeclarebipolescaled{resistors}
4356 {}
4357 {\ctikzvalof{bipoles/photoresistor/height 2}}
4358 {photoresistor}
4359 {\ctikzvalof{bipoles/photoresistor/height}}
4360 {\ctikzvalof{bipoles/photoresistor/width}}
4361 {
4362 \pgfscope
4363 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
4364 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4365 \pgf@circ@draworfill
4366 \endpgfscope
4367
4368 \pgfscope
4369 \pgfsetarrowsend{latexslim}
4370 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
4371 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4372 \pgfusepath{draw}
4373 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
4374 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4375 \pgfusepath{draw}
4376 \endpgfscope
4377 }
4378
4379 %% Thermistor
4380 \pgfcircdeclarebipolescaled{resistors}
4381 {{% anchor for labelling the type of dependency
4382 \anchor{label}{%
4383 \southwest
4384 \pgf@x=0.4\pgf@x
4385 \pgf@y=1.2\pgf@y
4386 }%
4387 }}
4388 {\ctikzvalof{bipoles/thermistor/height}}
4389 {thermistor}
4390 {\ctikzvalof{bipoles/thermistor/height}}
4391 {\ctikzvalof{bipoles/thermistor/width}}
4392 {
4393 \pgfscope
4394 \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}}
4395 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4396 \pgf@circ@draworfill
4397 \endpgfscope
4398
4399 %\pgfscope
4400 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
4401 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4402 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4403 \pgfusepath{draw}
4404 %\endpgfscope
4405 }
4406
4407 %% Thermistor PTC
4408 \pgfcircdeclarebipolescaled{resistors}
4409 {}
4410 {\ctikzvalof{bipoles/thermistorptc/height 2}}
4411 {thermistorptc}
4412 {\ctikzvalof{bipoles/thermistorptc/height}}
4413 {\ctikzvalof{bipoles/thermistorptc/width}}
4414 {
4415 \pgfscope
4416 \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}}
4417 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4418 \pgf@circ@draworfill
4419 \endpgfscope
4420 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4421 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4422 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4423 \pgfusepath{draw}
4424
4425 \pgfsetlinewidth{\pgfstartlinewidth}
4426 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4427 \pgfsetarrowsend{latexslim}
4428 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4429 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4430 \pgfusepath{draw}
4431 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4432 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4433 \pgfusepath{draw}
4434 }
4435
4436 %% Thermistor NTC
4437 \pgfcircdeclarebipolescaled{resistors}
4438 {}
4439 {\ctikzvalof{bipoles/thermistorntc/height 2}}
4440 {thermistorntc}
4441 {\ctikzvalof{bipoles/thermistorntc/height}}
4442 {\ctikzvalof{bipoles/thermistorntc/width}}
4443 {
4444 \pgfscope
4445 \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}}
4446 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4447 \pgf@circ@draworfill
4448 \endpgfscope
4449
4450 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4451 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4452 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4453 \pgfusepath{draw}
4454
4455 \pgfsetlinewidth{\pgfstartlinewidth}
4456 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4457 \pgfsetarrowsend{latexslim}
4458 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4459 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4460 \pgfusepath{draw}
4461 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4462 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4463 \pgfusepath{draw}
4464 }
4465
4466 %% Generic tunable
4467 \pgfcircdeclarebipolescaled{resistors}
4468 {
4469 \savedanchor{\wiper}{
4470 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4471 \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
4472 \pgf@y=.5\pgf@ya
4473 \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
4474 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
4475 }
4476 \anchor{wiper}{\wiper}
4477 \anchor{W}{\wiper}
4478 }
4479 {\ctikzvalof{bipoles/generic potentiometer/height 2}}
4480 {genericpotentiometer}
4481 {\ctikzvalof{bipoles/generic potentiometer/height}}
4482 {\ctikzvalof{bipoles/generic potentiometer/width}}
4483 {
4484
4485 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4486 \divide \pgf@circ@res@step by 14
4487
4488 \pgfscope
4489 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4490 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4491 \pgf@circ@draworfill
4492 \endpgfscope
4493 \pgfscope
4494 %\pgfsetlinewidth{\pgfstartlinewidth}
4495 \pgfsetarrowsend{latexslim}
4496 \pgfextractx{\pgf@circ@res@other}{\wiper}
4497 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4498 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4499 \pgfusepath{draw}
4500 \endpgfscope
4501 }
4502
4503 %% Zig zag resistores
4504 \def\pgf@circ@zigzag#1{%
4505 \divide \pgf@circ@res@step by \numexpr4*\zigs\relax
4506
4507 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
4508 \pgf@circ@res@other = \pgf@circ@res@left
4509 \pgf@circ@count@a=\zigs\relax
4510 % first half zig
4511 \advance\pgf@circ@res@other by \pgf@circ@res@step
4512 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4513 \pgfmathloop%
4514 \advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times
4515 \ifnum\pgf@circ@count@a>0
4516 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4517 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4518 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4519 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4520 \repeatpgfmathloop%
4521 % last zig and a half
4522 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4523 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4524 \advance\pgf@circ@res@other by \pgf@circ@res@step
4525 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
4526 \pgfsetbeveljoin
4527 \pgfusepath{draw}
4528 }
4529
4530 %% Resistor
4531 \pgfcircdeclarebipolescaled{resistors}
4532 {
4533 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4534 }
4535 {\ctikzvalof{bipoles/resistor/height}}
4536 {resistor}
4537 {\ctikzvalof{bipoles/resistor/height}}
4538 {\ctikzvalof{bipoles/resistor/width}}
4539 {
4540 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4541 \pgftransformationadjustments
4542 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4543 \pgf@circ@zigzag{1}
4544 }
4545
4546
4547 %% Variable resistor
4548 \pgfcircdeclarebipolescaled{resistors}
4549 {
4550 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4551 }
4552 {\ctikzvalof{bipoles/vresistor/height}}
4553 {vresistor}
4554 {\ctikzvalof{bipoles/vresistor/height}}
4555 {\ctikzvalof{bipoles/vresistor/width}}
4556 {
4557 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4558 \pgftransformationadjustments
4559 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4560 \pgf@circ@zigzag{.5}
4561
4562 \pgfscope
4563 \pgfsetarrowsend{latexslim}
4564 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4565 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4566 \pgfusepath{draw}
4567 \endpgfscope
4568 }
4569
4570 %% Potentiometer
4571 \pgfcircdeclarebipolescaled{resistors}
4572 {
4573 \savedanchor{\wiper}{
4574 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4575 \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
4576 \pgf@y=.5\pgf@ya
4577 \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
4578 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
4579 }
4580 \anchor{wiper}{\wiper}
4581 \anchor{W}{\wiper}
4582 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4583 }
4584 {\ctikzvalof{bipoles/potentiometer/height 2}}
4585 {potentiometer}
4586 {\ctikzvalof{bipoles/potentiometer/height}}
4587 {\ctikzvalof{bipoles/potentiometer/width}}
4588 {
4589 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4590 \pgftransformationadjustments
4591 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4592 \pgf@circ@zigzag{1}
4593
4594 \pgfscope
4595 %\pgfsetlinewidth{\pgfstartlinewidth}
4596 \pgfsetarrowsend{latexslim}
4597 \pgfextractx{\pgf@circ@res@other}{\wiper}
4598 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4599 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4600 \pgfusepath{draw}
4601 \endpgfscope
4602 }
4603
4604 %% Resistive sensor
4605 \pgfcircdeclarebipolescaled{resistors}
4606 {% anchor for labelling the type of dependency
4607 \anchor{label}{\southwest\pgf@x=0.4\pgf@x}%
4608 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4609 }
4610 {\ctikzvalof{bipoles/resistivesens/height}}
4611 {resistivesens}
4612 {\ctikzvalof{bipoles/resistivesens/height}}
4613 {\ctikzvalof{bipoles/resistivesens/width}}
4614 {%
4615 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4616 \pgftransformationadjustments
4617 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4618 \pgf@circ@zigzag{.5}
4619
4620 \pgfscope
4621 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4622 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4623 \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
4624 \pgfusepath{draw}
4625 \endpgfscope
4626 }
4627
4628 %%%%%%%%%%%%%%
4629 %% Capacitors
4630 %%%%%%%%%%%%%
4631
4632 %% Plain Capacitor
4633 \pgfcircdeclarebipolescaled{capacitors}
4634 {}
4635 {\ctikzvalof{bipoles/capacitor/height}}
4636 {capacitor}
4637 {\ctikzvalof{bipoles/capacitor/height}}
4638 {\ctikzvalof{bipoles/capacitor/width}}
4639 {
4640 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4641 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4642 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4643
4644 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4645 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4646 \pgfusepath{draw}
4647
4648 }
4649
4650 %% Capacitive sensor
4651 \pgfcircdeclarebipolescaled{capacitors}
4652 {
4653 \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}%
4654 }
4655 {\ctikzvalof{bipoles/capacitor/height}}
4656 {capacitivesens}
4657 {\ctikzvalof{bipoles/capacitor/height}}
4658 {\ctikzvalof{bipoles/capacitor/width}}
4659 {
4660 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4661 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4662 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4663
4664 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4665 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4666 \pgfusepath{draw}
4667 \pgfscope
4668 \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
4669 \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4670 \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4671 \pgfusepath{draw}
4672 \endpgfscope
4673 }
4674
4675 %% Polar Capacitor (DEPRECATED)
4676 \pgfcircdeclarebipolescaled{capacitors}
4677 {}
4678 {\ctikzvalof{bipoles/pcapacitor/height}}
4679 {polarcapacitor}
4680 {\ctikzvalof{bipoles/pcapacitor/height}}
4681 {\ctikzvalof{bipoles/pcapacitor/width}}
4682 {
4683 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4684
4685 \pgfscope
4686 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
4687 \pgftransformrotate{-90}
4688 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4689 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4690 \pgfusepath{draw}
4691 \endpgfscope
4692
4693 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4694 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4695 \pgfusepath{draw}
4696 }
4697
4698
4699 %% Curved capacitor
4700 % see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
4701 % for a rationale
4702 %
4703 \pgfcircdeclarebipolescaled{capacitors}
4704 {}
4705 {\ctikzvalof{bipoles/ccapacitor/height}}
4706 {ccapacitor}
4707 {\ctikzvalof{bipoles/ccapacitor/height}}
4708 {\ctikzvalof{bipoles/ccapacitor/width}}
4709 {
4710 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4711
4712 \pgfscope
4713 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
4714 \pgftransformrotate{-90}
4715 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4716 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4717 \pgfusepath{draw}
4718 \endpgfscope
4719
4720 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4721 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4722 \pgfusepath{draw}
4723 }
4724
4725
4726
4727
4728 %% Electrolytic Capacitor
4729 \pgfcircdeclarebipolescaled{capacitors}
4730 {}
4731 {\ctikzvalof{bipoles/ecapacitor/height}}
4732 {ecapacitor}
4733 {\ctikzvalof{bipoles/ecapacitor/height}}
4734 {\ctikzvalof{bipoles/ecapacitor/width}}
4735 {
4736 \pgfsetrectcap
4737 % % % Draw plus pole
4738 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4739 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4740 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
4741 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4742 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4743 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4744 \pgf@circ@draworfill
4745 % % Draw minus pole
4746 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4747 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4748 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
4749 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4750 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4751 \pgfsetfillcolor{\ctikzvalof{color}}
4752 \pgfusepath{draw,fill}
4753 \pgfsetfillcolor{\ctikzvalof{color}}
4754 % % plus pole annotation
4755 \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
4756 {\ctikzvalof{bipoles/ecapacitor/font} $+$}
4757 }
4758
4759 %% Variable Capacitor
4760 \pgfcircdeclarebipolescaled{capacitors}
4761 {}
4762 {\ctikzvalof{bipoles/vcapacitor/height}}
4763 {vcapacitor}
4764 {\ctikzvalof{bipoles/vcapacitor/height}}
4765 {\ctikzvalof{bipoles/vcapacitor/width}}
4766 {
4767 \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
4768
4769 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4770 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
4771 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
4772
4773 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4774 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4775 \pgfusepath{draw}
4776
4777 \pgfscope
4778 \pgfsetarrowsend{latexslim}
4779 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4780 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4781 \pgfusepath{draw}
4782 \endpgfscope
4783
4784 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4785 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
4786 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
4787 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
4788 \pgfsetlinewidth{\pgfstartlinewidth}
4789 \pgfusepath{draw}
4790 }
4791
4792
4793 %% Piezoelectric Element
4794
4795 \pgfcircdeclarebipolescaled{capacitors}
4796 {}
4797 {\ctikzvalof{bipoles/piezoelectric/height}}
4798 {piezoelectric}
4799 {\ctikzvalof{bipoles/piezoelectric/height}}
4800 {\ctikzvalof{bipoles/piezoelectric/width}}
4801 {
4802 % \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
4803 % \divide \pgf@circ@res@step by 5
4804
4805 %% Outer markings
4806 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4807 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4808 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4809
4810 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4811 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4812 \pgfusepath{draw}
4813
4814 %% Inner Box
4815 \pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10
4816 \pgfscope
4817 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4818 \pgfpathrectanglecorners
4819 {\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}}
4820 {\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}}
4821 \pgf@circ@draworfill
4822 \endpgfscope
4823 }
4824
4825 %%%%%%%%%%%%%%%
4826 %% Inductors
4827 %%%%%%%%%%%%%%%
4828
4829 %% cute inductor
4830 \pgfcircdeclarebipolescaled{inductors}
4831 {
4832 \savedanchor{\midtap}{%
4833 \pgf@x=0pt\relax
4834 \pgfmathsetlength{\pgf@y}{%
4835 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4836 \ctikzvalof{bipoles/cuteinductor/height} :% even
4837 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4838 *\pgf@circ@scaled@Rlen/2
4839 }
4840 }
4841 \anchor{midtap}{\midtap}
4842 }
4843 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
4844 {cuteinductor}
4845 {\ctikzvalof{bipoles/cuteinductor/height}}
4846 {\ctikzvalof{bipoles/cuteinductor/width}}
4847 {
4848 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4849 \pgftransformationadjustments
4850
4851 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4852 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
4853
4854
4855 \pgfmathsetlength{\pgf@circ@res@step}
4856 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
4857
4858 \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
4859 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
4860 {
4861 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4862 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4863 }
4864 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4865 \pgfsetbuttcap
4866 \pgfsetbeveljoin
4867 \pgfusepath{stroke}
4868 }
4869
4870 %% cute inductive sensor
4871 \pgfcircdeclarebipolescaled{inductors}
4872 {% anchor for labelling the type of dependency
4873 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
4874 \savedanchor{\midtap}{%
4875 \pgf@x=0pt\relax
4876 \pgfmathsetlength{\pgf@y}{%
4877 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4878 \ctikzvalof{bipoles/cuteinductor/height} :% even
4879 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4880 *\pgf@circ@scaled@Rlen/2
4881 }
4882 }
4883 \anchor{midtap}{\midtap}
4884 }
4885 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
4886 {scuteinductor}
4887 {\ctikzvalof{bipoles/cuteinductor/height}}
4888 {\ctikzvalof{bipoles/cuteinductor/width}}
4889 {
4890 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4891 \pgftransformationadjustments
4892
4893 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4894 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
4895
4896
4897 \pgfmathsetlength{\pgf@circ@res@step}
4898 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
4899
4900 \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
4901 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
4902 {
4903 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4904 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4905 }
4906 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4907 \pgfsetbuttcap
4908 \pgfsetbeveljoin
4909 \pgfusepath{stroke}
4910 \pgfscope
4911 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
4912 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4913 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4914 \pgfusepath{draw}
4915 \endpgfscope
4916 }
4917
4918 %% cute choke
4919 \pgfcircdeclarebipolescaled{inductors}
4920 {
4921 \savedanchor{\midtap}{%
4922 \pgf@x=0pt\relax
4923 \pgfmathsetlength{\pgf@y}{%
4924 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4925 \ctikzvalof{bipoles/cuteinductor/height} :% even
4926 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4927 *\pgf@circ@scaled@Rlen/2
4928 }
4929 }
4930 \anchor{midtap}{\midtap}
4931 }
4932 {\ctikzvalof{bipoles/cutechoke/lower coil height}}
4933 {cutechoke}
4934 {\ctikzvalof{bipoles/cutechoke/height}}
4935 {\ctikzvalof{bipoles/cutechoke/width}}
4936 {
4937 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4938 \pgftransformationadjustments
4939
4940 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4941 {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
4942
4943
4944 \pgfmathsetlength{\pgf@circ@res@step}
4945 {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
4946
4947 \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
4948 \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
4949 {
4950 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4951 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4952 }
4953 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4954 \pgfsetbuttcap
4955 \pgfsetbeveljoin
4956 \pgfusepath{stroke}
4957
4958 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4959 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4960 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4961 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
4962 \pgfusepath{stroke}
4963
4964 \ifpgf@circuit@bipole@twolineschoke
4965 \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}}
4966 \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}}
4967 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4968 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
4969 \pgfusepath{stroke}
4970 \fi
4971 }
4972
4973 %% variable cute inductor
4974 \pgfcircdeclarebipolescaled{inductors}
4975 {
4976 \savedanchor{\midtap}{%
4977 \pgf@x=0pt\relax
4978 \pgfmathsetlength{\pgf@y}{%
4979 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4980 \ctikzvalof{bipoles/cuteinductor/height} :% even
4981 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4982 *\pgf@circ@scaled@Rlen/2
4983 }
4984 }
4985 \anchor{midtap}{\midtap}
4986 }
4987 {\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
4988 {vcuteinductor}
4989 {\ctikzvalof{bipoles/vcuteinductor/height}}
4990 {\ctikzvalof{bipoles/vcuteinductor/width}}
4991 {
4992 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4993 \pgftransformationadjustments
4994
4995 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4996 {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
4997
4998
4999 \pgfmathsetlength{\pgf@circ@res@step}
5000 {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
5001
5002 \pgfscope
5003 \pgfsetarrowsend{latexslim}
5004 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
5005 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5006 \pgfusepath{draw}
5007 \endpgfscope
5008
5009 \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
5010 \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
5011 {
5012 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
5013 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
5014 }
5015 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
5016 \pgfsetbuttcap
5017 \pgfsetbeveljoin
5018 \pgfusepath{stroke}
5019 }
5020
5021 %% american inductor
5022 \pgfcircdeclarebipolescaled{inductors}
5023 {
5024 \savedanchor{\midtap}{%
5025 \pgf@x=0pt\relax
5026 \pgfmathsetlength{\pgf@y}{%
5027 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
5028 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
5029 0) %odd
5030 *\pgf@circ@scaled@Rlen/2
5031 }
5032 }
5033 \anchor{midtap}{\midtap}
5034 }
5035 {\ctikzvalof{bipoles/americaninductor/height 2}}
5036 {americaninductor}
5037 {\ctikzvalof{bipoles/americaninductor/height}}
5038 {\ctikzvalof{bipoles/americaninductor/width}}
5039 {
5040 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
5041 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5042 \pgftransformationadjustments
5043 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5044 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
5045 \divide \pgf@circ@res@step by 2
5046 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
5047
5048 \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
5049 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
5050 {
5051 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5052 }
5053 \pgfsetbuttcap
5054 \pgfsetbeveljoin
5055 \pgfusepath{stroke}
5056 }
5057
5058
5059 %% american inductive sensor
5060 \pgfcircdeclarebipolescaled{inductors}
5061 {% anchor for labelling the type of dependency
5062 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
5063 \savedanchor{\midtap}{%
5064 \pgf@x=0pt\relax
5065 \pgfmathsetlength{\pgf@y}{%
5066 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
5067 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
5068 0) %odd
5069 *\pgf@circ@scaled@Rlen/2
5070 }
5071 }
5072 \anchor{midtap}{\midtap}
5073 }
5074 {\ctikzvalof{bipoles/americaninductor/height 2}}
5075 {samericaninductor}
5076 {\ctikzvalof{bipoles/americaninductor/height}}
5077 {\ctikzvalof{bipoles/americaninductor/width}}
5078 {
5079 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
5080 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5081 \pgftransformationadjustments
5082 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5083 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
5084 \divide \pgf@circ@res@step by 2
5085 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
5086
5087 \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
5088 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
5089 {
5090 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5091 }
5092 \pgfsetbuttcap
5093 \pgfsetbeveljoin
5094 \pgfusepath{stroke}
5095 \pgfscope
5096 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
5097 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5098 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
5099 \pgfusepath{draw}
5100 \endpgfscope
5101 }
5102
5103 %% variable american inductor
5104 \pgfcircdeclarebipolescaled{inductors}
5105 {
5106 \savedanchor{\midtap}{%
5107 \pgf@x=0pt\relax
5108 \pgfmathsetlength{\pgf@y}{%
5109 (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
5110 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
5111 0) %odd
5112 *\pgf@circ@scaled@Rlen/2
5113 }
5114 }
5115 \anchor{midtap}{\midtap}
5116 }
5117 {\ctikzvalof{bipoles/vamericaninductor/height 2}}
5118 {vamericaninductor}
5119 {\ctikzvalof{bipoles/vamericaninductor/height}}
5120 {\ctikzvalof{bipoles/vamericaninductor/width}}
5121 {
5122 \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen
5123 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5124 \pgftransformationadjustments
5125 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
5126 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
5127 \divide \pgf@circ@res@step by 2
5128 \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen
5129
5130 \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
5131 \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
5132 {
5133 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
5134 }
5135 \pgfsetbuttcap
5136 \pgfsetbeveljoin
5137 \pgfusepath{stroke}
5138
5139 \pgfscope
5140 \pgfsetarrowsend{latexslim}
5141 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
5142 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
5143 \pgfusepath{draw}
5144 \endpgfscope
5145 }
5146
5147 %% Generic bipole, filled - used as inductor by some
5148 \pgfcircdeclarebipolescaled{inductors}
5149 {
5150 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5151 }
5152 {\ctikzvalof{bipoles/fullgeneric/height}}
5153 {fullgeneric}
5154 {\ctikzvalof{bipoles/fullgeneric/height}}
5155 {\ctikzvalof{bipoles/fullgeneric/width}}
5156 {
5157 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5158 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5159
5160 \pgfusepath{draw,fill}
5161 }
5162
5163 %% Generic sensor, filled - used as inductive sensor by some
5164 \pgfcircdeclarebipolescaled{inductors}
5165 {% anchor for labelling the type of dependency
5166 \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
5167 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5168 }
5169 {\ctikzvalof{bipoles/fullgeneric/height}}
5170 {sfullgeneric}
5171 {\ctikzvalof{bipoles/fullgeneric/height}}
5172 {\ctikzvalof{bipoles/fullgeneric/width}}
5173 {
5174
5175 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5176 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5177 \pgfusepath{draw,fill}
5178 %\pgfscope
5179 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
5180 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
5181 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
5182 \pgfusepath{draw}
5183 %\endpgfscope
5184 }
5185
5186 %% Generic full tunable
5187 \pgfcircdeclarebipolescaled{inductors}
5188 {
5189 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
5190 }
5191 {\ctikzvalof{bipoles/tfullgeneric/height}}
5192 {tfullgeneric}
5193 {\ctikzvalof{bipoles/tfullgeneric/height}}
5194 {\ctikzvalof{bipoles/tfullgeneric/width}}
5195 {
5196 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
5197 \divide \pgf@circ@res@step by 14
5198
5199 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
5200 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5201 \pgfusepath{draw,fill}
5202
5203 \pgfscope
5204 \pgfsetarrowsend{latexslim}
5205 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
5206 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
5207 \pgfusepath{draw}
5208 \endpgfscope
5209 }
5210
5211 %%%%%%%%%%%
5212 %% Battery
5213 %%%%%%%%%%%
5214
5215 %% Battery
5216 \pgfcircdeclarebipolescaled{batteries}
5217 {}
5218 {\ctikzvalof{bipoles/battery/height}}
5219 {battery}
5220 {\ctikzvalof{bipoles/battery/height}}
5221 {\ctikzvalof{bipoles/battery/width}}
5222 {
5223 \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen
5224 \divide \pgf@circ@res@step by 6
5225
5226 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5227
5228 \ifpgf@circ@fixbatteries
5229 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5230 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5231
5232 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
5233 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
5234
5235 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
5236 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
5237
5238 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5239 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5240 \else
5241 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5242 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5243
5244 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
5245 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
5246
5247 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5248 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5249
5250 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5251 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5252 \fi
5253 \pgfusepath{draw}
5254 }
5255
5256
5257 %% Battery 1 % poles with equl thickness
5258
5259 \pgfcircdeclarebipolescaled{batteries}
5260 {}
5261 {\ctikzvalof{bipoles/battery1/height}}
5262 {battery1}
5263 {\ctikzvalof{bipoles/battery1/height}}
5264 {\ctikzvalof{bipoles/battery1/width}}
5265 {
5266 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
5267 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5268 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
5269 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5270 \pgfusepath{draw}
5271
5272 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5273 \ifpgf@circ@fixbatteries
5274 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
5275 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
5276
5277 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5278 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5279 \else
5280 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5281 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5282
5283 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
5284 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
5285 \fi
5286 \pgfusepath{draw}
5287 }
5288
5289 %% Battery 2 % negative pole thicker
5290
5291 \pgfcircdeclarebipolescaled{batteries}
5292 {}
5293 {\ctikzvalof{bipoles/battery2/height}}
5294 {battery2}
5295 {\ctikzvalof{bipoles/battery2/height}}
5296 {\ctikzvalof{bipoles/battery2/width}}
5297 {
5298 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
5299 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5300 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
5301 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5302 \pgfusepath{draw}
5303
5304 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5305 \ifpgf@circ@fixbatteries
5306 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
5307 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
5308 \pgfusepath{draw}
5309 \pgfsetlinewidth{3\pgflinewidth}
5310 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
5311 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
5312 \else
5313 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
5314 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
5315 \pgfusepath{draw}
5316 \pgfsetlinewidth{3\pgflinewidth}
5317 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5318 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5319 \fi
5320 \pgfusepath{draw}
5321 }
5322
5323 %%%%%%%%%%%
5324 %% Round and diamond sources
5325 %%%%%%%%%%%
5326
5327 %% Independent voltage source
5328 \pgfcircdeclarebipolescaled{sources}
5329 {}
5330 {\ctikzvalof{bipoles/vsource/height}}
5331 {vsource}
5332 {\ctikzvalof{bipoles/vsource/height}}
5333 {\ctikzvalof{bipoles/vsource/width}}
5334 {
5335
5336 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5337
5338 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5339 \pgf@circ@draworfill
5340 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5341 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5342 \pgfusepath{draw}
5343 }
5344
5345 %% Independent voltage source - American style
5346 \pgfcircdeclarebipolescaled{sources}
5347 {}
5348 {\ctikzvalof{bipoles/vsourceam/height}}
5349 {vsourceAM}
5350 {\ctikzvalof{bipoles/vsourceam/height}}
5351 {\ctikzvalof{bipoles/vsourceam/width}}
5352 {
5353
5354 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5355 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5356 \pgf@circ@draworfill
5357 \pgfsetcolor{\ctikzvalof{color}}
5358 \ifpgf@circ@oldvoltagedirection
5359 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
5360 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
5361 \else
5362 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
5363 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
5364 \fi
5365 }
5366
5367 %% Independent sinusoidal voltage source
5368 \pgfcircdeclarebipolescaled{sources}
5369 {}
5370 {\ctikzvalof{bipoles/vsourcesin/height}}
5371 {vsourcesin}
5372 {\ctikzvalof{bipoles/vsourcesin/height}}
5373 {\ctikzvalof{bipoles/vsourcesin/width}}
5374 {
5375
5376 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5377 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5378 \pgf@circ@draworfill
5379
5380 \pgf@circ@res@up = .5\pgf@circ@res@up
5381 \pgfscope
5382 \pgftransformrotate{90}
5383 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5384 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5385 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5386 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5387 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5388 \pgfusepath{draw}
5389 \endpgfscope
5390 }
5391
5392 % Square Voltage source - contributed by Alistair Kwan
5393 \pgfcircdeclarebipolescaled{sources}
5394 {}
5395 {\ctikzvalof{bipoles/vsourcesquare/height}}
5396 {vsourcesquare}
5397 {\ctikzvalof{bipoles/vsourcesquare/height}}
5398 {\ctikzvalof{bipoles/vsourcesquare/width}}
5399 {
5400 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5401 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5402 \pgf@circ@draworfill
5403 \pgf@circ@res@up = .5\pgf@circ@res@up
5404 \pgfscope
5405 \pgftransformrotate{90}
5406 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5407 \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
5408 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
5409 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5410 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5411 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5412 \pgfusepath{draw}
5413 \endpgfscope
5414 }
5415
5416 % Triangle Voltage source - contributed by Ralf Farkas
5417 \pgfcircdeclarebipolescaled{sources}
5418 {}
5419 {\ctikzvalof{bipoles/vsourcetri/height}}
5420 {vsourcetri}
5421 {\ctikzvalof{bipoles/vsourcetri/height}}
5422 {\ctikzvalof{bipoles/vsourcetri/width}}
5423 {
5424
5425 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5426 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5427 \pgf@circ@draworfill
5428
5429 \pgf@circ@res@up = .5\pgf@circ@res@up
5430 \pgfscope
5431 \pgftransformrotate{90}
5432 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5433 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
5434 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
5435 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5436 \pgfusepath{draw}
5437 \endpgfscope
5438 }
5439
5440
5441 %% PV Source
5442 \pgfcircdeclarebipolescaled{sources}
5443 {}
5444 {\ctikzvalof{bipoles/pvsource/height}}
5445 {pvsource}
5446 {\ctikzvalof{bipoles/pvsource/height}}
5447 {\ctikzvalof{bipoles/pvsource/width}}
5448 {
5449 \pgfpointorigin
5450 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5451 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5452 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5453 \pgf@circ@draworfill
5454
5455 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
5456 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5457 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
5458 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5459 \pgfusepath{draw}
5460
5461 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5462 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
5463 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
5464
5465 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
5466 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
5467 \pgfusepath{draw}
5468
5469 %Arrow Part
5470 \pgfscope
5471 \pgfsetarrowsend{latex}
5472 \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5473 \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5474 \pgfusepath{draw}
5475 \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5476 \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5477 \pgfusepath{draw}
5478 \endpgfscope
5479
5480 }
5481
5482 %% Empty Source
5483 \pgfcircdeclarebipolescaled{sources}
5484 {}
5485 {\ctikzvalof{bipoles/esource/height}}
5486 {esource}
5487 {\ctikzvalof{bipoles/esource/height}}
5488 {\ctikzvalof{bipoles/esource/width}}
5489 {
5490 \pgfpointorigin
5491 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5492 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5493 \pgf@circ@draworfill
5494 }
5495
5496 %% DC Current Source with open shape
5497 \pgfcircdeclarebipolescaled{sources}
5498 {}
5499 {\ctikzvalof{bipoles/dcisource/height}}
5500 {dcisource}
5501 {\ctikzvalof{bipoles/dcisource/height}}
5502 {\ctikzvalof{bipoles/dcisource/width}}
5503 {
5504 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5505 \pgfpathmoveto{\pgfpointorigin}
5506 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5507 \pgf@circ@maybefill
5508 \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
5509 \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
5510 \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
5511 \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
5512 \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
5513 \pgfusepath{draw}
5514
5515 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5516 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5517 \pgfusepath{draw}
5518 \pgfscope
5519 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5520 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5521 \endpgfscope
5522 }
5523
5524 %% DC-Voltage source
5525 \pgfcircdeclarebipolescaled{sources}
5526 {}
5527 {\ctikzvalof{bipoles/dcvsource/height}}
5528 {dcvsource}
5529 {\ctikzvalof{bipoles/dcvsource/height}}
5530 {\ctikzvalof{bipoles/dcvsource/width}}
5531 {
5532 \pgfpointorigin
5533 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5534 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5535 \pgf@circ@draworfill
5536 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
5537 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
5538 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
5539 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
5540 \pgfusepath{draw}
5541 }
5542
5543 %% Independent current source
5544 \pgfcircdeclarebipolescaled{sources}
5545 {}
5546 {\ctikzvalof{bipoles/isource/height}}
5547 {isource}
5548 {\ctikzvalof{bipoles/isource/height}}
5549 {\ctikzvalof{bipoles/isource/width}}
5550 {
5551 \pgfpointorigin
5552 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5553 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5554 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5555 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5556 \pgf@circ@draworfill
5557 }
5558
5559 %% Independent double oo source
5560 \pgfcircdeclarebipolescaled{sources}
5561 {}
5562 {\ctikzvalof{bipoles/oosource/height}}
5563 {oosource}
5564 {\ctikzvalof{bipoles/oosource/height}}
5565 {\ctikzvalof{bipoles/oosource/width}}
5566 {
5567 \pgfpointorigin
5568 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5569 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5570 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5571 \pgf@circ@maybefill
5572 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
5573 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
5574 \pgf@circ@draworfill
5575 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5576 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5577 \pgfusepath{draw}
5578 }
5579
5580 %% Independent current source - American
5581 \pgfcircdeclarebipolescaled{sources}
5582 {}
5583 {\ctikzvalof{bipoles/isourceam/height}}
5584 {isourceAM}
5585 {\ctikzvalof{bipoles/isourceam/height}}
5586 {\ctikzvalof{bipoles/isourceam/width}}
5587 {
5588 \pgfpointorigin
5589 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5590 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5591 \pgf@circ@draworfill
5592
5593 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5594 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5595 \pgfusepath{draw}
5596 \pgfscope
5597 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5598 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5599 \endpgfscope
5600 }
5601
5602 %% Independent sinusoidal current source
5603 \pgfcircdeclarebipolescaled{sources}
5604 {}
5605 {\ctikzvalof{bipoles/isource/height}}
5606 {isourcesin}
5607 {\ctikzvalof{bipoles/isource/height}}
5608 {\ctikzvalof{bipoles/isource/width}}
5609 {
5610 \pgfpointorigin
5611 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5612 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5613 \pgf@circ@draworfill
5614
5615 \pgf@circ@res@up = .5\pgf@circ@res@up
5616 \pgfscope
5617 \pgftransformrotate{90}
5618 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5619 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5620 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5621 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5622 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5623 \pgfusepath{draw}
5624 \endpgfscope
5625 }
5626
5627 %% Empty controlled source
5628 \pgfcircdeclarebipolescaled{csources}
5629 {}
5630 {\ctikzvalof{bipoles/ecsource/height}}
5631 {ecsource}
5632 {\ctikzvalof{bipoles/ecsource/height}}
5633 {\ctikzvalof{bipoles/ecsource/width}}
5634 {
5635
5636 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5637
5638 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5639 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5640 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5641 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5642 \pgfpathclose
5643 \pgf@circ@draworfill
5644 }
5645
5646 %% Controlled voltage source
5647 \pgfcircdeclarebipolescaled{csources}
5648 {}
5649 {\ctikzvalof{bipoles/cvsource/height}}
5650 {cvsource}
5651 {\ctikzvalof{bipoles/cvsource/height}}
5652 {\ctikzvalof{bipoles/cvsource/width}}
5653 {
5654
5655 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5656
5657 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5658 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5659 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5660 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5661 \pgfpathclose
5662 \pgf@circ@draworfill
5663
5664 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5665 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5666 \pgfusepath{draw}
5667 }
5668
5669 %% Controlled voltage source - American
5670 \pgfcircdeclarebipolescaled{csources}
5671 {}
5672 {\ctikzvalof{bipoles/cvsourceam/height}}
5673 {cvsourceAM}
5674 {\ctikzvalof{bipoles/cvsourceam/height}}
5675 {\ctikzvalof{bipoles/cvsourceam/width}}
5676 {
5677 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5678 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5679 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5680 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5681 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5682 \pgfpathclose
5683 \pgf@circ@draworfill
5684
5685 \pgfsetcolor{\ctikzvalof{color}}
5686 \ifpgf@circ@oldvoltagedirection
5687 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
5688 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
5689 \else
5690 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
5691 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
5692 \fi
5693 }
5694
5695 %% Controlled sinusoidal voltage source
5696 \pgfcircdeclarebipolescaled{csources}
5697 {}
5698 {\ctikzvalof{bipoles/cvsourcesin/height}}
5699 {cvsourcesin}
5700 {\ctikzvalof{bipoles/cvsourcesin/height}}
5701 {\ctikzvalof{bipoles/cvsourcesin/width}}
5702 {
5703
5704 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5705
5706 \pgfscope
5707 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5708 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5709 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5710 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5711 \pgfpathclose
5712 \pgf@circ@draworfill
5713 \endpgfscope
5714
5715 \pgf@circ@res@up = .5\pgf@circ@res@up
5716 \pgfscope
5717 \pgftransformrotate{90}
5718 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5719 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5720 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5721 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5722 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5723 \pgfusepath{draw}
5724 \endpgfscope
5725 }
5726
5727 %% Controlled sinusoidal current source
5728 \pgfcircdeclarebipolescaled{csources}
5729 {}
5730 {\ctikzvalof{bipoles/cvsourcesin/height}}
5731 {cisourcesin}
5732 {\ctikzvalof{bipoles/cvsourcesin/height}}
5733 {\ctikzvalof{bipoles/cvsourcesin/width}}
5734 {
5735
5736 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5737
5738 \pgfscope
5739 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5740 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5741 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5742 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5743 \pgfpathclose
5744 \pgf@circ@draworfill
5745 \endpgfscope
5746
5747 \pgf@circ@res@up = .5\pgf@circ@res@up
5748 \pgfscope
5749 \pgftransformrotate{90}
5750 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5751 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5752 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5753 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5754 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5755 \pgfusepath{draw}
5756 \endpgfscope
5757 }
5758
5759 %% Controlled current source
5760 \pgfcircdeclarebipolescaled{csources}
5761 {}
5762 {\ctikzvalof{bipoles/cisource/height}}
5763 {cisource}
5764 {\ctikzvalof{bipoles/cisource/height}}
5765 {\ctikzvalof{bipoles/cisource/width}}
5766 {
5767
5768 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5769
5770 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5771 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5772 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5773 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5774 \pgfpathclose
5775 \pgf@circ@draworfill
5776
5777 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5778 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5779 \pgfusepath{draw}
5780 }
5781
5782 %% Controlled current source - American
5783 \pgfcircdeclarebipolescaled{csources}
5784 {}
5785 {\ctikzvalof{bipoles/cisourceam/height}}
5786 {cisourceAM}
5787 {\ctikzvalof{bipoles/cisourceam/height}}
5788 {\ctikzvalof{bipoles/cisourceam/width}}
5789 {
5790 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5791
5792 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5793 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5794 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5795 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5796 \pgfpathclose
5797 \pgf@circ@draworfill
5798 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5799 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5800 \pgfusepath{draw}
5801 \pgfscope
5802 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5803 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5804 \endpgfscope
5805 }
5806
5807 %% Cute Independent voltage source
5808 \pgfcircdeclarebipolescaled{sources}
5809 {}
5810 {\ctikzvalof{bipoles/vsource/height}}
5811 {vsourceC}
5812 {\ctikzvalof{bipoles/vsource/height}}
5813 {\ctikzvalof{bipoles/vsource/width}}
5814 {
5815 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5816 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5817 \pgf@circ@draworfill
5818 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5819 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5820 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5821 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5822 \pgfsetroundcap\pgfusepath{draw}
5823 }
5824
5825 %% Cute Independent current source
5826 \pgfcircdeclarebipolescaled{sources}
5827 {}
5828 {\ctikzvalof{bipoles/isource/height}}
5829 {isourceC}
5830 {\ctikzvalof{bipoles/isource/height}}
5831 {\ctikzvalof{bipoles/isource/width}}
5832 {
5833 \pgfpointorigin
5834 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5835 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5836 \pgf@circ@draworfill
5837 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5838 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5839 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
5840 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
5841 \pgfsetroundcap\pgfusepath{draw}
5842 }
5843
5844 %% Cute Controlled voltage source
5845 \pgfcircdeclarebipolescaled{csources}
5846 {}
5847 {\ctikzvalof{bipoles/cvsource/height}}
5848 {cvsourceC}
5849 {\ctikzvalof{bipoles/cvsource/height}}
5850 {\ctikzvalof{bipoles/cvsource/width}}
5851 {
5852 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5853 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5854 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5855 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5856 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5857 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5858 \pgf@circ@draworfill
5859 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5860 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5861 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5862 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5863 \pgfsetroundcap\pgfusepath{draw}
5864 }
5865
5866 %% Cute Controlled current source
5867 \pgfcircdeclarebipolescaled{csources}
5868 {}
5869 {\ctikzvalof{bipoles/cisource/height}}
5870 {cisourceC}
5871 {\ctikzvalof{bipoles/cisource/height}}
5872 {\ctikzvalof{bipoles/cisource/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 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5880 \pgf@circ@draworfill
5881 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5882 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5883 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
5884 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
5885 \pgfsetroundcap\pgfusepath{draw}
5886 }
5887
5888 %% Noise voltage source
5889 \pgfcircdeclarebipolescaled{sources}
5890 {}
5891 {\ctikzvalof{bipoles/vsource/height}}
5892 {vsourceN}
5893 {\ctikzvalof{bipoles/vsource/height}}
5894 {\ctikzvalof{bipoles/vsource/width}}
5895 {
5896 \pgfscope
5897 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5898 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5899 %
5900 \pgf@circ@scaled@Rlen=\scaledRlen
5901 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
5902 \edef\pgf@noise@temp{dashed}
5903 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
5904 \ifx\pgf@noise@temp\pgf@noise@fill
5905 % fillable in this case
5906 \pgf@circ@draworfillandclip
5907 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
5908 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
5909 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5910 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5911 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5912 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5913 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5914 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5915 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5916 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5917 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5918 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5919 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5920 %
5921 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
5922 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5923 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5924 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5925 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5926 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5927 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5928 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5929 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5930 \pgfusepath{draw}
5931 \else
5932 \pgfsetfillcolor{\pgf@noise@fill}
5933 \pgfusepath{draw,fill}
5934 \fi
5935 \endpgfscope
5936 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5937 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5938 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5939 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5940 \pgfsetroundcap\pgfusepath{draw}
5941 }
5942 %% Noise current source
5943
5944 \pgfcircdeclarebipolescaled{sources}
5945 {}
5946 {\ctikzvalof{bipoles/isource/height}}
5947 {isourceN}
5948 {\ctikzvalof{bipoles/isource/height}}
5949 {\ctikzvalof{bipoles/isource/width}}
5950 {
5951 \pgfpointorigin
5952 \pgfscope
5953 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5954 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5955 %
5956 \pgf@circ@scaled@Rlen=\scaledRlen
5957 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
5958 \edef\pgf@noise@temp{dashed}
5959 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
5960 \ifx\pgf@noise@temp\pgf@noise@fill
5961 % fillable in this case
5962 \pgf@circ@draworfillandclip
5963 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
5964 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
5965 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5966 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5967 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5968 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5969 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5970 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5971 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5972 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5973 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5974 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5975 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5976 %
5977 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
5978 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5979 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5980 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5981 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5982 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5983 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5984 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5985 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5986 \pgfusepath{draw}
5987 \else
5988 \pgfsetfillcolor{\pgf@noise@fill}
5989 \pgfusepath{draw,fill}
5990 \fi
5991 \endpgfscope
5992 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5993 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5994 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
5995 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
5996 \pgfsetroundcap\pgfusepath{draw}
5997 }
5998
5999 %%%%%%%%%%%%%%
6000 %% Diodes
6001 %%%%%%%%%%%%%%
6002
6003 %% Black generic diode
6004 \pgfcircdeclarebipolescaled{diodes}
6005 {}
6006 {\ctikzvalof{bipoles/diode/height}}
6007 {fulldiode}
6008 {\ctikzvalof{bipoles/diode/height}}
6009 {\ctikzvalof{bipoles/diode/width}}
6010 {
6011
6012 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6013
6014 \pgfscope
6015 \pgftransformxshift{\pgf@circ@res@left}
6016 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6017 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6018 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6019 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6020 \pgfusepath{draw,fill}
6021 \endpgfscope
6022 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6023 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6024 \pgfusepath{draw}
6025 }
6026
6027 %% Black Zener diode
6028 \pgfcircdeclarebipolescaled{diodes}
6029 {}
6030 {\ctikzvalof{bipoles/diode/height}}
6031 {fullzdiode}
6032 {\ctikzvalof{bipoles/diode/height}}
6033 {\ctikzvalof{bipoles/diode/width}}
6034 {
6035
6036 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6037
6038 \pgfscope
6039 \pgftransformxshift{\pgf@circ@res@left}
6040 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6041 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6042 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6043 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6044 \pgfusepath{draw,fill}
6045 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6046 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6047 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6048 \pgfusepath{draw}
6049 \endpgfscope
6050 }
6051
6052 %% Black alternative zigzag Zener diode
6053 \pgfcircdeclarebipolescaled{diodes}
6054 {}
6055 {\ctikzvalof{bipoles/diode/height}}
6056 {fullzzdiode}
6057 {\ctikzvalof{bipoles/diode/height}}
6058 {\ctikzvalof{bipoles/diode/width}}
6059 {
6060
6061 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6062
6063 \pgfscope
6064 \pgftransformxshift{\pgf@circ@res@left}
6065 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6066 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6067 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6068 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6069 \pgfusepath{draw,fill}
6070 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
6071 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6072 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6073 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
6074 \pgfusepath{draw}
6075 \endpgfscope
6076 }
6077
6078 %% Black Schottky diode
6079 \pgfcircdeclarebipolescaled{diodes}
6080 {}
6081 {\ctikzvalof{bipoles/diode/height}}
6082 {fullsdiode}
6083 {\ctikzvalof{bipoles/diode/height}}
6084 {\ctikzvalof{bipoles/diode/width}}
6085 {
6086
6087 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6088 \pgfscope
6089 \pgftransformxshift{\pgf@circ@res@left}
6090 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6091 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6092 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6093 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6094 \pgfusepath{draw,fill}
6095
6096 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
6097 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6098 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6099 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6100 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6101 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6102 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
6103 \pgfusepath{draw}
6104 \endpgfscope
6105
6106 }
6107
6108 %% Black tunnel diode
6109 \pgfcircdeclarebipolescaled{diodes}
6110 {}
6111 {\ctikzvalof{bipoles/diode/height}}
6112 {fulltdiode}
6113 {\ctikzvalof{bipoles/diode/height}}
6114 {\ctikzvalof{bipoles/diode/width}}
6115 {
6116
6117 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6118 \pgfscope
6119 \pgftransformxshift{\pgf@circ@res@left}
6120 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6121 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6122 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6123 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6124 \pgfusepath{draw,fill}
6125
6126 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6127 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6128 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6129 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6130 \pgfusepath{draw}
6131 \endpgfscope
6132 }
6133
6134 %% Black light emitting diode
6135 \pgfcircdeclarebipolescaled{diodes}
6136 {}
6137 {\ctikzvalof{bipoles/diode/height}}
6138 {fulllediode}
6139 {\ctikzvalof{bipoles/diode/height}}
6140 {\ctikzvalof{bipoles/diode/width}}
6141 {
6142
6143 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6144 \pgfscope
6145 \pgftransformxshift{\pgf@circ@res@left}
6146 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6147 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6148 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6149 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6150 \pgfusepath{draw,fill}
6151 \endpgfscope
6152 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6153 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6154 \pgfusepath{draw}
6155
6156 \pgfsetlinewidth{\pgfstartlinewidth}
6157 \pgfsetarrowsend{latexslim}
6158 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6159 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6160 \pgfusepath{draw}
6161 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6162 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6163 \pgfusepath{draw}
6164
6165 }
6166
6167 %% Black photodiode
6168 \pgfcircdeclarebipolescaled{diodes}
6169 {}
6170 {\ctikzvalof{bipoles/diode/height}}
6171 {fullpdiode}
6172 {\ctikzvalof{bipoles/diode/height}}
6173 {\ctikzvalof{bipoles/diode/width}}
6174 {
6175
6176 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6177 \pgfscope
6178 \pgftransformxshift{\pgf@circ@res@left}
6179 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6180 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6181 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6182 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6183 \pgfusepath{draw,fill}
6184 \endpgfscope
6185 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6186 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6187 \pgfusepath{draw}
6188
6189 \pgfsetlinewidth{\pgfstartlinewidth}
6190 \pgfsetarrowsstart{latexslim}
6191 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6192 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6193 \pgfusepath{draw}
6194 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6195 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6196 \pgfusepath{draw}
6197 }
6198
6199 %% Black varcap
6200 \pgfcircdeclarebipolescaled{diodes}
6201 {}
6202 {\ctikzvalof{bipoles/varcap/height}}
6203 {fullvarcap}
6204 {\ctikzvalof{bipoles/varcap/height}}
6205 {\ctikzvalof{bipoles/varcap/width}}
6206 {
6207 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
6208 \pgfsetlinewidth{\pgf@circ@res@temp}
6209 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6210 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6211 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6212 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6213 \pgfusepath{draw,fill}
6214 %
6215 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
6216 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
6217 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6218 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6219 \pgfusepath{draw}
6220 }
6221
6222 %% Code for the diode triangle
6223 \def\pgf@circ@basicdiodeshape{
6224 % \pgfscope
6225 \pgftransformxshift{\pgf@circ@res@left}
6226 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6227 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
6228 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6229 \pgfpathclose
6230 \pgf@circ@draworfill
6231 \pgfscope
6232 % to allow filling, we need to draw explicitly the stroke here.
6233 \pgfsetlinewidth{\pgfstartlinewidth}
6234 \ifpgf@circuit@bipole@strokedsymbol
6235 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
6236 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
6237 \pgfusepath{draw}
6238 \fi
6239 \endpgfscope
6240 % \endpgfscope
6241 }
6242
6243 %% Empty generic diode
6244 \pgfcircdeclarebipolescaled{diodes}
6245 {}
6246 {\ctikzvalof{bipoles/diode/height}}
6247 {emptydiode}
6248 {\ctikzvalof{bipoles/diode/height}}
6249 {\ctikzvalof{bipoles/diode/width}}
6250 {
6251 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6252 \pgfscope
6253 \pgf@circ@basicdiodeshape
6254 \endpgfscope
6255 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6256 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6257 \pgfusepath{draw}
6258 }
6259
6260 %% Empty Zener diode
6261 \pgfcircdeclarebipolescaled{diodes}
6262 {}
6263 {\ctikzvalof{bipoles/diode/height}}
6264 {emptyzdiode}
6265 {\ctikzvalof{bipoles/diode/height}}
6266 {\ctikzvalof{bipoles/diode/width}}
6267 {
6268
6269 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6270
6271 \pgfscope
6272 \pgf@circ@basicdiodeshape
6273 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6274 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6275 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6276 \pgfusepath{draw}
6277 \endpgfscope
6278 }
6279
6280 %% Empty alternative zigzag Zener diode
6281 \pgfcircdeclarebipolescaled{diodes}
6282 {}
6283 {\ctikzvalof{bipoles/diode/height}}
6284 {emptyzzdiode}
6285 {\ctikzvalof{bipoles/diode/height}}
6286 {\ctikzvalof{bipoles/diode/width}}
6287 {
6288
6289 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6290
6291 \pgfscope
6292 \pgf@circ@basicdiodeshape
6293 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
6294 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6295 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6296 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
6297 \pgfusepath{draw}
6298 \endpgfscope
6299 }
6300 %% Empty Schottky diode
6301 \pgfcircdeclarebipolescaled{diodes}
6302 {}
6303 {\ctikzvalof{bipoles/diode/height}}
6304 {emptysdiode}
6305 {\ctikzvalof{bipoles/diode/height}}
6306 {\ctikzvalof{bipoles/diode/width}}
6307 {
6308
6309 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6310 \pgfscope
6311 \pgf@circ@basicdiodeshape
6312 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
6313 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6314 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6315 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6316 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6317 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6318 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
6319 \pgfusepath{draw}
6320 \endpgfscope
6321
6322 }
6323
6324 %% Empty tunnel diode
6325 \pgfcircdeclarebipolescaled{diodes}
6326 {}
6327 {\ctikzvalof{bipoles/diode/height}}
6328 {emptytdiode}
6329 {\ctikzvalof{bipoles/diode/height}}
6330 {\ctikzvalof{bipoles/diode/width}}
6331 {
6332
6333 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6334 \pgfscope
6335 \pgf@circ@basicdiodeshape
6336 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6337 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6338 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6339 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6340 \pgfusepath{draw}
6341 \endpgfscope
6342 }
6343
6344 %% Empty light emitting diode
6345 \pgfcircdeclarebipolescaled{diodes}
6346 {}
6347 {\ctikzvalof{bipoles/diode/height}}
6348 {emptylediode}
6349 {\ctikzvalof{bipoles/diode/height}}
6350 {\ctikzvalof{bipoles/diode/width}}
6351 {
6352
6353 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6354 \pgfscope
6355 \pgf@circ@basicdiodeshape
6356 \endpgfscope
6357 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6358 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6359 \pgfusepath{draw}
6360
6361 \pgfsetlinewidth{\pgfstartlinewidth}
6362 \pgfsetarrowsend{latexslim}
6363 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6364 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6365 \pgfusepath{draw}
6366 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6367 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6368 \pgfusepath{draw}
6369 }
6370
6371 %% Empty photodiode
6372 \pgfcircdeclarebipolescaled{diodes}
6373 {}
6374 {\ctikzvalof{bipoles/diode/height}}
6375 {emptypdiode}
6376 {\ctikzvalof{bipoles/diode/height}}
6377 {\ctikzvalof{bipoles/diode/width}}
6378 {
6379
6380 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6381 \pgfscope
6382 \pgf@circ@basicdiodeshape
6383 \endpgfscope
6384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6385 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6386 \pgfusepath{draw}
6387
6388 \pgfsetlinewidth{\pgfstartlinewidth}
6389 \pgfsetarrowsstart{latexslim}
6390 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6391 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6392 \pgfusepath{draw}
6393 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6394 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6395 \pgfusepath{draw}
6396 }
6397
6398 %% Empty varcap
6399 \pgfcircdeclarebipolescaled{diodes}
6400 {}
6401 {\ctikzvalof{bipoles/varcap/height}}
6402 {emptyvarcap}
6403 {\ctikzvalof{bipoles/varcap/height}}
6404 {\ctikzvalof{bipoles/varcap/width}}
6405 {
6406 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
6407 \pgfsetlinewidth{\pgf@circ@res@temp}
6408 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6409 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6410 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6411 % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6412 \pgfpathclose
6413 \pgf@circ@draworfill
6414 \pgfscope
6415 % to allow filling, we need to draw explicitily the stroke here.
6416 \pgfsetlinewidth{\pgfstartlinewidth}
6417 \ifpgf@circuit@bipole@strokedsymbol
6418 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6419 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6420 \pgfusepath{draw}
6421 \fi
6422 \endpgfscope
6423 %
6424 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
6425 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
6426 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6427 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6428 \pgfusepath{draw}
6429 }
6430
6431 %% Empty bidirectionaldiode
6432 \pgfcircdeclarebipolescaled{diodes}
6433 {}
6434 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6435 {emptybidirectionaldiode}
6436 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6437 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6438 {
6439
6440 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6441
6442 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6443 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6444
6445 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6446 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6447 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6448 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6449
6450 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6451 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6452 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6453 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6454
6455 \pgf@circ@draworfill
6456
6457 \pgfsetlinewidth{\pgfstartlinewidth}
6458
6459 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6460 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6461
6462 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6463 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6464
6465 \pgfusepath{draw}
6466 }
6467
6468 %% Full bidirectionaldiode
6469 \pgfcircdeclarebipolescaled{diodes}
6470 {}
6471 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6472 {fullbidirectionaldiode}
6473 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6474 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6475 {
6476
6477 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6478
6479 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6480 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6481
6482 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6483 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6484 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6485 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6486
6487 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6488 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6489 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6490 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6491
6492 \pgfusepath{draw, fill}
6493
6494 \pgfsetlinewidth{\pgfstartlinewidth}
6495
6496 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6497 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6498
6499 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6500 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6501
6502 \pgfusepath{draw}
6503 }
6504
6505 %% Black thyristor
6506 \pgfcircdeclarebipolescaled{diodes}
6507 {
6508 \anchor{gate}{\northeast}
6509 \anchor{anode}{\southwest\pgf@y=0cm}
6510 \anchor{G}{\northeast}
6511 \anchor{cathode}{\northeast\pgf@y=0cm }
6512 }
6513 {\ctikzvalof{tripoles/thyristor/height 2}}
6514 {fullthyristor}
6515 {\ctikzvalof{tripoles/thyristor/height}}
6516 {\ctikzvalof{tripoles/thyristor/width}}
6517 {
6518
6519 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6520
6521 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6522 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6523
6524 \pgfscope
6525 \pgftransformxshift{\pgf@circ@res@other}
6526 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6527
6528 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6529 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6530 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6531 \pgfusepath{draw,fill}
6532
6533 \pgfsetlinewidth{\pgfstartlinewidth}
6534
6535 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6536 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6537 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6538 \pgfusepath{draw}
6539 \endpgfscope
6540
6541 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6542 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6543
6544 \pgfusepath{draw}
6545
6546 \pgfsetlinewidth{\pgfstartlinewidth}
6547
6548 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6549 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6550
6551 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6552 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6553
6554 \pgfusepath{draw}
6555
6556 }
6557
6558 %% Empty thyristor
6559
6560 \pgfcircdeclarebipolescaled{diodes}
6561 {
6562 \anchor{gate}{\northeast}
6563 \anchor{anode}{\southwest\pgf@y=0cm}
6564 \anchor{G}{\northeast}
6565 \anchor{cathode}{\northeast\pgf@y=0cm }
6566 }
6567 {\ctikzvalof{tripoles/thyristor/height 2}}
6568 {emptythyristor}
6569 {\ctikzvalof{tripoles/thyristor/height}}
6570 {\ctikzvalof{tripoles/thyristor/width}}
6571 {
6572
6573 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6574
6575 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6576 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6577
6578 \pgfscope
6579 \pgftransformxshift{\pgf@circ@res@other}
6580 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6581
6582 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6583 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6584 \pgfpathclose
6585 \pgf@circ@draworfill
6586 \pgfscope
6587 % to allow filling, we need to draw explicitily the stroke here.
6588 \pgfsetlinewidth{\pgfstartlinewidth}
6589 \ifpgf@circuit@bipole@strokedsymbol
6590 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6591 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
6592 \pgfusepath{draw}
6593 \fi
6594 \endpgfscope
6595
6596 \pgfsetlinewidth{\pgfstartlinewidth}
6597
6598 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6599 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6600 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6601 \pgfusepath{draw}
6602 \endpgfscope
6603
6604 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6605 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6606
6607 \pgfusepath{draw}
6608
6609 \pgfsetlinewidth{\pgfstartlinewidth}
6610
6611 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6612 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6613
6614 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6615 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6616
6617 \pgfusepath{draw}
6618 }
6619
6620 %% Empty triac
6621 \pgfcircdeclarebipolescaled{diodes}
6622 {
6623 \anchor{gate}{\northeast}
6624 \anchor{anode}{\southwest\pgf@y=0cm}
6625 \anchor{G}{\northeast}
6626 \anchor{cathode}{\northeast\pgf@y=0cm }
6627 }
6628 {\ctikzvalof{tripoles/triac/height}}
6629 {emptytriac}
6630 {\ctikzvalof{tripoles/triac/height}}
6631 {\ctikzvalof{tripoles/triac/width}}
6632 {
6633
6634 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6635
6636 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6637 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6638
6639 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6640 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6641 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6642 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6643
6644 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6645 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6646 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6647 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6648
6649 \pgf@circ@draworfill
6650
6651 \pgfsetlinewidth{\pgfstartlinewidth}
6652
6653 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6654 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6655 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6656
6657 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6658 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6659
6660 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6661 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6662
6663 \pgfusepath{draw}
6664 }
6665
6666 %% Full triac
6667 \pgfcircdeclarebipolescaled{diodes}
6668 {
6669 \anchor{gate}{\northeast}
6670 \anchor{anode}{\southwest\pgf@y=0cm}
6671 \anchor{G}{\northeast}
6672 \anchor{cathode}{\northeast\pgf@y=0cm }
6673 }
6674 {\ctikzvalof{tripoles/triac/height}}
6675 {fulltriac}
6676 {\ctikzvalof{tripoles/triac/height}}
6677 {\ctikzvalof{tripoles/triac/width}}
6678 {
6679 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6680
6681 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6682 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6683
6684 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6685 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6686 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6687 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6688
6689 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6690 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6691 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6692 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6693
6694 \pgfusepath{draw,fill}
6695
6696 \pgfsetlinewidth{\pgfstartlinewidth}
6697
6698 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6699 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6700 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6701
6702 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6703 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6704
6705 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6706 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6707
6708 \pgfusepath{draw}
6709 }
6710
6711 %%%%%%%%%%%%%
6712 %% switches
6713 %%%%%%%%%%%%%
6714
6715 %% (Closing) SPST
6716 \pgfcircdeclarebipolescaled{switches}
6717 {}
6718 {\ctikzvalof{bipoles/spst/depth}}
6719 {cspst}
6720 {\ctikzvalof{bipoles/spst/height}}
6721 {\ctikzvalof{bipoles/spst/width}}
6722 {
6723 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6724 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6725 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6726 \pgfusepath{draw}
6727
6728 \pgfscope
6729 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6730 \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
6731 \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
6732 \pgfsetarrowsend{latexslim}
6733 \pgfsetbeveljoin
6734 \pgfusepath{draw}
6735 \endpgfscope
6736 }
6737
6738 %% Opening SPST
6739 \pgfcircdeclarebipolescaled{switches}
6740 {}
6741 {\ctikzvalof{bipoles/spst/depth}}
6742 {ospst}
6743 {\ctikzvalof{bipoles/spst/height}}
6744 {\ctikzvalof{bipoles/spst/width}}
6745 {
6746
6747 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6748 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6749 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6750 \pgfusepath{draw}
6751
6752 \pgfscope
6753 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6754 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
6755 \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
6756 \pgfsetarrowsend{latexslim}
6757 \pgfsetbeveljoin
6758 \pgfusepath{draw}
6759 \endpgfscope
6760 }
6761
6762 %% Normal open Switch
6763 \pgfcircdeclarebipolescaled{switches}
6764 {}
6765 {\ctikzvalof{bipoles/nos/depth}}
6766 {nos}
6767 {\ctikzvalof{bipoles/nos/height}}
6768 {\ctikzvalof{bipoles/nos/width}}
6769 {
6770
6771 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6772 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6773 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6774 \pgfsetbuttcap
6775 \pgfusepath{draw}
6776 }
6777
6778 %% Normal closed Switch
6779 \pgfcircdeclarebipolescaled{switches}
6780 {}
6781 {\ctikzvalof{bipoles/ncs/depth}}
6782 {ncs}
6783 {\ctikzvalof{bipoles/ncs/height}}
6784 {\ctikzvalof{bipoles/ncs/width}}
6785 {
6786 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6787 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6788 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6789 \pgfusepath{draw}
6790 \pgfsetlinewidth{\pgfstartlinewidth}
6791 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6792 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
6793 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
6794 \pgfusepath{draw}
6795 }
6796
6797 %% Push Button
6798 \pgfcircdeclarebipolescaled{switches}
6799 {}
6800 {\ctikzvalof{bipoles/pushbutton/height 2}}
6801 {pushbutton}
6802 {\ctikzvalof{bipoles/pushbutton/height}}
6803 {\ctikzvalof{bipoles/pushbutton/width}}
6804 {
6805 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6806 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
6807 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
6808 \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
6809 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
6810 \pgfusepath{draw}
6811
6812 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6813 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6814 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6815 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6816 }
6817
6818 %% Normally closed Push Button
6819 \pgfcircdeclarebipolescaled{switches}
6820 {}
6821 {\ctikzvalof{bipoles/pushbutton/height 2}}
6822 {ncpushbutton}
6823 {\ctikzvalof{bipoles/pushbutton/height}}
6824 {\ctikzvalof{bipoles/pushbutton/width}}
6825 {
6826 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6827 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6828 % Warning, if the nodes will have a class, we have to touch this.
6829 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
6830 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
6831 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
6832 \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
6833 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
6834 \pgfusepath{draw}
6835 %
6836 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6837 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6838 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6839 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6840 }
6841 % cute switch "to" shapes help function
6842 % #1 -> name
6843 % #2 -> barposition
6844 % #3 -> arrowcode
6845 \long\def\pgfcircdeclarecutesw#1#2#3{
6846 \pgfcircdeclarebipolescaled{switches}
6847 {
6848 \savedanchor\midlever{
6849 % these values are calculated when we create the definition of the shape.
6850 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
6851 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
6852 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
6853 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
6854 \pgf@circ@res@down = -.5\pgf@y
6855 \pgf@circ@res@up = .5\pgf@y
6856 \pgfextracty{\pgf@circ@res@other}{#2}
6857 \pgf@x=0pt
6858 \pgf@y=.5\pgf@circ@res@other
6859 }
6860 % radius of the connector
6861 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6862 % If cnnecting nodes are scaled, we have to modify this
6863 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
6864 % shapename
6865 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
6866 % shape type
6867 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
6868 % mid of the lever, to stack switches
6869 \anchor{mid}{\midlever}
6870 \anchor{cout}{\northeast \pgf@y=0cm}
6871 \anchor{cin}{\southwest\pgf@y=0cm}
6872 \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
6873 \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
6874 }
6875 {\ctikzvalof{bipoles/cuteswitch/height 2}}
6876 {#1}
6877 {\ctikzvalof{bipoles/cuteswitch/height}}
6878 {\ctikzvalof{bipoles/cuteswitch/width}}{
6879 \pgfscope
6880 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6881 % If cnnecting nodes are scaled, we have to modify this
6882 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
6883 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
6884 \pgfsetlinewidth{2\pgf@circ@res@temp}
6885 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6886 \pgfpathlineto{#2}
6887 \pgfsetroundcap\pgfusepath{draw}
6888 \endpgfscope
6889 \pgfscope % arrow
6890 #3
6891 \endpgfscope
6892 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6893 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
6894 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6895 \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
6896 }
6897 }
6898
6899 %% closed cute switch
6900 \pgfcircdeclarecutesw{cuteclosedswitch}
6901 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
6902 {}
6903
6904 %% open cute switch
6905 \pgfcircdeclarecutesw{cuteopenswitch}
6906 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6907 {}
6908
6909 %% closing cute switch
6910 \pgfcircdeclarecutesw{cuteclosingswitch}
6911 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6912 {
6913 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6914 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
6915 \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
6916 \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
6917 \pgfsetarrowsend{latexslim}
6918 \pgfusepath{draw}
6919 }
6920
6921 %% opening cute switch
6922 \pgfcircdeclarecutesw{cuteopeningswitch}
6923 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
6924 {
6925 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6926 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
6927 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
6928 \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
6929 \pgfsetarrowsend{latexslim}
6930 \pgfusepath{draw}
6931 }
6932
6933 %%%%%%%%%%%%%%%%%
6934 %% Instruments
6935 %%%%%%%%%%%%%%%%%
6936
6937 % % METERINGSHAPE
6938 \long\def\drawmeteringcircle{
6939 \def\pgf@circ@temp{right}
6940 \ifx\tikz@res@label@pos\pgf@circ@temp
6941 \pgf@circ@res@step=-1.2\pgf@circ@res@up
6942 \else
6943 \def\pgf@circ@temp{below}
6944 \ifx\tikz@res@label@pos\pgf@circ@temp
6945 \pgf@circ@res@step=-1.2\pgf@circ@res@up
6946 \else
6947 \pgf@circ@res@step=1.2\pgf@circ@res@up
6948 \fi
6949 \fi
6950 %draw connections to circle
6951 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6952 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
6953 \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
6954 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
6955 \pgfusepath{draw}
6956 %draw circle
6957 \pgfscope
6958 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6959 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
6960 \pgf@circ@draworfill
6961 \endpgfscope
6962 %draw arrow
6963 \pgfscope
6964 \pgfsetarrowsend{latex}
6965 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6966 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
6967 \pgfusepath{draw}
6968 \endpgfscope
6969 }
6970
6971 %AMPEREMETER
6972 \pgfcircdeclarebipolescaled{instruments}
6973 {}
6974 {\ctikzvalof{bipoles/ammeter/height}}
6975 {ammeter}
6976 {\ctikzvalof{bipoles/ammeter/height}}
6977 {\ctikzvalof{bipoles/ammeter/width}}
6978 {
6979 \drawmeteringcircle
6980 \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
6981 }
6982 %OHMMETER
6983 \pgfcircdeclarebipolescaled{instruments}
6984 {}
6985 {\ctikzvalof{bipoles/ohmmeter/height}}
6986 {ohmmeter}
6987 {\ctikzvalof{bipoles/ohmmeter/height}}
6988 {\ctikzvalof{bipoles/ohmmeter/width}}
6989 {
6990 \drawmeteringcircle
6991 \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
6992 }
6993 %VOLTMETER
6994 \pgfcircdeclarebipolescaled{instruments}
6995 {}
6996 {\ctikzvalof{bipoles/voltmeter/height}}
6997 {voltmeter}
6998 {\ctikzvalof{bipoles/voltmeter/height}}
6999 {\ctikzvalof{bipoles/voltmeter/width}}
7000 {
7001 \drawmeteringcircle
7002 \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
7003
7004 }
7005
7006 % oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
7007 \pgfcircdeclarebipolescaled{instruments}
7008 {
7009 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
7010 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
7011 % put the node text above and centered
7012 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7013 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7014 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7015 }
7016 }
7017 }
7018 {\ctikzvalof{bipoles/oscope/height}}
7019 {oscope}
7020 {\ctikzvalof{bipoles/oscope/height}}
7021 {\ctikzvalof{bipoles/oscope/width}}
7022 {
7023 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7024 \pgfextracty{\pgf@circ@res@up}{\northeast}
7025 \pgfextractx{\pgf@circ@res@right}{\northeast}
7026 \pgfextractx{\pgf@circ@res@left}{\southwest}
7027 \pgfextracty{\pgf@circ@res@down}{\southwest}
7028 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7029 \pgfscope
7030 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7031 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7032 % this would create a round (analog?) scope...
7033 % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7034 \pgf@circ@draworfill
7035 \endpgfscope
7036 % get the rotation
7037 \pgfgettransformentries\a\b\temp\temp\temp\temp
7038 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7039 % and unrotate the scope
7040 \pgfscope
7041 \pgftransformrotate{\rot}
7042 % grid
7043 \pgfscope
7044 \pgfsetlinewidth{0.5\pgfstartlinewidth}
7045 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7046 \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
7047 {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
7048 {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
7049 \pgfsetstrokeopacity{0.5}
7050 \pgfusepath{draw}
7051 \endpgfscope
7052 % function displayed, thanks to
7053 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7054 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7055 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
7056 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
7057 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
7058 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
7059 \pgfusepath{draw}
7060 \endpgfscope
7061 }
7062
7063 % generic round meter with always horizontal text, no arrow
7064 \pgfcircdeclarebipolescaled{instruments}
7065 {}
7066 {\ctikzvalof{bipoles/esource/height}}
7067 {rmeter}
7068 {\ctikzvalof{bipoles/esource/height}}
7069 {\ctikzvalof{bipoles/esource/width}}
7070 {
7071 \pgfpointorigin
7072 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7073 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7074 \pgf@circ@draworfill
7075 % draw the text label
7076 % get the rotation
7077 \pgfgettransformentries\a\b\temp\temp\temp\temp
7078 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7079 % and unrotate the scope
7080 \pgfscope
7081 \pgfsetcolor{\ctikzvalof{color}}
7082 \pgftransformrotate{\rot}
7083 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7084 \endpgfscope
7085 }
7086
7087 % generic round meter with always horizontal text, with arrow
7088 \pgfcircdeclarebipolescaled{instruments}
7089 {}
7090 {\ctikzvalof{bipoles/esource/height}}
7091 {rmeterwa}
7092 {\ctikzvalof{bipoles/esource/height}}
7093 {\ctikzvalof{bipoles/esource/width}}
7094 {
7095 \pgfpointorigin
7096 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7097 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
7098 \pgf@circ@draworfill
7099 % draw the text label
7100 % get the rotation
7101 \pgfgettransformentries\a\b\temp\temp\temp\temp
7102 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7103 % and unrotate the scope
7104 \pgfscope
7105 \pgftransformrotate{\rot}
7106 \pgfsetcolor{\ctikzvalof{color}}
7107 \pgfsetlinewidth{\pgfstartlinewidth}
7108 % arrow: create a center hole to have better visual
7109 \pgfscope
7110 % clipping path: first a rectangle bigger then the shape
7111 % to avoid problems with the line thickness
7112 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7113 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7114 % next open a circle into it
7115 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
7116 % do the difference and clip before drawing
7117 \pgfseteorule
7118 \pgfusepath{clip}
7119 \pgfsetarrowsend{latexslim}
7120 % the arrow is better if it has a bit of breath and it's not 45º
7121 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
7122 \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
7123 \pgfusepath{draw}
7124 \endpgfscope
7125 \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
7126 \endpgfscope
7127 }
7128
7129 % generic square meter with always horizontal text
7130 \pgfcircdeclarebipolescaled{instruments}
7131 {
7132 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
7133 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
7134 % put the node text above and centered
7135 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7136 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7137 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7138 }
7139 }
7140 }
7141 {\ctikzvalof{bipoles/smeter/height}}
7142 {smeter}
7143 {\ctikzvalof{bipoles/smeter/height}}
7144 {\ctikzvalof{bipoles/smeter/width}}
7145 {
7146 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7147 \pgfextracty{\pgf@circ@res@up}{\northeast}
7148 \pgfextractx{\pgf@circ@res@right}{\northeast}
7149 \pgfextractx{\pgf@circ@res@left}{\southwest}
7150 \pgfextracty{\pgf@circ@res@down}{\southwest}
7151 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7152 \pgfscope
7153 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7154 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7155 \pgf@circ@draworfill
7156 \endpgfscope
7157 % get the rotation
7158 \pgfgettransformentries\a\b\temp\temp\temp\temp
7159 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
7160 % and unrotate the scope
7161 \pgfscope
7162 \pgftransformrotate{\rot}
7163 % the metering window
7164 \pgfscope
7165 \def\@starta{105}\def\@stopa{75}
7166 \pgfsetlinewidth{\pgfstartlinewidth}
7167 \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
7168 \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
7169 \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
7170 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7171 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7172 \pgfclosepath
7173 \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
7174 \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
7175 \pgfusepath{draw}
7176 \endpgfscope
7177 \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
7178 \endpgfscope
7179 }
7180
7181 % probes qucs style:
7182 % #1 : name
7183 % #2 : extra code
7184 \long\def\pgfcirc@qucsprobe#1#2{
7185 \pgfcircdeclarebipolescaled{instruments}
7186 {
7187 \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
7188 \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
7189 % put the node text above and centered
7190 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
7191 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
7192 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7193 }
7194 }
7195 }
7196 {\ctikzvalof{bipoles/qmeter/depth}}
7197 {#1}
7198 {\ctikzvalof{bipoles/qmeter/height}}
7199 {\ctikzvalof{bipoles/qmeter/width}}
7200 {
7201 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7202 \pgfextracty{\pgf@circ@res@up}{\northeast}
7203 \pgfextractx{\pgf@circ@res@right}{\northeast}
7204 \pgfextractx{\pgf@circ@res@left}{\southwest}
7205 \pgfextracty{\pgf@circ@res@down}{\southwest}
7206 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
7207 \pgfscope
7208 \pgfscope
7209 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
7210 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7211 \pgf@circ@draworfill
7212 \endpgfscope
7213 \def\@starta{103}\def\@stopa{77}
7214 \pgfsetlinewidth{\pgfstartlinewidth}
7215 \pgfscope
7216 \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
7217 \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
7218 \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
7219 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
7220 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
7221 \pgfclosepath
7222 \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
7223 \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
7224 \pgfusepath{draw}
7225 \pgf@circ@draworfill
7226 \endpgfscope
7227 #2
7228 \endpgfscope
7229 }
7230 }
7231
7232 \pgfcirc@qucsprobe{qiprobe}{
7233 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7234 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7235 \pgfusepath{draw}
7236 \pgfnode{currarrow}{center}{}{}{}
7237 }
7238
7239 \pgfcirc@qucsprobe{qvprobe}{
7240 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
7241 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7242 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
7243 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7244 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
7245 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7246 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
7247 \pgfusepath{draw}
7248 \pgfscope
7249 % "+" and "-", drawn so that they scale correctly
7250 \pgfsetlinewidth{2\pgfstartlinewidth}
7251 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
7252 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
7253 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7254 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7255 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7256 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
7257 \pgfusepath{draw}
7258 \endpgfscope
7259 }
7260
7261 \pgfcirc@qucsprobe{qpprobe}{
7262 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7263 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7264 \pgfusepath{draw}
7265 \pgfnode{currarrow}{center}{}{}{}
7266 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
7267 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7268 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
7269 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
7270 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
7271 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
7272 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
7273 \pgfusepath{draw}
7274 \pgfscope
7275 % "+" and "-", drawn so that they scale correctly
7276 \pgfsetlinewidth{2\pgfstartlinewidth}
7277 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
7278 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
7279 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7280 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7281 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7282 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
7283 \pgfusepath{draw}
7284 \endpgfscope
7285 }
7286
7287 % current loop for oscope and similar: stylized
7288 \pgfcircdeclarebipolescaled{instruments}
7289 {
7290 \anchor{i}{\northeast\pgf@x=0pt\relax}
7291 \anchor{text}{
7292 \pgfextracty{\pgf@circ@res@up}{\northeast}
7293 \pgfextractx{\pgf@circ@res@left}{\northeast}
7294 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7295 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7296 }
7297 }
7298 }
7299 {\ctikzvalof{bipoles/iloop/height}}
7300 {iloop}
7301 {\ctikzvalof{bipoles/iloop/height}}
7302 {\ctikzvalof{bipoles/iloop/width}}
7303 {
7304 \pgfextracty{\pgf@circ@res@up}{\northeast}
7305 \pgfextractx{\pgf@circ@res@right}{\northeast}
7306 \pgf@circ@res@down=-\pgf@circ@res@up
7307 \pgf@circ@res@left=-\pgf@circ@res@right
7308 \pgfscope
7309 \pgfstartlinewidth=\pgflinewidth
7310 \pgfsetcolor{\ctikzvalof{color}}
7311 % external ellipse
7312 \pgfscope
7313 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7314 % clipping path: first a rectangle bigger then the shape
7315 % to avoid problems with the line thickness
7316 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7317 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7318 % next the opening to the left
7319 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7320 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7321 % do the difference and clip before drawing
7322 \pgfseteorule
7323 \pgfusepath{clip}
7324 \pgfpathellipse{\pgfpointorigin}{
7325 \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
7326 \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
7327 \pgfusepath{draw}
7328 \endpgfscope
7329 % internal wire
7330 \pgfsetlinewidth{\pgfstartlinewidth}
7331 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7332 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7333 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7334 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7335 % and the contact line up
7336 \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
7337 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
7338 \pgfusepath{draw}
7339 \endpgfscope
7340 }
7341
7342 % current loop for oscope and similar: real (double connection)
7343 \pgfcircdeclarebipolescaled{instruments}
7344 {
7345 \anchor{i+}{
7346 \pgfextracty{\pgf@circ@res@up}{\northeast}
7347 \pgfextractx{\pgf@circ@res@right}{\northeast}
7348 \pgf@circ@res@step=0.4\pgf@circ@res@right
7349 \pgf@circ@res@other=0.8\pgf@circ@res@up
7350 \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
7351 \pgf@y=\pgf@circ@res@up
7352 }
7353 \anchor{i-}{
7354 \pgfextracty{\pgf@circ@res@up}{\northeast}
7355 \pgfextractx{\pgf@circ@res@right}{\northeast}
7356 \pgf@circ@res@step=0.4\pgf@circ@res@right
7357 \pgf@circ@res@other=0.8\pgf@circ@res@up
7358 \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
7359 \pgf@y=\pgf@circ@res@up
7360 }
7361 \anchor{text}{
7362 \pgfextracty{\pgf@circ@res@up}{\northeast}
7363 \pgfextractx{\pgf@circ@res@left}{\northeast}
7364 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7365 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7366 }
7367 }
7368 }
7369 {\ctikzvalof{bipoles/iloop/height}}
7370 {iloop2}
7371 {\ctikzvalof{bipoles/iloop/height}}
7372 {\ctikzvalof{bipoles/iloop/width}}
7373 {
7374 \pgfextracty{\pgf@circ@res@up}{\northeast}
7375 \pgfextractx{\pgf@circ@res@right}{\northeast}
7376 \pgf@circ@res@down=-\pgf@circ@res@up
7377 \pgf@circ@res@left=-\pgf@circ@res@right
7378 % must be the same than internal i+ and i- anchors definition
7379 \pgf@circ@res@step=0.4\pgf@circ@res@right
7380 \pgf@circ@res@other=0.8\pgf@circ@res@up
7381 \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
7382 \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
7383 \pgfscope
7384 \pgfstartlinewidth=\pgflinewidth
7385 \pgfsetcolor{\ctikzvalof{color}}
7386 % external ellipse
7387 \pgfscope
7388 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7389 % clipping path: first a rectangle bigger then the shape
7390 % to avoid problems with the line thickness
7391 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7392 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7393 % next the opening to the left
7394 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7395 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7396 % do the difference and clip before drawing
7397 \pgfseteorule
7398 \pgfusepath{clip}
7399 \pgfpathmoveto{\@plus}
7400 \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
7401 \pgfusepath{draw}
7402 \endpgfscope
7403 % internal wire
7404 \pgfsetlinewidth{\pgfstartlinewidth}
7405 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7406 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7407 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7408 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7409 % and the contact line up
7410 % I use ...left and ---right as temporal lengths here to avoid defining more
7411 \pgfextractx{\pgf@circ@res@left}{\@plus}
7412 \pgfextractx{\pgf@circ@res@right}{\@minus}
7413 \pgfpathmoveto{\@plus}
7414 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7415 \pgfpathmoveto{\@minus}
7416 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7417 \pgfusepath{draw}
7418 \endpgfscope
7419 }
7420
7421
7422 %% Varistor
7423 \pgfcircdeclarebipolescaled{resistors}
7424 {}
7425 {\ctikzvalof{bipoles/varistor/height}}
7426 {varistor}
7427 {\ctikzvalof{bipoles/varistor/height}}
7428 {\ctikzvalof{bipoles/varistor/width}}
7429 {
7430 \pgfscope
7431 \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}}
7432 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7433 \pgf@circ@draworfill
7434 \endpgfscope
7435
7436 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
7437 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
7438 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7439 \pgfusepath{draw}
7440
7441 \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
7442 }
7443
7444 %%%%%%%%%%%%%%
7445 %% RF bipoles
7446 %%%%%%%%%%%%%%
7447
7448 % transmission line
7449 \pgfcircdeclarebipolescaled{RF}
7450 {}
7451 {\ctikzvalof{bipoles/tline/height}}
7452 {tline}
7453 {\ctikzvalof{bipoles/tline/height}}
7454 {\ctikzvalof{bipoles/tline/width}}
7455 {
7456 \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
7457 \begin{pgftransparencygroup}
7458 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7459 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
7460 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
7461 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
7462 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
7463 \pgf@circ@draworfill
7464 \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7465 {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
7466 \pgf@circ@draworfill
7467 \end{pgftransparencygroup}
7468 \pgfsetlinewidth{\pgfstartlinewidth}
7469 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7470 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7471 \pgfusepath{stroke}
7472 }
7473
7474 % microstrip transmission line
7475 \pgfcircdeclarebipolescaled{RF}
7476 {}
7477 {\ctikzvalof{bipoles/mstline/height}}
7478 {mstline}
7479 {\ctikzvalof{bipoles/mstline/height}}
7480 {\ctikzvalof{bipoles/mstline/width}}
7481 {
7482 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7483 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7484 \pgf@circ@draworfill
7485 }
7486
7487 %%%%%%%%%%%%%%%%%%%
7488 %% Block diagrams
7489 %%%%%%%%%%%%%%%%%%%
7490
7491 %% Draw the two-port fillable box
7492 \def\pgf@circ@twoportbox{
7493 \pgfscope
7494 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7495 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7496 \pgf@circ@draworfill
7497 \endpgfscope
7498 }
7499
7500 %% Generic two port box
7501 \pgfcircdeclarebipolescaled{blocks}
7502 {}
7503 {\ctikzvalof{bipoles/twoport/height}}
7504 {twoport}
7505 {\ctikzvalof{bipoles/twoport/height}}
7506 {\ctikzvalof{bipoles/twoport/width}}
7507 {
7508 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
7509 \divide \pgf@circ@res@step by 2
7510
7511 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7512 \pgf@circ@res@other = \pgf@circ@res@left
7513 \advance\pgf@circ@res@other by \pgf@circ@res@step
7514 \ifpgf@circuit@dashed
7515 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7516 \fi
7517 % draw outer box
7518 \pgf@circ@twoportbox
7519 \ifpgf@circuit@inputarrow
7520 {
7521 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7522 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7523 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7524 }
7525 \fi
7526
7527 % rotate inner symbol
7528 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7529 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7530 \pgftransformrotate{270}
7531 \fi\fi
7532 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7533 \pgftransformrotate{180}
7534 \fi\fi
7535 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7536 \pgftransformrotate{90}
7537 \fi\fi
7538
7539 % draw inner symbol
7540 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7541
7542 }
7543
7544 %% voltage controled oscillator
7545 \pgfcircdeclarebipolescaled{blocks}
7546 {}
7547 {\ctikzvalof{bipoles/vco/width}}
7548 {vco}
7549 {\ctikzvalof{bipoles/twoport/width}}
7550 {\ctikzvalof{bipoles/vco/width}}
7551 {
7552 \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@Rlen
7553 \divide \pgf@circ@res@step by 2
7554
7555 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7556 \pgf@circ@res@other = \pgf@circ@res@left
7557 \advance\pgf@circ@res@other by \pgf@circ@res@step
7558
7559 \ifpgf@circuit@dashed
7560 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7561 \fi
7562 % draw circle
7563 \pgfscope
7564 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7565 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
7566 \pgf@circ@draworfill
7567 \endpgfscope
7568 \ifpgf@circuit@inputarrow
7569 {
7570 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7571 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7572 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7573 }
7574 \fi
7575
7576 % rotate inner symbol
7577 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7578 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7579 \pgftransformrotate{270}
7580 \fi\fi
7581 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7582 \pgftransformrotate{180}
7583 \fi\fi
7584 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7585 \pgftransformrotate{90}
7586 \fi\fi
7587
7588 % draw inner sine waves
7589 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7590 \pgfsetlinewidth{\pgfstartlinewidth}
7591 \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
7592 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7593 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7594 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7595 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7596 \pgfusepath{draw}
7597 }
7598
7599 %% bandpass filter
7600 \pgfcircdeclarebipolescaled{blocks}
7601 {}
7602 {\ctikzvalof{bipoles/bandpass/width}}
7603 {bandpass}
7604 {\ctikzvalof{bipoles/bandpass/width}}
7605 {\ctikzvalof{bipoles/bandpass/width}}
7606 {
7607
7608 \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@Rlen
7609 \divide \pgf@circ@res@step by 2
7610
7611 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7612 \pgf@circ@res@other = \pgf@circ@res@left
7613 \advance\pgf@circ@res@other by \pgf@circ@res@step
7614
7615 \ifpgf@circuit@dashed
7616 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7617 \fi
7618
7619 % draw outer box
7620 \pgf@circ@twoportbox
7621
7622 \ifpgf@circuit@inputarrow
7623 {
7624 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7625 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7626 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7627 }
7628 \fi
7629
7630 % rotate inner symbol
7631 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7632 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7633 \pgftransformrotate{270}
7634 \fi\fi
7635 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7636 \pgftransformrotate{180}
7637 \fi\fi
7638 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7639 \pgftransformrotate{90}
7640 \fi\fi
7641
7642 % draw inner symbol
7643 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7644 \pgfsetarrows{-} %never draw arrows
7645 \pgfsetlinewidth{\pgfstartlinewidth}
7646 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7647 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7648 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7649 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7650 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7651 \pgfusepath{draw}
7652 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
7653 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
7654 \pgfusepath{draw}
7655
7656 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7657 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7658 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7659 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7660 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7661 \pgfusepath{draw}
7662
7663 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7664 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7665 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7666 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7667 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7668 \pgfusepath{draw}
7669 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
7670 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
7671 \pgfusepath{draw}
7672 }
7673
7674 %% bandstop filter
7675 \pgfcircdeclarebipolescaled{blocks}
7676 {}
7677 {\ctikzvalof{bipoles/bandstop/width}}
7678 {bandstop}
7679 {\ctikzvalof{bipoles/bandstop/width}}
7680 {\ctikzvalof{bipoles/bandstop/width}}
7681 {
7682 \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@Rlen
7683 \divide \pgf@circ@res@step by 2
7684
7685 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7686 \pgf@circ@res@other = \pgf@circ@res@left
7687 \advance\pgf@circ@res@other by \pgf@circ@res@step
7688
7689 \ifpgf@circuit@dashed
7690 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7691 \fi
7692
7693 % draw outer box
7694 \pgf@circ@twoportbox
7695
7696 \ifpgf@circuit@inputarrow
7697 {
7698 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7699 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7700 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7701 }
7702 \fi
7703
7704 % rotate inner symbol
7705 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7706 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7707 \pgftransformrotate{270}
7708 \fi\fi
7709 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
7710 \pgftransformrotate{180}
7711 \fi\fi
7712 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7713 \pgftransformrotate{90}
7714 \fi\fi
7715
7716 % draw inner symbol
7717 \pgfsetdash{}{0pt}% always draw solid line for inner symbol
7718 \pgfsetarrows{-}%never draw arrows
7719 \pgfsetlinewidth{\pgfstartlinewidth}
7720 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7721 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7722 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7723 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7724 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7725 \pgfusepath{draw}
7726
7727 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7728 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7729 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7730 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7731 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7732 \pgfusepath{draw}
7733 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7734 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7735 \pgfusepath{draw}
7736
7737 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7738 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7739 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7740 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7741 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7742 \pgfusepath{draw}
7743 }
7744
7745 %% highpass filter
7746 \pgfcircdeclarebipolescaled{blocks}
7747 {}
7748 {\ctikzvalof{bipoles/highpass/width}}
7749 {highpass}
7750 {\ctikzvalof{bipoles/highpass/width}}
7751 {\ctikzvalof{bipoles/highpass/width}}
7752 {
7753 \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@Rlen
7754 \divide \pgf@circ@res@step by 2
7755
7756 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7757 \pgf@circ@res@other = \pgf@circ@res@left
7758 \advance\pgf@circ@res@other by \pgf@circ@res@step
7759
7760 \ifpgf@circuit@dashed
7761 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7762 \fi
7763
7764 % draw outer box
7765 \pgf@circ@twoportbox
7766
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 > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7781 \pgftransformrotate{180}
7782 \fi\fi
7783 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7784 \pgftransformrotate{90}
7785 \fi\fi
7786
7787 % draw inner symbol
7788 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7789 \pgfsetarrows{-} %never draw arrows
7790 \pgfsetlinewidth{\pgfstartlinewidth}
7791 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7792 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7793 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7794 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7795 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7796 \pgfusepath{draw}
7797
7798 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7799 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7800 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7801 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7802 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7803 \pgfusepath{draw}
7804 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7805 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7806 \pgfusepath{draw}
7807
7808 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7809 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7810 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7811 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7812 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7813 \pgfusepath{draw}
7814 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
7815 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
7816 \pgfusepath{draw}
7817 }
7818
7819 %% lowpass filter
7820 \pgfcircdeclarebipolescaled{blocks}
7821 {}
7822 {\ctikzvalof{bipoles/lowpass/width}}
7823 {lowpass}
7824 {\ctikzvalof{bipoles/lowpass/width}}
7825 {\ctikzvalof{bipoles/lowpass/width}}
7826 {
7827 \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@Rlen
7828 \divide \pgf@circ@res@step by 2
7829
7830 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7831 \pgf@circ@res@other = \pgf@circ@res@left
7832 \advance\pgf@circ@res@other by \pgf@circ@res@step
7833
7834 \ifpgf@circuit@dashed
7835 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7836 \fi
7837
7838 % draw outer box
7839 \pgf@circ@twoportbox
7840
7841 \ifpgf@circuit@inputarrow
7842 {
7843 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7844 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7845 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7846 }
7847 \fi
7848
7849 % rotate inner symbol
7850 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7851 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7852 \pgftransformrotate{270}
7853 \fi\fi
7854 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7855 \pgftransformrotate{180}
7856 \fi\fi
7857 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7858 \pgftransformrotate{90}
7859 \fi\fi
7860
7861 % draw inner symbol
7862 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7863 \pgfsetarrows{-} %never draw arrows
7864 \pgfsetlinewidth{\pgfstartlinewidth}
7865 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7866 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7867 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7868 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7869 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7870 \pgfusepath{draw}
7871 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
7872 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
7873 \pgfusepath{draw}
7874
7875 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7876 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7877 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7878 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7879 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7880 \pgfusepath{draw}
7881 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7882 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7883 \pgfusepath{draw}
7884
7885 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7886 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7887 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7888 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7889 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7890 \pgfusepath{draw}
7891 }
7892
7893 %% ADC
7894 \pgfcircdeclarebipolescaled{blocks}
7895 {}
7896 {\ctikzvalof{bipoles/adc/width}}
7897 {adc}
7898 {\ctikzvalof{bipoles/adc/width}}
7899 {\ctikzvalof{bipoles/adc/width}}
7900 {
7901 \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@Rlen
7902 \divide \pgf@circ@res@step by 2
7903
7904 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7905 \pgf@circ@res@other = \pgf@circ@res@left
7906 \advance\pgf@circ@res@other by \pgf@circ@res@step
7907
7908 \ifpgf@circuit@dashed
7909 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7910 \fi
7911
7912 % draw outer box
7913 \pgf@circ@twoportbox
7914
7915 \ifpgf@circuit@inputarrow
7916 {
7917 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7918 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7919 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7920 }
7921 \fi
7922
7923 % rotate inner symbol
7924 \def\texti{A}
7925 \def\textii{D}
7926 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7927 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7928 \def\texti{D}
7929 \def\textii{A}
7930 \pgftransformrotate{270}
7931 \fi\fi
7932 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7933 \def\texti{D}
7934 \def\textii{A}
7935 \pgftransformrotate{180}
7936 \fi\fi
7937 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7938 \pgftransformrotate{90}
7939 \def\texti{A}
7940 \def\textii{D}
7941 \fi\fi
7942
7943 % draw inner symbol
7944 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7945 \pgfsetarrows{-} %never draw arrows
7946 \pgfsetlinewidth{\pgfstartlinewidth}
7947 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7948 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7949 \pgfusepath{draw}
7950
7951 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
7952 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
7953 }
7954
7955 %% DAC
7956 \pgfcircdeclarebipolescaled{blocks}
7957 {}
7958 {\ctikzvalof{bipoles/dac/width}}
7959 {dac}
7960 {\ctikzvalof{bipoles/dac/width}}
7961 {\ctikzvalof{bipoles/dac/width}}
7962 {
7963 \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@Rlen
7964 \divide \pgf@circ@res@step by 2
7965
7966 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7967 \pgf@circ@res@other = \pgf@circ@res@left
7968 \advance\pgf@circ@res@other by \pgf@circ@res@step
7969
7970 \ifpgf@circuit@dashed
7971 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7972 \fi
7973
7974 % draw outer box
7975 \pgf@circ@twoportbox
7976
7977 \ifpgf@circuit@inputarrow
7978 {
7979 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7980 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7981 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7982 }
7983 \fi
7984
7985 % rotate inner symbol
7986 \def\texti{D}
7987 \def\textii{A}
7988 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7989 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7990 \def\texti{A}
7991 \def\textii{D}
7992 \pgftransformrotate{270}
7993 \fi\fi
7994 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7995 \def\texti{A}
7996 \def\textii{D}
7997 \pgftransformrotate{180}
7998 \fi\fi
7999 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8000 \pgftransformrotate{90}
8001 \def\texti{D}
8002 \def\textii{A}
8003 \fi\fi
8004
8005 % draw inner symbol
8006 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8007 \pgfsetarrows{-} %never draw arrows
8008 \pgfsetlinewidth{\pgfstartlinewidth}
8009 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8010 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8011 \pgfusepath{draw}
8012
8013 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
8014 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
8015 }
8016
8017 %% DSP
8018 \pgfcircdeclarebipolescaled{blocks}
8019 {}
8020 {\ctikzvalof{bipoles/dsp/width}}
8021 {dsp}
8022 {\ctikzvalof{bipoles/dsp/width}}
8023 {\ctikzvalof{bipoles/dsp/width}}
8024 {
8025 \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@Rlen
8026 \divide \pgf@circ@res@step by 2
8027
8028 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8029 \pgf@circ@res@other = \pgf@circ@res@left
8030 \advance\pgf@circ@res@other by \pgf@circ@res@step
8031
8032 \ifpgf@circuit@dashed
8033 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8034 \fi
8035
8036 % draw outer box
8037 \pgf@circ@twoportbox
8038
8039 \ifpgf@circuit@inputarrow
8040 {
8041 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8042 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8043 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8044 }
8045 \fi
8046
8047 % rotate inner symbol
8048 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8049 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8050 \pgftransformrotate{270}
8051 \fi\fi
8052 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8053 \pgftransformrotate{180}
8054 \fi\fi
8055 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8056 \pgftransformrotate{90}
8057 \fi\fi
8058
8059 % draw inner symbol
8060 \pgftext[center,x=0,y=0]{\textsf{DSP}}
8061 }
8062
8063 %% FFT
8064 \pgfcircdeclarebipolescaled{blocks}
8065 {}
8066 {\ctikzvalof{bipoles/fft/width}}
8067 {fft}
8068 {\ctikzvalof{bipoles/fft/width}}
8069 {\ctikzvalof{bipoles/fft/width}}
8070 {
8071 \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@Rlen
8072 \divide \pgf@circ@res@step by 2
8073
8074 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8075 \pgf@circ@res@other = \pgf@circ@res@left
8076 \advance\pgf@circ@res@other by \pgf@circ@res@step
8077
8078 \ifpgf@circuit@dashed
8079 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8080 \fi
8081
8082 % draw outer box
8083 \pgf@circ@twoportbox
8084
8085 \ifpgf@circuit@inputarrow
8086 {
8087 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8088 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8089 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8090 }
8091 \fi
8092
8093 % rotate inner symbol
8094 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8095 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8096 \pgftransformrotate{270}
8097 \fi\fi
8098 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8099 \pgftransformrotate{180}
8100 \fi\fi
8101 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8102 \pgftransformrotate{90}
8103 \fi\fi
8104
8105 % draw inner symbol
8106 \pgftext[center,x=0,y=0]{\textsf{FFT}}
8107 }
8108
8109 %% Amplifier
8110 \pgfcircdeclarebipolescaled{blocks}
8111 {}
8112 {
8113 \ifpgf@circuit@boxed
8114 \ctikzvalof{bipoles/twoport/width}
8115 \else
8116 \ctikzvalof{bipoles/amp/width}
8117 \fi
8118 }
8119 {amp}
8120 {
8121 \ifpgf@circuit@boxed
8122 \ctikzvalof{bipoles/twoport/width}
8123 \else
8124 \ctikzvalof{bipoles/amp/width}
8125 \fi
8126 }
8127 {
8128 \ifpgf@circuit@boxed
8129 \ctikzvalof{bipoles/twoport/width}
8130 \else
8131 \ctikzvalof{bipoles/amp/width}
8132 \fi
8133 }
8134 {
8135 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
8136
8137 \ifpgf@circuit@dashed
8138 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8139 \fi
8140
8141 % draw outer box
8142 \ifpgf@circuit@boxed
8143 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8144 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
8145 \pgf@circ@draworfill
8146 \fi
8147
8148 % draw input arrow
8149 \ifpgf@circuit@inputarrow
8150 {
8151 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8152 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8153 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8154 }
8155 \fi
8156
8157 \ifpgf@circuit@boxed
8158 \pgfsetlinewidth{\pgfstartlinewidth}
8159 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
8160 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
8161 \else
8162 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8163 \fi
8164
8165 \pgfsetarrows{-} %never draw arrows
8166
8167 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
8168 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
8169 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
8170
8171 \pgfpathclose
8172 \pgf@circ@draworfill
8173
8174 % draw inner text
8175 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
8176 }
8177
8178
8179 %% variable amplifier
8180 \pgfcircdeclarebipolescaled{blocks}
8181 {}
8182 {
8183 \ifpgf@circuit@boxed
8184 \ctikzvalof{bipoles/twoport/width}
8185 \else
8186 \ctikzvalof{bipoles/amp/width}
8187 \fi
8188 }
8189 {vamp}
8190 {
8191 \ifpgf@circuit@boxed
8192 \ctikzvalof{bipoles/twoport/width}
8193 \else
8194 \ctikzvalof{bipoles/amp/width}
8195 \fi
8196 }
8197 {
8198 \ifpgf@circuit@boxed
8199 \ctikzvalof{bipoles/twoport/width}
8200 \else
8201 \ctikzvalof{bipoles/amp/width}
8202 \fi
8203 }
8204 {
8205 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
8206
8207 \ifpgf@circuit@dashed
8208 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8209 \fi
8210
8211 % draw outer box
8212 \ifpgf@circuit@boxed
8213 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
8214 \fi
8215
8216 % draw input arrow
8217 \ifpgf@circuit@inputarrow
8218 {
8219 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8220 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8221 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8222 }
8223 \fi
8224
8225 \ifpgf@circuit@boxed
8226 \pgfsetlinewidth{\pgfstartlinewidth}
8227 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
8228 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
8229 \else
8230 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8231 \fi
8232
8233
8234 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8235 \pgfsetarrows{-} %never draw arrows
8236
8237 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
8238 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
8239 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
8240
8241 \pgfpathclose
8242 \pgf@circ@draworfill
8243
8244 % draw inner text
8245 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
8246
8247 % draw arrow
8248 \pgfsetlinewidth{\pgfstartlinewidth}
8249 \pgfsetarrowsend{latex}
8250 \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
8251 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
8252 \pgfusepath{draw}
8253 }
8254
8255 %% pi attenuator
8256 \pgfcircdeclarebipolescaled{blocks}
8257 {}
8258 {\ctikzvalof{bipoles/piattenuator/width}}
8259 {piattenuator}
8260 {\ctikzvalof{bipoles/piattenuator/width}}
8261 {\ctikzvalof{bipoles/piattenuator/width}}
8262 {
8263 \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@Rlen
8264 \divide \pgf@circ@res@step by 2
8265
8266 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8267 \pgf@circ@res@other = \pgf@circ@res@left
8268 \advance\pgf@circ@res@other by \pgf@circ@res@step
8269
8270 \ifpgf@circuit@dashed
8271 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8272 \fi
8273
8274 % draw outer box
8275 \pgf@circ@twoportbox
8276
8277 \ifpgf@circuit@inputarrow
8278 {
8279 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8280 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8281 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8282 }
8283 \fi
8284
8285 % rotate inner symbol
8286 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8287 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8288 \pgftransformrotate{270}
8289 \fi\fi
8290 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8291 \pgftransformrotate{90}
8292 \fi\fi
8293
8294 % draw inner symbol
8295 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8296 \pgfsetarrows{-} %never draw arrows
8297 \pgfsetlinewidth{\pgfstartlinewidth}
8298 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
8299 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8300 \pgfusepath{draw}
8301 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
8302 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8303 \pgfusepath{draw}
8304 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8305 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8306 \pgfusepath{draw}
8307 }
8308
8309 %% variable pi attenuator
8310 \pgfcircdeclarebipolescaled{blocks}
8311 {}
8312 {\ctikzvalof{bipoles/vpiattenuator/width}}
8313 {vpiattenuator}
8314 {\ctikzvalof{bipoles/vpiattenuator/width}}
8315 {\ctikzvalof{bipoles/vpiattenuator/width}}
8316 {
8317 \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@Rlen
8318 \divide \pgf@circ@res@step by 2
8319
8320 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8321 \pgf@circ@res@other = \pgf@circ@res@left
8322 \advance\pgf@circ@res@other by \pgf@circ@res@step
8323
8324 \ifpgf@circuit@dashed
8325 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8326 \fi
8327
8328 % draw outer box
8329 \pgf@circ@twoportbox
8330
8331 \ifpgf@circuit@inputarrow
8332 {
8333 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8334 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8335 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8336 }
8337 \fi
8338
8339 % rotate inner symbol
8340 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8341 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8342 \pgftransformrotate{270}
8343 \fi\fi
8344 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8345 \pgftransformrotate{90}
8346 \fi\fi
8347
8348 % draw inner symbol
8349 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8350 \pgfsetarrows{-} %never draw arrows
8351 \pgfsetlinewidth{\pgfstartlinewidth}
8352 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
8353 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8354 \pgfusepath{draw}
8355 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
8356 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8357 \pgfusepath{draw}
8358 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8359 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8360 \pgfusepath{draw}
8361
8362 \pgfsetarrowsend{latex}
8363 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8364 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8365 \pgfusepath{draw}
8366 }
8367
8368 %% T attenuator
8369 \pgfcircdeclarebipolescaled{blocks}
8370 {}
8371 {\ctikzvalof{bipoles/tattenuator/width}}
8372 {tattenuator}
8373 {\ctikzvalof{bipoles/tattenuator/width}}
8374 {\ctikzvalof{bipoles/tattenuator/width}}
8375 {
8376 \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@Rlen
8377 \divide \pgf@circ@res@step by 2
8378
8379 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8380 \pgf@circ@res@other = \pgf@circ@res@left
8381 \advance\pgf@circ@res@other by \pgf@circ@res@step
8382
8383 \ifpgf@circuit@dashed
8384 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8385 \fi
8386
8387 % draw outer box
8388 \pgf@circ@twoportbox
8389
8390 \ifpgf@circuit@inputarrow
8391 {
8392 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8393 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8394 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8395 }
8396 \fi
8397
8398 % rotate inner symbol
8399 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8400 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8401 \pgftransformrotate{270}
8402 \fi\fi
8403 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8404 \pgftransformrotate{90}
8405 \fi\fi
8406
8407 % draw inner symbol
8408 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8409 \pgfsetarrows{-} %never draw arrows
8410 \pgfsetlinewidth{\pgfstartlinewidth}
8411 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8412 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8413 \pgfusepath{draw}
8414 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8415 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8416 \pgfusepath{draw}
8417 }
8418
8419 %% variable T attenuator
8420 \pgfcircdeclarebipolescaled{blocks}
8421 {}
8422 {\ctikzvalof{bipoles/vtattenuator/width}}
8423 {vtattenuator}
8424 {\ctikzvalof{bipoles/vtattenuator/width}}
8425 {\ctikzvalof{bipoles/vtattenuator/width}}
8426 {
8427 \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@Rlen
8428 \divide \pgf@circ@res@step by 2
8429
8430 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8431 \pgf@circ@res@other = \pgf@circ@res@left
8432 \advance\pgf@circ@res@other by \pgf@circ@res@step
8433
8434 \ifpgf@circuit@dashed
8435 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8436 \fi
8437
8438 % draw outer box
8439 \pgf@circ@twoportbox
8440
8441 \ifpgf@circuit@inputarrow
8442 {
8443 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8444 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8445 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8446 }
8447 \fi
8448
8449 % rotate inner symbol
8450 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8451 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8452 \pgftransformrotate{270}
8453 \fi\fi
8454 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8455 \pgftransformrotate{90}
8456 \fi\fi
8457
8458 % draw inner symbol
8459 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8460 \pgfsetarrows{-} %never draw arrows
8461 \pgfsetlinewidth{\pgfstartlinewidth}
8462 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8463 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8464 \pgfusepath{draw}
8465 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8466 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8467 \pgfusepath{draw}
8468
8469 \pgfsetarrowsend{latex}
8470 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8471 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8472 \pgfusepath{draw}
8473 }
8474
8475 %% phase shifter
8476 \pgfcircdeclarebipolescaled{blocks}
8477 {}
8478 {\ctikzvalof{bipoles/phaseshifter/width}}
8479 {phaseshifter}
8480 {\ctikzvalof{bipoles/phaseshifter/width}}
8481 {\ctikzvalof{bipoles/phaseshifter/width}}
8482 {
8483 \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@Rlen
8484 \divide \pgf@circ@res@step by 2
8485
8486 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8487 \pgf@circ@res@other = \pgf@circ@res@left
8488 \advance\pgf@circ@res@other by \pgf@circ@res@step
8489
8490 \ifpgf@circuit@dashed
8491 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8492 \fi
8493
8494 % draw outer box
8495 \pgf@circ@twoportbox
8496
8497 \ifpgf@circuit@inputarrow
8498 {
8499 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8500 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8501 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8502 }
8503 \fi
8504
8505 % rotate inner symbol
8506 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8507 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8508 \pgftransformrotate{270}
8509 \fi\fi
8510 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8511 \pgftransformrotate{180}
8512 \fi\fi
8513 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8514 \pgftransformrotate{90}
8515 \fi\fi
8516
8517 % inner symbol
8518 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8519 }
8520
8521 %% variable phase shifter
8522 \pgfcircdeclarebipolescaled{blocks}
8523 {}
8524 {\ctikzvalof{bipoles/phaseshifter/width}}
8525 {vphaseshifter}
8526 {\ctikzvalof{bipoles/vphaseshifter/width}}
8527 {\ctikzvalof{bipoles/vphaseshifter/width}}
8528 {
8529 \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@Rlen
8530 \divide \pgf@circ@res@step by 2
8531
8532 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8533 \pgf@circ@res@other = \pgf@circ@res@left
8534 \advance\pgf@circ@res@other by \pgf@circ@res@step
8535
8536 \ifpgf@circuit@dashed
8537 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8538 \fi
8539
8540 % draw outer box
8541 \pgf@circ@twoportbox
8542
8543 \ifpgf@circuit@inputarrow
8544 {
8545 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8546 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8547 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8548 }
8549 \fi
8550
8551 % rotate inner symbol
8552 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8553 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8554 \pgftransformrotate{270}
8555 \fi\fi
8556 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8557 \pgftransformrotate{180}
8558 \fi\fi
8559 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8560 \pgftransformrotate{90}
8561 \fi\fi
8562
8563 % inner symbol
8564 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8565
8566 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8567 \pgfsetlinewidth{\pgfstartlinewidth}
8568 \pgfsetarrowsend{latex}
8569 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
8570 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
8571 \pgfusepath{draw}
8572 }
8573
8574 %% detector
8575 \pgfcircdeclarebipolescaled{blocks}
8576 {}
8577 {\ctikzvalof{bipoles/detector/width}}
8578 {detector}
8579 {\ctikzvalof{bipoles/detector/width}}
8580 {\ctikzvalof{bipoles/detector/width}}
8581 {
8582 \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@Rlen
8583 \divide \pgf@circ@res@step by 2
8584
8585 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8586 \pgf@circ@res@other = \pgf@circ@res@left
8587 \advance\pgf@circ@res@other by \pgf@circ@res@step
8588
8589 \ifpgf@circuit@dashed
8590 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8591 \fi
8592
8593 % draw outer box
8594 \pgf@circ@twoportbox
8595
8596 \ifpgf@circuit@inputarrow
8597 {
8598 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8599 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8600 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8601 }
8602 \fi
8603
8604 % draw inner stuff
8605 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8606 \pgfsetarrows{-} %never draw arrows
8607 \pgfsetlinewidth{0.8\pgfstartlinewidth}
8608 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
8609 \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
8610 \pgfusepath{draw}
8611
8612 \ifpgf@circuit@fulldiode
8613 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width}}
8614 \pgftransformscale{\pgfmathresult}
8615 \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
8616 \else
8617 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width}}
8618 \pgftransformscale{\pgfmathresult}
8619 \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
8620 \fi
8621
8622 }
8623
8624 %%%%%%%%%%%%%%%%%%%%%%%
8625 %% MECHANICAL SYMBOLS
8626 %%%%%%%%%%%%%%%%%%%%%%%
8627
8628 %% mechanical capacitance - stiffness/spring
8629
8630 \pgfcircdeclarebipolescaled{mechanicals}
8631 {}
8632 {\ctikzvalof{bipoles/spring/height}}
8633 {spring}
8634 {\ctikzvalof{bipoles/spring/height}}
8635 {\ctikzvalof{bipoles/spring/width}}{
8636 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8637 \pgftransformationadjustments
8638
8639 \pgfmathsetlength{\pgf@circ@res@step}
8640 {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
8641
8642 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
8643 \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
8644 \pgf@circ@res@other = \pgf@circ@res@left
8645 \advance\pgf@circ@res@other by \pgf@circ@res@step
8646 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8647 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8648 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8649 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8650 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8651 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8652 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8653 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8654 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8655 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8656 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8657 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8658 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8659 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8660 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8661 \advance\pgf@circ@res@other by \pgf@circ@res@step
8662 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
8663 \pgfsetbuttcap
8664 \pgfsetbeveljoin
8665 \pgfusepath{stroke}
8666 }
8667
8668 %% mechanical inductance - mass
8669 \pgfcircdeclarebipolescaled{mechanicals}
8670 {}
8671 {\ctikzvalof{bipoles/mass/box height}}
8672 {mass}
8673 {\ctikzvalof{bipoles/mass/height}}
8674 {\ctikzvalof{bipoles/mass/width}}
8675 {
8676 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8677 \pgftransformationadjustments
8678 \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8679 {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
8680 \pgf@circ@draworfill
8681
8682 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8683 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8684 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8685 \pgfsetrectcap
8686 \pgfsetmiterjoin
8687 \pgfusepath{stroke}
8688 }
8689
8690 %% mechanical resistor - damper
8691 \pgfcircdeclarebipolescaled{mechanicals}
8692 {}
8693 {\ctikzvalof{bipoles/damper/height}}
8694 {damper}
8695 {\ctikzvalof{bipoles/damper/height}}
8696 {\ctikzvalof{bipoles/damper/width}}
8697 {
8698 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8699 \pgf@circ@maybefill
8700
8701 % line into the damper
8702 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8703 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8704 {\pgf@circ@res@zero}}
8705 \pgfusepath{stroke}
8706
8707 % damper box
8708 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8709 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8710 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8711 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8712 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8713
8714 \pgfsetrectcap
8715 \pgfsetmiterjoin
8716 \pgfusepath{stroke}
8717
8718 % damper vertical element
8719 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8720 {.8\pgf@circ@res@down}}
8721 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8722 {.8\pgf@circ@res@up}}
8723 \pgfsetbuttcap
8724 \pgfusepath{stroke}
8725
8726 }
8727 %% mechanical viscoelastic element, suggested by @alex
8728 %% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
8729 \pgfcircdeclarebipolescaled{mechanicals}
8730 {} % extra anchors
8731 {\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
8732 {viscoe} % name
8733 {\ctikzvalof{bipoles/damper/height}} % height (above the path line)
8734 {\ctikzvalof{bipoles/damper/width}} % width
8735 { % draw the bipole
8736 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8737 \pgf@circ@maybefill
8738
8739 % spring into the damper
8740 \pgfscope
8741 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8742 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8743 \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
8744 \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8745 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
8746 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8747 \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
8748 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
8749 \pgfusepath{stroke}
8750 \endpgfscope
8751 % damper box
8752 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8753 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8754 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8755 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8756 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8757
8758 \pgfsetrectcap
8759 \pgfsetmiterjoin
8760 \pgfusepath{stroke}
8761
8762 % damper vertical element
8763 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8764 {.8\pgf@circ@res@down}}
8765 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8766 {.8\pgf@circ@res@up}}
8767 \pgfsetbuttcap
8768 \pgfusepath{stroke}
8769
8770 }
8771
8772 %%%%%%%%%%%%%%%%
8773 %% Crossing
8774 %%%%%%%%%%%%%%%%
8775
8776 %% crossing bipole (but see also nodes)
8777 \pgfcircdeclarebipole
8778 {}
8779 {\ctikzvalof{bipoles/crossing/size}}
8780 {crossing}
8781 {\ctikzvalof{bipoles/crossing/size}}
8782 {\ctikzvalof{bipoles/crossing/size}}{
8783 \pgfscope
8784 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8785 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
8786 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
8787 \pgfsetbeveljoin
8788 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8789 \pgfusepath{draw}
8790 \endpgfscope
8791 }
8792
8793 %%%%%%%%%%%%%%%%%%%%%%%%%
8794 %% Miscellaneous bipoles
8795 %%%%%%%%%%%%%%%%%%%%%%%%%
8796
8797 %% loudspeaker and microphone
8798
8799 \pgfcircdeclarebipolescaled{misc}
8800 {}
8801 {\ctikzvalof{bipoles/loudspeaker/depth}}
8802 {loudspeaker}
8803 {\ctikzvalof{bipoles/loudspeaker/height}}
8804 {\ctikzvalof{bipoles/loudspeaker/width}}{
8805
8806 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
8807 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8808 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
8809 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
8810 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
8811 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
8812 \pgfpathclose
8813 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8814 \pgf@circ@draworfill
8815 }
8816
8817 \pgfcircdeclarebipolescaled{misc}
8818 {}
8819 {\ctikzvalof{bipoles/mic/depth}}
8820 {mic}
8821 {\ctikzvalof{bipoles/mic/height}}
8822 {\ctikzvalof{bipoles/mic/width}}{
8823
8824 \pgfscope
8825 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8826 \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
8827 \pgf@circ@draworfill
8828 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
8829 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
8830 \pgfusepath{draw}
8831 \endpgfscope
8832 \pgfscope
8833 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8834 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
8835 % 0.25358 is 0.6-0.4*cos(30)
8836 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
8837 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
8838 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
8839 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8840 \pgfusepath{draw}
8841
8842 \pgfusepath{draw}
8843 \endpgfscope
8844 }
8845
8846 %% european gas filled surge arrester
8847 \pgfcircdeclarebipolescaled{misc}
8848 {}
8849 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
8850 {european gas filled surge arrester}
8851 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
8852 {\ctikzvalof{bipoles/european gas filled surge arrester/width}}
8853 {
8854
8855 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8856 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8857
8858 \pgf@circ@draworfill
8859
8860 \pgfscope
8861 \pgfsetarrowsend{latexslim}
8862 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8863 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
8864 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8865 \pgfusepath{draw}
8866
8867 \endpgfscope
8868 }
8869
8870 %% american gas filled surge arrester
8871 \pgfcircdeclarebipolescaled{misc}
8872 {}
8873 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
8874 {american gas filled surge arrester}
8875 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
8876 {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
8877
8878 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8879 \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
8880 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
8881 \pgfusepath{draw}
8882
8883 \pgfscope
8884 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8885 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
8886 \pgf@circ@draworfill
8887 \endpgfscope
8888
8889 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
8890 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8891 \pgfusepath{draw}
8892
8893 \pgfscope
8894 \pgfsetarrowsend{latex}
8895
8896 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8897 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
8898 \pgfusepath{draw}
8899
8900 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8901 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
8902 \pgfusepath{draw}
8903 \endpgfscope{}
8904
8905 \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}
8906 \pgfusepath{fill}
8907 }
8908
8909 %% thermocouple
8910 \pgfcircdeclarebipolescaled{misc}
8911 {}
8912 {\ctikzvalof{bipoles/thermocouple/height 2}}
8913 {thermocouple}
8914 {\ctikzvalof{bipoles/thermocouple/height}}
8915 {\ctikzvalof{bipoles/thermocouple/width}}
8916 {
8917 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8918 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
8919 \pgfusepath{draw}
8920 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
8921 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8922 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
8923 \pgfusepath{draw}
8924 \pgfsetlinewidth{\pgfstartlinewidth}
8925 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
8926 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
8927 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8928 \pgfusepath{draw}
8929 }
8930
8931 %% fuse
8932 \pgfcircdeclarebipolescaled{misc}
8933 {}
8934 {\ctikzvalof{bipoles/fuse/height}}
8935 {fuse}
8936 {\ctikzvalof{bipoles/fuse/height}}
8937 {\ctikzvalof{bipoles/fuse/width}}
8938 {
8939 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8940 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8941 \pgfusepath{draw}
8942
8943 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8944 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8945
8946 \pgf@circ@draworfill
8947 }
8948
8949 %% asymmetric fuse
8950 \pgfcircdeclarebipolescaled{misc}
8951 {}
8952 {\ctikzvalof{bipoles/afuse/height}}
8953 {afuse}
8954 {\ctikzvalof{bipoles/afuse/height}}
8955 {\ctikzvalof{bipoles/afuse/width}}
8956 {
8957 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8958 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8959 \pgfusepath{draw}
8960
8961 \pgfscope
8962 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8963 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8964 \pgf@circ@draworfill
8965 \endpgfscope
8966
8967 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8968 \pgfusepath{stroke,fill}
8969 }
8970
8971 %% SQUID added by Cor Molenaar 5 March 2010
8972 \pgfcircdeclarebipolescaled{misc}
8973 {}
8974 {\ctikzvalof{bipoles/squid/height}}
8975 {squid}
8976 {\ctikzvalof{bipoles/squid/height}}
8977 {\ctikzvalof{bipoles/squid/width}}
8978 {
8979 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8980
8981 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
8982 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
8983 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
8984 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
8985 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
8986 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
8987 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
8988 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
8989 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
8990
8991 \pgfusepath{draw}
8992 }
8993
8994 % Generic barrier added by Cor Molenaar 5 March 2010
8995 \pgfcircdeclarebipolescaled{misc}
8996 {}
8997 {\ctikzvalof{bipoles/barrier/height}}
8998 {barrier}
8999 {\ctikzvalof{bipoles/barrier/height}}
9000 {\ctikzvalof{bipoles/barrier/width}}
9001 {
9002 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9003
9004 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
9005 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
9006 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
9007 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
9008 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
9009 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
9010
9011 \pgfusepath{draw}
9012 }
9013
9014 %% Lamp
9015 \pgfcircdeclarebipolescaled{misc}
9016 {}
9017 {\ctikzvalof{bipoles/lamp/height}}
9018 {lamp}
9019 {\ctikzvalof{bipoles/lamp/height}}
9020 {\ctikzvalof{bipoles/lamp/width}}
9021 {
9022 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9023
9024 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
9025 \pgf@circ@draworfill
9026 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
9027 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
9028 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
9029 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
9030 \pgfusepath{draw}
9031 }
9032
9033 %% bulb
9034 \pgfcircdeclarebipolescaled{misc}
9035 {}
9036 {\ctikzvalof{bipoles/bulb/height}}
9037 {bulb}
9038 {\ctikzvalof{bipoles/bulb/height}}
9039 {\ctikzvalof{bipoles/bulb/width}}
9040 {%
9041 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
9042 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
9043 \pgf@circ@draworfill
9044 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
9045 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
9046 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
9047 \pgfsetbeveljoin
9048 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
9049 \pgfusepath{draw}
9050 }
9051
9052
9053 % end of pgfcircbipoles.tex
9054 %%%---------- close: tex/pgfcircbipoles
9055 %%%%%%%%%%% Springe nach tex/pgfcirctripoles
9056 %%%---------- open: tex/pgfcirctripoles.tex
9057 % Copyright 2007-2009 by Massimo Redaelli
9058 %
9059 % This file may be distributed and/or modified
9060 %
9061 % 1. under the LaTeX Project Public License and/or
9062 % 2. under the GNU Public License.
9063 %
9064 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
9065
9066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9067 %% Tripoles
9068
9069 %%%%%%%%%%%%%
9070 %% switches
9071 %%%%%%%%%%%%%
9072
9073 % Legacy spdt
9074 \pgfdeclareshape{spdt}{
9075 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
9076 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9077 \savedanchor\northwest{%
9078 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9079 \pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen
9080 \pgf@y=.5\pgf@y
9081 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
9082 \pgf@x=.5\pgf@x
9083 }
9084 \anchor{left}{%
9085 \northwest
9086 \pgf@y=0pt
9087 }
9088 \anchor{in}{
9089 \northwest
9090 \pgf@y=0pt
9091 }
9092 \anchor{out 1}{
9093 \northwest
9094 \pgf@x=-\pgf@x
9095 }
9096 \anchor{out 2}{
9097 \northwest
9098 \pgf@x=-\pgf@x
9099 \pgf@y=-\pgf@y
9100 }
9101 \anchor{center}{
9102 \pgf@y=0pt
9103 \pgf@x=0pt
9104 }
9105 \anchor{east}{
9106 \northwest
9107 \pgf@y=0pt
9108 \pgf@x=-\pgf@x
9109 }
9110 \anchor{west}{
9111 \northwest
9112 \pgf@y=0pt
9113 }
9114 \anchor{south}{
9115 \northwest
9116 \pgf@x=0pt
9117 \pgf@y=-\pgf@y
9118 }
9119 \anchor{north}{
9120 \northwest
9121 \pgf@x=0pt
9122 }
9123 \anchor{south west}{
9124 \northwest
9125 \pgf@y=-\pgf@y
9126 }
9127 \anchor{north east}{
9128 \northwest
9129 \pgf@x=-\pgf@x
9130 }
9131 \anchor{north west}{
9132 \northwest
9133 }
9134 \anchor{south east}{
9135 \northwest
9136 \pgf@x=-\pgf@x
9137 \pgf@y=-\pgf@y
9138 }
9139 \backgroundpath{
9140 \pgfsetcolor{\ctikzvalof{color}}
9141
9142 \northwest
9143 \pgf@circ@res@up = \pgf@y
9144 \pgf@circ@res@down = -\pgf@y
9145 \pgf@circ@res@right = -\pgf@x
9146 \pgf@circ@res@left = \pgf@x
9147 \pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
9148
9149
9150 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9151 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9152 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9153 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9154
9155 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9156 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9157
9158 \pgfusepath{draw}
9159
9160 \pgfscope
9161 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9162 \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
9163 \endpgfscope
9164 \pgfscope
9165 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9166 \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
9167 \endpgfscope
9168 \pgfscope
9169 \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
9170 \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
9171 \endpgfscope
9172
9173 \pgfscope
9174 \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
9175 \pgfpathlineto{
9176 \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
9177 {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
9178 }
9179 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9180 \pgfusepath{draw}
9181 \endpgfscope
9182 }
9183 }
9184
9185
9186 % cute switch "node" shapes, matching with cute "to" shapes
9187 % #1 -> name
9188 % #2 -> barposition
9189 % #3 -> arrowcode
9190 \long\def\pgfcircdeclarecutespdt#1#2#3{
9191 \pgfdeclareshape{#1}
9192 {
9193 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
9194 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9195 \savedanchor\northwest{%
9196 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9197 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
9198 \pgf@y=.5\pgf@y
9199 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
9200 \pgf@x=.25\pgf@x
9201 }
9202 \savedanchor\midlever{
9203 % these values are calculated when we create the definition of the shape.
9204 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9205 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
9206 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
9207 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
9208 \pgf@circ@res@down = -.5\pgf@y
9209 \pgf@circ@res@up = .5\pgf@y
9210 \pgfextracty{\pgf@circ@res@other}{#2}
9211 \pgf@x=0pt
9212 \pgf@y=.5\pgf@circ@res@other
9213 }
9214 % radius of the connector
9215 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
9216 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
9217 % shapename
9218 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
9219 % shape type
9220 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
9221 % mid of the lever, to stack switches
9222 \anchor{mid}{\midlever}
9223 % center anchors
9224 \anchor{cin}{ \northwest \pgf@y=0pt}
9225 \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
9226 \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
9227 % horizontal angles
9228 \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
9229 \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
9230 \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
9231
9232 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
9233 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
9234 \anchor{west}{ \northwest \pgf@y=0pt }
9235 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
9236 \anchor{north}{ \northwest \pgf@x=0pt }
9237 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
9238 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
9239 \anchor{north west}{ \northwest }
9240 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
9241
9242 \backgroundpath{
9243 \pgfsetcolor{\ctikzvalof{color}}
9244 \northwest
9245 \pgf@circ@res@up = \pgf@y
9246 \pgf@circ@res@down = -\pgf@y
9247 \pgf@circ@res@right = -\pgf@x
9248 \pgf@circ@res@left = \pgf@x
9249
9250 \pgfscope
9251 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
9252 \pgf@circ@res@temp=\radius\relax
9253 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
9254 \pgfsetlinewidth{2\pgf@circ@res@temp}
9255 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9256 \pgfpathlineto{#2}
9257 \pgfsetroundcap\pgfusepath{draw}
9258 \endpgfscope
9259 \pgfscope % arrow
9260 #3
9261 \endpgfscope
9262 % terminals
9263 \pgfscope
9264 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9265 \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
9266 \endpgfscope
9267 \pgfscope
9268 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9269 \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
9270 \endpgfscope
9271 \pgfscope
9272 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
9273 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
9274 \endpgfscope
9275
9276 }
9277 }
9278 }
9279
9280 \pgfcircdeclarecutespdt{cute spdt up}
9281 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
9282 {}
9283
9284 \pgfcircdeclarecutespdt{cute spdt mid}
9285 {\pgfpoint{\pgf@circ@res@right}{0pt}}
9286 {}
9287
9288 \pgfcircdeclarecutespdt{cute spdt down}
9289 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
9290 {}
9291
9292 \pgfcircdeclarecutespdt{cute spdt up arrow}
9293 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
9294 {
9295 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9296 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9297 \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
9298 \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
9299 \pgfsetarrowsend{latexslim}
9300 \pgfusepath{draw}
9301 }
9302
9303 \pgfcircdeclarecutespdt{cute spdt mid arrow}
9304 {\pgfpoint{\pgf@circ@res@right}{0pt}}
9305 {
9306 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9307 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9308 \pgfsetarrowsstart{latexslim}
9309 \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
9310 \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
9311 \pgfsetarrowsend{latexslim}
9312 \pgfusepath{draw}
9313 }
9314
9315 \pgfcircdeclarecutespdt{cute spdt down arrow}
9316 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
9317 {
9318 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9319 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9320 \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
9321 \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
9322 \pgfsetarrowsend{latexslim}
9323 \pgfusepath{draw}
9324 }
9325
9326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9328 %%
9329 %% Logic ports
9330 %%
9331 %% Code from John Kormylo at tex.stackexchange.com
9332 %% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
9333 %% Integration and fixes from Romano Giannetti and TheTeXnician <[email protected]>
9334 %%
9335
9336 \newcount\pgf@circ@res@count% reserve global register
9337
9338 \def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
9339 {%
9340 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9341 \step
9342 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9343 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9344 }%
9345
9346 % #1 = \pgfmathcounter #2=type #3 specificic port
9347 % type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
9348 \def\pgf@circ@logicport@baseinput#1#2#3%
9349 {%
9350 % and and nand
9351 \ifnum #2=1\relax
9352 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9353 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9354 \step
9355 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9356 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9357 \pgf@x=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@left
9358 \fi
9359 % or and nor
9360 \ifnum #2=2\relax
9361 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9362 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9363 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9364 \step
9365 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9366 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9367 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american #3 port/angle}}%
9368 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9369 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9370 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9371 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9372 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9373 \pgf@circ@res@temp=\pgf@y
9374 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9375 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9376 \pgf@x=\pgf@circ@res@other
9377 \fi
9378 % xor and xnor
9379 \ifnum #2=3\relax
9380 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9381 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9382 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9383 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
9384 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9385 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9386 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9387 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9388 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9389 \pgf@circ@res@temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf@circ@res@right
9390 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9391 % this compensates for the effect of the line width on the gap between the arcs
9392 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9393 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9394
9395 \step
9396 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9397 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9398 \pgf@circ@res@temp=\pgf@y
9399 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9400 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9401 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9402 \pgf@x=\pgf@circ@res@other
9403 \fi
9404 % european
9405 \ifnum #2=4\relax
9406 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9407 \pgfextractx{\pgf@circ@res@other}{\left}%
9408 \step
9409 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9410 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9411 \pgf@x=\pgf@circ@res@other
9412 \fi
9413 }%
9414
9415 %%% american
9416 \long\def\pgfcircdeclarelogicport#1#2#3{%
9417 \pgfdeclareshape{american #1 port}%
9418 {%
9419 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9420 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9421 \savedmacro\resize{% automatic
9422 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9423 \pgf@circ@res@up = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9424 \pgf@circ@res@up = .5\pgf@circ@res@up
9425 \pgf@circ@res@down = -\pgf@circ@res@up
9426 \pgf@circ@res@right = \ctikzvalof{tripoles/american #1 port/width}\pgf@circ@scaled@Rlen
9427 \pgf@circ@res@right = .5\pgf@circ@res@right
9428 \pgf@circ@res@left = -\pgf@circ@res@right
9429 }%
9430 \savedmacro\inputs{% get number of inputs
9431 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9432 \ifnum\pgf@circ@res@count=0
9433 \pgf@circ@res@count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
9434 \fi
9435 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9436 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9437 \def\inputs{\the\pgf@circ@res@count}%
9438 }%
9439 \savedanchor\step{% 1/2 gap at edges
9440 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9441 \pgf@circ@res@step = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9442 \divide\pgf@circ@res@step by \pgf@circ@res@count
9443 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9444 }%
9445 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9446 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
9447 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
9448 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
9449 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
9450
9451 \anchor{center}{\origin}% for backwards compatibility
9452 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
9453
9454 % create input anchors
9455 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
9456 \pgfmathloop%
9457 \ifnum\pgfmathcounter>\pgf@circ@res@count%
9458 \else%
9459 %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
9460 \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
9461 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9462 }%
9463 \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
9464 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
9465 }%
9466 %}{}%
9467 \repeatpgfmathloop%
9468 }
9469
9470 \anchor{out}{\northeast\pgf@y=0pt}
9471 \anchor{bout}{\right\pgf@y=0pt}
9472
9473
9474 \anchor{left}{\left}% edges of component mius leads
9475 \anchor{right}{\right}
9476
9477 \anchor{north east}{\northeast}% see \Compass macro
9478 \anchor{south west}{\southwest}
9479 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9480 \pgfpoint{0cm}{\pgf@circ@res@up}}
9481 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9482 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9483 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9484 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9485 \pgfpoint{\pgf@circ@res@left}{0cm}}
9486 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9487 \pgfpoint{0cm}{\pgf@circ@res@down}}
9488 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9489 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9490 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9491 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
9492 \pgfpoint{\pgf@circ@res@right}{0cm}}
9493
9494 \backgroundpath{
9495 \pgfsetcolor{\ctikzvalof{color}}
9496 #3
9497 }
9498 }
9499 }
9500 %%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9501 \pgfcircdeclarelogicport{and}{1}{
9502 \pgfextracty{\pgf@circ@res@temp}{\step}%
9503 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9504 \pgf@circ@res@count = \inputs\relax
9505 \loop\ifnum\pgf@circ@res@count>0
9506 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9507 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9508 \pgfpathlineto{\pgfpoint
9509 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left}
9510 {\pgf@circ@res@temp}}
9511 \advance\pgf@circ@res@count by -1
9512 \repeat
9513
9514 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9515 \pgfpathlineto{\pgfpoint
9516 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
9517 {0pt}}
9518
9519 \pgfusepath{draw}
9520
9521 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9522 \pgf@circ@res@other=\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left
9523
9524 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
9525 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
9526 \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
9527 \pgfpathclose
9528 \pgf@circ@draworfill
9529 }
9530 %%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9531 \pgfcircdeclarelogicport{nand}{1}{
9532 \pgfextracty{\pgf@circ@res@temp}{\step}%
9533 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9534 \pgf@circ@res@count = \inputs\relax
9535 \loop\ifnum\pgf@circ@res@count>0
9536 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9537 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9538 \pgfpathlineto{\pgfpoint
9539 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@left}
9540 {\pgf@circ@res@temp}}
9541 \advance\pgf@circ@res@count by -1
9542 \repeat
9543
9544 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9545 \pgfpathlineto{\pgfpoint
9546 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
9547
9548 \pgfusepath{draw}
9549
9550 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9551 \pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
9552 \pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
9553 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9554
9555 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9556 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9557 \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
9558 \pgfpathclose
9559
9560 \pgfpathellipse
9561 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@step}{0pt}}
9562 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9563 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9564
9565 \pgf@circ@draworfill
9566 }
9567 %%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9568 \pgfcircdeclarelogicport{nor}{2}{
9569 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9570 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/inner}\pgf@circ@res@right
9571 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9572 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9573 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9574 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9575
9576 \pgfextracty{\pgf@circ@res@temp}{\step}%
9577 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9578 \pgf@circ@res@count = \inputs\relax
9579 \loop\ifnum\pgf@circ@res@count>0
9580 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9581 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9582 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9583 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9584 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9585 \advance\pgf@circ@res@count by -1
9586 \repeat
9587
9588 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9589 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9590 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9591
9592 \pgfusepath{draw}
9593
9594 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9595
9596 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9597 \pgf@circ@res@step = \ctikzvalof{tripoles/american nor port/circle width}\pgf@circ@res@right
9598 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9599 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9600
9601 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9602 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9603 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9604 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9605 \pgfpathclose
9606
9607 \pgfpathellipse
9608 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9609 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9610 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9611
9612 \pgf@circ@draworfill
9613 }
9614 %%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9615 \pgfcircdeclarelogicport{or}{2}{
9616 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9617 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/inner}\pgf@circ@res@right
9618 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9619 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9620 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9621 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9622
9623 \pgfextracty{\pgf@circ@res@temp}{\step}%
9624 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9625 \pgf@circ@res@count = \inputs\relax
9626 \loop\ifnum\pgf@circ@res@count>0
9627 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9628 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9629 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9630 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9631 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9632 \advance\pgf@circ@res@count by -1
9633 \repeat
9634
9635 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9636 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9637 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9638
9639 \pgfusepath{draw}
9640
9641 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9642
9643 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9644
9645 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9646 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9647 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9648 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9649 \pgfpathclose
9650
9651 \pgf@circ@draworfill
9652 }
9653 %%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9654 \pgfcircdeclarelogicport{xor}{3}{
9655 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
9656 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/inner}\pgf@circ@res@right
9657 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9658 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9659 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9660 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9661 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
9662 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9663 % this compensates for the effect of the line width on the gap between the arcs
9664 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9665 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9666
9667 \pgfextracty{\pgf@circ@res@temp}{\step}%
9668 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9669 \pgf@circ@res@count = \inputs\relax
9670 \loop\ifnum\pgf@circ@res@count>0
9671 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9672 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9673 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9674 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9675 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9676 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9677 \advance\pgf@circ@res@count by -1
9678 \repeat
9679
9680 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9681 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9682 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9683
9684 \pgfusepath{draw}
9685
9686 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9687
9688 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xor port/angle}}%
9689
9690 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9691 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9692 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9693 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9694 \pgfpathclose
9695 \pgf@circ@draworfill
9696
9697 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9698
9699 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9700 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9701
9702 \pgfusepath{draw}
9703 }
9704 %%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9705 \pgfcircdeclarelogicport{xnor}{3}{
9706 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
9707 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/inner}\pgf@circ@res@right
9708 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9709 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9710 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
9711 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9712 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
9713 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9714 % this compensates for the effect of the line width on the gap between the arcs
9715 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9716 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9717
9718 \pgfextracty{\pgf@circ@res@temp}{\step}%
9719 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9720 \pgf@circ@res@count = \inputs\relax
9721 \loop\ifnum\pgf@circ@res@count>0
9722 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9723 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9724 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9725 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9726 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9727 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9728 \advance\pgf@circ@res@count by -1
9729 \repeat
9730
9731 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
9732 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9733 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9734
9735 \pgfusepath{draw}
9736
9737 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9738
9739 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xnor port/angle}}%
9740 \pgf@circ@res@step = \ctikzvalof{tripoles/american xnor port/circle width}\pgf@circ@res@right
9741 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9742 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9743
9744 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9745 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9746 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9747 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9748 \pgfpathclose
9749
9750 \pgfpathellipse
9751 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9752 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9753 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9754 \pgf@circ@draworfill
9755
9756 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@left
9757 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9758
9759 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9760 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9761
9762 \pgfusepath{draw}
9763 }
9764
9765 %%% Original one-input ports
9766
9767 \pgfdeclareshape{american not port}{
9768 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9769 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9770 \anchor{center}{\pgfpointorigin}
9771 \savedanchor\northwest{%
9772 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9773 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9774 \pgf@y=.5\pgf@y
9775 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9776 \pgf@x=.5\pgf@x
9777 }
9778 \anchor{in}{
9779 \northwest
9780 \pgf@y=0pt
9781 }
9782 \anchor{in 1}{
9783 \northwest
9784 \pgf@y=0pt
9785 }
9786 \anchor{bin}{
9787 \northwest
9788 \pgf@y=0pt
9789 }
9790 \anchor{bin 1}{
9791 \northwest
9792 \pgf@y=0pt
9793 \pgf@x=0.7\pgf@x
9794 }
9795 \anchor{out}{
9796 \northwest
9797 \pgf@y=0pt
9798 \pgf@x=-\pgf@x
9799 }
9800 \anchor{bout}{
9801 \northwest
9802 \pgf@y=0pt
9803 \pgf@x=-0.7\pgf@x
9804 }
9805 \anchor{center}{
9806 \pgfpointorigin
9807 }
9808 \anchor{east}{
9809 \northwest
9810 \pgf@y=0pt
9811 \pgf@x=-\pgf@x
9812 }
9813 \anchor{west}{
9814 \northwest
9815 \pgf@y=0pt
9816 }
9817 \anchor{south}{
9818 \northwest
9819 \pgf@x=0pt
9820 \pgf@y=-\pgf@y
9821 }
9822 \anchor{north}{
9823 \northwest
9824 \pgf@x=0pt
9825 }
9826 \anchor{south west}{
9827 \northwest
9828 \pgf@y=-\pgf@y
9829 }
9830 \anchor{north east}{
9831 \northwest
9832 \pgf@x=-\pgf@x
9833 }
9834 \anchor{north west}{
9835 \northwest
9836 }
9837 \anchor{south east}{
9838 \northwest
9839 \pgf@x=-\pgf@x
9840 \pgf@y=-\pgf@y
9841 }
9842 \backgroundpath{
9843 \pgfsetcolor{\ctikzvalof{color}}
9844
9845 \northwest
9846 \pgf@circ@res@up = \pgf@y
9847 \pgf@circ@res@down = -\pgf@y
9848 \pgf@circ@res@right = -\pgf@x
9849 \pgf@circ@res@left = \pgf@x
9850
9851 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
9852
9853 \pgfscope
9854 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9855 \pgftransformxshift{.7\pgf@circ@res@left}
9856 \pgf@circ@res@step=\pgf@circ@res@right
9857 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9858 \pgf@circ@res@step=.7\pgf@circ@res@step
9859
9860 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9861 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9862 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9863 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9864 \pgf@circ@draworfill
9865 \pgfpathellipse
9866 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
9867 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
9868 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
9869 \pgf@circ@draworfill
9870 \endpgfscope
9871
9872 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9873 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9874
9875 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9876 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9877
9878 \pgfusepath{draw}
9879 }
9880 }
9881
9882 \pgfdeclareshape{american buffer port}{
9883 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9884 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9885 \anchor{center}{\pgfpointorigin}
9886 \savedanchor\northwest{%
9887 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9888 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9889 \pgf@y=.5\pgf@y
9890 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9891 \pgf@x=.5\pgf@x
9892 }
9893 \anchor{in}{
9894 \northwest
9895 \pgf@y=0pt
9896 }
9897 \anchor{in 1}{
9898 \northwest
9899 \pgf@y=0pt
9900 }
9901 \anchor{bin}{
9902 \northwest
9903 \pgf@y=0pt
9904 }
9905 \anchor{bin 1}{
9906 \northwest
9907 \pgf@y=0pt
9908 \pgf@x=0.7\pgf@x
9909 }
9910 \anchor{out}{
9911 \northwest
9912 \pgf@y=0pt
9913 \pgf@x=-\pgf@x
9914 }
9915 \anchor{bout}{
9916 \northwest
9917 \pgf@y=0pt
9918 \pgf@x=-0.7\pgf@x
9919 }
9920 \anchor{center}{
9921 \pgfpointorigin
9922 }
9923 \anchor{east}{
9924 \northwest
9925 \pgf@y=0pt
9926 \pgf@x=-\pgf@x
9927 }
9928 \anchor{west}{
9929 \northwest
9930 \pgf@y=0pt
9931 }
9932 \anchor{south}{
9933 \northwest
9934 \pgf@x=0pt
9935 \pgf@y=-\pgf@y
9936 }
9937 \anchor{north}{
9938 \northwest
9939 \pgf@x=0pt
9940 }
9941 \anchor{south west}{
9942 \northwest
9943 \pgf@y=-\pgf@y
9944 }
9945 \anchor{north east}{
9946 \northwest
9947 \pgf@x=-\pgf@x
9948 }
9949 \anchor{north west}{
9950 \northwest
9951 }
9952 \anchor{south east}{
9953 \northwest
9954 \pgf@x=-\pgf@x
9955 \pgf@y=-\pgf@y
9956 }
9957 \backgroundpath{
9958 \pgfsetcolor{\ctikzvalof{color}}
9959
9960 \northwest
9961 \pgf@circ@res@up = \pgf@y
9962 \pgf@circ@res@down = -\pgf@y
9963 \pgf@circ@res@right = -\pgf@x
9964 \pgf@circ@res@left = \pgf@x
9965
9966 \pgfscope
9967 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9968 \pgftransformxshift{.7\pgf@circ@res@left}
9969 \pgf@circ@res@step=\pgf@circ@res@right
9970 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9971 \pgf@circ@res@step=.7\pgf@circ@res@step
9972
9973 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
9974 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9975 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9976 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
9977 \pgf@circ@draworfill
9978 \endpgfscope
9979
9980 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9981 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9982
9983 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9984 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9985
9986 \pgfusepath{draw}
9987 }
9988 }
9989 \pgfdeclareshape{invschmitt}{
9990 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9991 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9992 \anchor{center}{\pgfpointorigin}
9993 \savedanchor\northwest{%
9994 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9995 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9996 \pgf@y=.5\pgf@y
9997 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9998 \pgf@x=.5\pgf@x
9999 }
10000 \anchor{in}{
10001 \northwest
10002 \pgf@y=0pt
10003 }
10004 \anchor{in 1}{
10005 \northwest
10006 \pgf@y=0pt
10007 }
10008 \anchor{bin 1}{
10009 \northwest
10010 \pgf@y=0pt
10011 \pgf@x=0.7\pgf@x
10012 }
10013 \anchor{out}{
10014 \northwest
10015 \pgf@y=0pt
10016 \pgf@x=-\pgf@x
10017 }
10018 \anchor{bout}{
10019 \northwest
10020 \pgf@y=0pt
10021 \pgf@x=-0.7\pgf@x
10022 }
10023 \anchor{center}{
10024 \pgfpointorigin
10025 }
10026 \anchor{east}{
10027 \northwest
10028 \pgf@y=0pt
10029 \pgf@x=-\pgf@x
10030 }
10031 \anchor{west}{
10032 \northwest
10033 \pgf@y=0pt
10034 }
10035 \anchor{south}{
10036 \northwest
10037 \pgf@x=0pt
10038 \pgf@y=-\pgf@y
10039 }
10040 \anchor{north}{
10041 \northwest
10042 \pgf@x=0pt
10043 }
10044 \anchor{south west}{
10045 \northwest
10046 \pgf@y=-\pgf@y
10047 }
10048 \anchor{north east}{
10049 \northwest
10050 \pgf@x=-\pgf@x
10051 }
10052 \anchor{north west}{
10053 \northwest
10054 }
10055 \anchor{south east}{
10056 \northwest
10057 \pgf@x=-\pgf@x
10058 \pgf@y=-\pgf@y
10059 }
10060 \backgroundpath{
10061 \pgfsetcolor{\ctikzvalof{color}}
10062
10063 \northwest
10064 \pgf@circ@res@up = \pgf@y
10065 \pgf@circ@res@down = -\pgf@y
10066 \pgf@circ@res@right = -\pgf@x
10067 \pgf@circ@res@left = \pgf@x
10068
10069 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
10070
10071 \pgfscope
10072 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10073 \pgftransformxshift{.7\pgf@circ@res@left}
10074 \pgf@circ@res@step=\pgf@circ@res@right
10075 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10076 \pgf@circ@res@step=.7\pgf@circ@res@step
10077
10078 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
10079 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10080 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10081 \pgfpathclose
10082 \pgf@circ@draworfill
10083 \pgfpathellipse
10084 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
10085 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
10086 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
10087 \pgf@circ@draworfill
10088 \endpgfscope
10089
10090 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10091 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10092
10093 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10094 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
10095 \pgfusepath{draw}
10096 %draw inner shape
10097
10098 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10099
10100 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10101 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10102 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10103 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10104 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10105 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10106 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10107 \pgfusepath{draw}
10108
10109 }
10110 }
10111
10112 \pgfdeclareshape{schmitt}{
10113 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10114 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10115 \anchor{center}{\pgfpointorigin}
10116 \savedanchor\northwest{%
10117 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10118 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
10119 \pgf@y=.5\pgf@y
10120 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
10121 \pgf@x=.5\pgf@x
10122 }
10123 \anchor{in}{
10124 \northwest
10125 \pgf@y=0pt
10126 }
10127 \anchor{in 1}{
10128 \northwest
10129 \pgf@y=0pt
10130 }
10131 \anchor{bin 1}{
10132 \northwest
10133 \pgf@y=0pt
10134 \pgf@x=0.7\pgf@x
10135 }
10136 \anchor{out}{
10137 \northwest
10138 \pgf@y=0pt
10139 \pgf@x=-\pgf@x
10140 }
10141 \anchor{bout}{
10142 \northwest
10143 \pgf@y=0pt
10144 \pgf@x=-.7\pgf@x
10145 }
10146 \anchor{center}{
10147 \pgfpointorigin
10148 }
10149 \anchor{east}{
10150 \northwest
10151 \pgf@y=0pt
10152 \pgf@x=-\pgf@x
10153 }
10154 \anchor{west}{
10155 \northwest
10156 \pgf@y=0pt
10157 }
10158 \anchor{south}{
10159 \northwest
10160 \pgf@x=0pt
10161 \pgf@y=-\pgf@y
10162 }
10163 \anchor{north}{
10164 \northwest
10165 \pgf@x=0pt
10166 }
10167 \anchor{south west}{
10168 \northwest
10169 \pgf@y=-\pgf@y
10170 }
10171 \anchor{north east}{
10172 \northwest
10173 \pgf@x=-\pgf@x
10174 }
10175 \anchor{north west}{
10176 \northwest
10177 }
10178 \anchor{south east}{
10179 \northwest
10180 \pgf@x=-\pgf@x
10181 \pgf@y=-\pgf@y
10182 }
10183 \backgroundpath{
10184 \pgfsetcolor{\ctikzvalof{color}}
10185
10186
10187 \northwest
10188 \pgf@circ@res@up = \pgf@y
10189 \pgf@circ@res@down = -\pgf@y
10190 \pgf@circ@res@right = -\pgf@x
10191 \pgf@circ@res@left = \pgf@x
10192
10193 \pgfscope
10194 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10195 \pgftransformxshift{.7\pgf@circ@res@left}
10196 \pgf@circ@res@step=\pgf@circ@res@right
10197 \advance\pgf@circ@res@step by -\pgf@circ@res@left
10198 \pgf@circ@res@step=.7\pgf@circ@res@step
10199
10200 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
10201 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
10202 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
10203 \pgfpathclose
10204 \pgf@circ@draworfill
10205 \endpgfscope
10206
10207 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
10208 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
10209
10210 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10211 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
10212 \pgfusepath{draw}
10213 %draw inner shape
10214
10215 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10216
10217 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10218 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10219 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10220 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10221 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10222 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
10223 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
10224 \pgfusepath{draw}
10225
10226 }
10227 }
10228
10229
10230 %%% start european logic ports, from John Kormylo
10231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10232 %%
10233
10234 % #1 - name
10235 % #2 - text inside
10236 % #3 - number of inputs
10237 % #4 = is it a not?
10238
10239 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
10240 \pgfdeclareshape{european #1 port}
10241 {
10242 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
10243 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10244 \savedmacro\resize{% automatic
10245 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10246 \pgf@circ@res@up = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
10247 \pgf@circ@res@up = .5\pgf@circ@res@up
10248 \pgf@circ@res@down = -\pgf@circ@res@up
10249 \pgf@circ@res@right = \ctikzvalof{tripoles/european #1 port/width}\pgf@circ@scaled@Rlen
10250 \pgf@circ@res@right = .5\pgf@circ@res@right
10251 \pgf@circ@res@left = -\pgf@circ@res@right
10252 }%
10253 \savedmacro\inputs{% get number of inputs
10254 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
10255 \ifnum\pgf@circ@res@count=0
10256 \pgf@circ@res@count=\ctikzvalof{tripoles/european #1 port/inputs}\relax%
10257 \fi
10258 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
10259 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
10260 \def\inputs{\the\pgf@circ@res@count}%
10261 }%
10262 \savedanchor\step{% 1/2 gap at edges
10263 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10264 \pgf@circ@res@step = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
10265 \divide\pgf@circ@res@step by #3
10266 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
10267 }%
10268 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
10269 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
10270 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
10271 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
10272 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
10273
10274 \anchor{center}{\origin}% for backwards compatibility
10275 % the text anchor overlaps the logic symbol
10276 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
10277 % create input anchors
10278 \ifnum#3=1\relax
10279 \anchor{in}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
10280 \anchor{in 1}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
10281 \anchor{bin}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
10282 \anchor{bin 1}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
10283 \else
10284 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
10285 \pgfmathloop%
10286 \ifnum\pgfmathcounter>#3%
10287 \else%
10288 %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
10289 \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
10290 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
10291 }%
10292 \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
10293 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
10294 }%
10295 %}{}%
10296 \repeatpgfmathloop%
10297 }
10298 \fi
10299 \anchor{out}{\northeast\pgf@y=0pt}
10300 \anchor{bout}{\right\pgf@y=0pt}
10301
10302 \anchor{left}{\left}% edges of component minus leads
10303 \anchor{right}{\right}
10304
10305 \anchor{north east}{\northeast}% see \Compass macro
10306 \anchor{south west}{\southwest}
10307 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
10308 \pgfpoint{0cm}{\pgf@circ@res@up}}
10309 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
10310 \pgfextractx{\pgf@circ@res@left}{\southwest}%
10311 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
10312 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
10313 \pgfpoint{\pgf@circ@res@left}{0cm}}
10314 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10315 \pgfpoint{0cm}{\pgf@circ@res@down}}
10316 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10317 \pgfextractx{\pgf@circ@res@right}{\northeast}%
10318 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
10319 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
10320 \pgfpoint{\pgf@circ@res@right}{0cm}}
10321
10322 \backgroundpath{
10323 \pgfsetcolor{\ctikzvalof{color}}
10324 \pgfscope
10325 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10326 \pgfpathrectanglecorners
10327 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
10328 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
10329 \pgf@circ@draworfill
10330 \endpgfscope
10331 \ifnum#3=1\relax
10332 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
10333 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
10334 \else
10335 \pgfextracty{\pgf@circ@res@temp}{\step}%
10336 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
10337 %\pgf@circ@res@count = #3\relax% redundant
10338 \loop\ifnum\pgf@circ@res@count>0
10339 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
10340 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
10341 \pgfpathlineto{\pgfpoint
10342 {\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}
10343 {\pgf@circ@res@temp}}
10344 \advance\pgf@circ@res@count by -1
10345 \repeat
10346 \fi
10347 %
10348 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10349 \pgfpathlineto{%
10350 \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
10351 %
10352 \edef\pgf@temp{not}
10353 \edef\pgf@circ@temp{#4}
10354 \ifx\pgf@temp\pgf@circ@temp % is a not
10355 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
10356 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}%
10357 {\ctikzvalof{tripoles/european #1 port/not height}\pgf@circ@res@up}}
10358 \fi
10359 %
10360 \pgfusepath{draw}
10361 %
10362 \pgfpathmoveto{\pgfpointorigin}
10363 \pgftext{#2}
10364 }
10365 }
10366 }
10367 \pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
10368 \pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
10369 \pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
10370 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
10371 \pgfcircdeclareeurologicport{buffer}{$1$}{1}{}
10372 \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
10373 \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
10374 \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
10375
10376 %% end european logic ports
10377
10378 %%%%%%%%%%%%%%%%%%%%%%%%
10379 %% Transistors
10380 %%%%%%%%%%%%%%%%%%%%%%%%
10381
10382
10383 \long\def\pgfcircdeclaretransistor#1#2#3{
10384 \pgfdeclareshape{#1}
10385 {
10386 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
10387 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10388 \anchor{center}{
10389 \pgfpointorigin
10390 }
10391 \savedanchor\northeast{% upper right
10392 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10393 \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen
10394 \pgf@y=.5\pgf@y
10395 \pgf@x=0pt
10396 }
10397 \savedanchor\left{%center left
10398 \pgf@y=0pt
10399 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10400 \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
10401 }
10402 \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0
10403 \pgf@y=0pt
10404 \pgf@x=0pt
10405 }
10406 \anchor{text}{
10407 \northeast
10408 \pgf@y=.7\pgf@y
10409 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10410 \pgf@x= \pgf@circ@scaled@Rlen
10411 \pgf@x=0.1\pgf@x
10412 }
10413 \anchor{pathstart}{ % south
10414 \northeast
10415 \pgf@y=-\pgf@y
10416 }
10417 \anchor{pathend}{
10418 \northeast
10419 }
10420 \anchor{north}{
10421 \northeast
10422 \pgf@circ@res@step=\pgf@y
10423 \left
10424 \pgf@y=\pgf@circ@res@step
10425 \pgf@x=.5\pgf@x
10426 }
10427 \anchor{west}{
10428 \left
10429 }
10430 \anchor{east}{
10431 \northeast
10432 \pgf@y=0pt
10433 }
10434 \anchor{south}{
10435 \northeast
10436 \pgf@circ@res@step=\pgf@y
10437 \left
10438 \pgf@y=-\pgf@circ@res@step
10439 \pgf@x=.5\pgf@x
10440 }
10441 \anchor{south west}{
10442 \northeast
10443 \pgf@circ@res@step=\pgf@y
10444 \left
10445 \pgf@y=-\pgf@circ@res@step
10446 }
10447 \anchor{north east}{
10448 \northeast
10449 }
10450 \anchor{north west}{
10451 \northeast
10452 \pgf@circ@res@step=\pgf@y
10453 \left
10454 \pgf@y=\pgf@circ@res@step
10455 }
10456 \anchor{south east}{
10457 \northeast
10458 \pgf@y=-\pgf@y
10459 }
10460 \anchor{B}{
10461 \northeast
10462 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10463 \left
10464 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10465 }
10466 \anchor{base}{
10467 \northeast
10468 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10469 \left
10470 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10471 }
10472 \anchor{bulk}{ %added by Burak Kelleci
10473 \northeast
10474 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10475 \right
10476 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10477 }
10478 \anchor{nobulk}{ %added by Burak Kelleci
10479 \left
10480 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10481 }
10482 \anchor{G}{
10483 \northeast
10484 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10485 \left
10486 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10487 }
10488 \anchor{gate}{
10489 \northeast
10490 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10491 \left
10492 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10493 }
10494 \anchor{nobase}{
10495 \left
10496 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10497 }
10498 \anchor{nogate}{
10499 \left
10500 \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
10501 }
10502 \anchor{E}{
10503 \northeast
10504 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10505 }
10506 \anchor{emitter}{
10507 \northeast
10508 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10509 }
10510 \anchor{C}{
10511 \northeast
10512 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10513 }
10514 \anchor{collector}{
10515 \northeast
10516 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10517 }
10518 \anchor{S}{
10519 \northeast
10520 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10521 }
10522 \anchor{source}{
10523 \northeast
10524 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10525 }
10526 \anchor{D}{
10527 \northeast
10528 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10529 }
10530 \anchor{drain}{
10531 \northeast
10532 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10533 }
10534 #2
10535 \backgroundpath{
10536 \pgftransformationadjustments
10537 \pgfsetcolor{\ctikzvalof{color}}
10538 %
10539 \ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
10540 \pgf@circuit@trans@ntypetrue
10541 \else
10542 \pgf@circuit@trans@ntypefalse
10543 \fi
10544 \northeast
10545 \pgf@circ@res@up = \pgf@y
10546 \pgf@circ@res@down = -\pgf@y
10547 \pgf@circ@res@right = \pgf@x
10548 \left
10549 \pgf@circ@res@left = \pgf@x
10550 \pgf@circ@scaled@Rlen=\scaledRlen
10551 %
10552 #3
10553 % BODY DIODE
10554 \ifpgf@circuit@fet@bodydiode
10555 \drawbodydiode{#1}
10556 \fi
10557 %
10558 }
10559 }
10560 }
10561
10562 \long\def\drawbodydiode#1{
10563 \pgfscope
10564 \pgftransformshift{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
10565 \pgftransformrotate{90}
10566 % diode scale and bodydiode scale interacts. We want the size of the diode
10567 % proportional to the transistor, so we will:
10568 % 1) undo diode scale 2) apply transistor scale (using the current class) 3) apply bodydiode scale
10569 \pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
10570 \pgftransformscale{\@@BDscale}
10571 \ifpgf@circuit@fulldiode
10572 \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10573 \else
10574 \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10575 \fi
10576 \endpgfscope
10577 % Draw stroke line
10578 \ifpgf@circuit@strokediode
10579 \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
10580 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10581 \pgfusepath{stroke}
10582 \fi
10583 %Draw upper connection to body diode
10584 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10585 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10586 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}
10587 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10588 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10589 \pgfusepath{draw}
10590 \pgfscope
10591 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
10592 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10593 \pgftransformscale{0.5}
10594 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10595 \endpgfscope{}
10596 %Draw lower connection to body diode
10597 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10598 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10599 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10600 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
10601 \pgfusepath{draw}
10602 \pgfscope
10603 \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10604 \pgftransformscale{0.5}
10605 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10606 \endpgfscope
10607 }
10608
10609 \long\def\declarebpt#1{
10610 \pgfcircdeclaretransistor{#1}{
10611 \anchor{inner up}{
10612 \northeast
10613 \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y
10614 }
10615 \anchor{inner down}{
10616 \northeast
10617 \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
10618 }
10619 }{
10620 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10621 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10622 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
10623 \pgfpathlineto{\pgfpoint
10624 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10625 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}}
10626 \pgfusepath{draw}
10627
10628 \pgfscope
10629 \pgfpathmoveto{\pgfpoint
10630 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10631 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
10632 \pgfpathlineto{\pgfpoint
10633 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10634 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
10635 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10636 \pgfusepath{draw}
10637 \endpgfscope
10638
10639 \pgfpathmoveto{\pgfpoint
10640 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10641 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}}
10642 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10643 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
10644 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10645 \pgfusepath{draw}
10646 %draw arrow depending on type of transistor
10647 \pgfscope
10648 \pgfslopedattimetrue
10649 \pgfallowupsidedownattimetrue
10650 \pgfresetnontranslationattimefalse
10651 \edef\@@anchor{center}
10652 \ifpgf@circuit@trans@ntype
10653 \ifpgf@circuit@trans@arrowatend
10654 \edef\@@anchor{btip}
10655 \pgftransformlineattime{1.0}{%
10656 \pgfpoint%
10657 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10658 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
10659 }{%
10660 \pgfpoint{\pgf@circ@res@right}%
10661 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
10662 }
10663 \else
10664 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
10665 \pgfpoint%
10666 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10667 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
10668 }{%
10669 \pgfpoint{\pgf@circ@res@right}%
10670 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
10671 }
10672 \fi
10673 \else % p-type
10674 \ifpgf@circuit@trans@arrowatend
10675 \edef\@@anchor{tip}
10676 \pgftransformlineattime{1.0}{%
10677 \pgfpoint{\pgf@circ@res@right}%
10678 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
10679 }{%
10680 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10681 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
10682 }
10683 \else
10684 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
10685 \pgfpoint{\pgf@circ@res@right}%
10686 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
10687 }{%
10688 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10689 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
10690 }
10691 \fi
10692 \fi
10693 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10694 \endpgfscope
10695
10696 \ifpgf@circuit@bpt@drawphoto
10697 \pgfscope
10698 \pgfsetarrowsstart{latexslim}
10699 \pgfpathmoveto{\pgfpointadd{\pgfpoint
10700 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10701 {\pgf@circ@res@up+\pgf@circ@res@down}}
10702 {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
10703 \pgfpathlineto{\pgfpointadd{\pgfpoint
10704 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10705 {\pgf@circ@res@up+\pgf@circ@res@down}}
10706 {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
10707 \pgfusepath{draw}
10708 \pgfpathmoveto{\pgfpointadd{\pgfpoint
10709 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10710 {\pgf@circ@res@up+\pgf@circ@res@down}}
10711 {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
10712 \pgfpathlineto{\pgfpointadd{\pgfpoint
10713 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10714 {\pgf@circ@res@up+\pgf@circ@res@down}}
10715 {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
10716 \pgfusepath{draw}
10717 \endpgfscope
10718 \else
10719 \ifpgf@circuit@bpt@drawbase
10720 \pgfpathmoveto{\pgfpoint
10721 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10722 {\pgf@circ@res@up+\pgf@circ@res@down}}
10723 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10724 \pgfusepath{draw}
10725 \fi
10726 \fi
10727 }
10728 }
10729
10730 \declarebpt{npn}
10731 \declarebpt{pnp}
10732 %
10733 % multi-emitter and multi-collector BJTs by Romano Giannetti
10734 %
10735 \def\pgf@circ@bjt@C@anchor#1{% #1: collector number
10736 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
10737 \pgfextracty{\pgf@circ@res@other}{\basedimension}
10738 \ifnum\cdir>0 % NPN, above
10739 \pgfpoint{\pgf@circ@res@temp}{%
10740 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
10741 \else % PNP, below
10742 \pgfpoint{\pgf@circ@res@temp}{%
10743 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
10744 \fi
10745 }
10746 \def\pgf@circ@bjt@E@anchor#1{% #1: collector number
10747 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
10748 \pgfextracty{\pgf@circ@res@other}{\basedimension}
10749 \ifnum\cdir<0 % PNP, above
10750 \pgfpoint{\pgf@circ@res@temp}{%
10751 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
10752 \else % PNP, below
10753 \pgfpoint{\pgf@circ@res@temp}{%
10754 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
10755 \fi
10756 }
10757
10758 \long\def\declarebjt#1{
10759 \pgfdeclareshape{bjt#1}{
10760 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
10761 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10762 % \cdir is 1 for npn, -1 for pnp
10763 \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}}
10764 \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}}
10765 \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}}
10766 % step up or down for the additional C/Es
10767 \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{%
10768 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10769 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
10770 \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{%
10771 \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
10772 \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1
10773 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10774 \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10775 \pgf@y=.5\pgf@y
10776 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10777 \pgf@x=.5\pgf@x
10778 }
10779 \savedanchor\northeast{% upper right
10780 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10781 \pgfmathsetlength{\pgf@circ@res@step}{%
10782 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10783 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10784 \ifnum\cdir> 0
10785 \edef\numup{\numC}\edef\numdown{\numE}
10786 \else
10787 \edef\numup{\numE}\edef\numdown{\numC}
10788 \fi
10789 \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10790 + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth
10791 + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10792 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10793 \pgf@x=.5\pgf@x
10794 }
10795 \savedanchor\southeast{% lower right
10796 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10797 \pgfmathsetlength{\pgf@circ@res@step}{%
10798 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10799 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10800 \ifnum\cdir> 0
10801 \edef\numup{\numC}\edef\numdown{\numE}
10802 \else
10803 \edef\numup{\numE}\edef\numdown{\numC}
10804 \fi
10805 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10806 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
10807 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10808 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10809 \pgf@x=.5\pgf@x
10810 }
10811 \savedanchor\southwest{% lower left
10812 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10813 \pgfmathsetlength{\pgf@circ@res@step}{%
10814 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10815 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10816 \ifnum\cdir> 0
10817 \edef\numup{\numC}\edef\numdown{\numE}
10818 \else
10819 \edef\numup{\numE}\edef\numdown{\numC}
10820 \fi
10821 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10822 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
10823 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10824 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen
10825 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10826 }
10827 \anchor{center}{\pgfpointorigin}
10828 \anchor{north}{\northeast\pgf@x=0cm\relax}
10829 \anchor{east}{\northeast\pgf@y=0cm\relax}
10830 \anchor{south}{\southwest\pgf@x=0cm\relax}
10831 \anchor{west}{\southwest\pgf@y=0cm}
10832 \anchor{north east}{\northeast}
10833 \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya}
10834 \anchor{south west}{\southwest}
10835 \anchor{south east}{\southeast}
10836
10837 \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}
10838 \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
10839 \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
10840 \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x}
10841 % center of the base "bar"
10842 \anchor{cbase}{\basedimension\pgf@x=-\pgf@x
10843 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10844 }
10845 % geometrical centers
10846 \anchor{vcenter}{\pgf@x=0cm\relax
10847 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10848 }
10849 \anchor{gcenter}{%
10850 \northeast\pgf@xa=0.5\pgf@x
10851 \southwest\advance\pgf@xa by 0.5\pgf@x
10852 \pgf@x=\pgf@xa
10853 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10854 }
10855 % external connections
10856 \anchor{E}{
10857 \ifnum\cdir>0% npn, emitter down
10858 \southeast
10859 \else
10860 \northeast
10861 \fi
10862 }% first emitter
10863 \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter
10864 \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
10865 \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
10866
10867 \backgroundpath{
10868 \pgftransformationadjustments
10869 \pgfsetcolor{\ctikzvalof{color}}
10870 %
10871 % set the type and up and down number of connections
10872 %
10873 \ifnum\cdir> 0
10874 \pgf@circuit@trans@ntypetrue
10875 \edef\numup{\numC}
10876 \edef\numdown{\numE}
10877 \else
10878 \pgf@circuit@trans@ntypefalse
10879 \edef\numup{\numE}
10880 \edef\numdown{\numC}
10881 \fi
10882 \basedimension
10883 \pgf@circ@res@up = \pgf@y
10884 \pgf@circ@res@down = -\pgf@y
10885 \pgf@circ@res@right = \pgf@x
10886 \pgf@circ@res@left = -\pgf@x
10887 \pgf@circ@scaled@Rlen=\scaledRlen
10888 \pgf@circ@res@step=\multistep
10889 %
10890 % set arrow positions options
10891 %
10892 \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}}
10893 \ifpgf@circuit@trans@arrowatend
10894 \edef\@@pos{1.0}
10895 \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit
10896 \edef\@@anchor{btip}
10897 \else
10898 \edef\@@anchor{tip}
10899 \fi
10900 \fi
10901 %
10902 % Drawing upper connections
10903 %
10904 \pgfscope
10905 \pgf@circ@count@a=\numup\relax
10906 \pgfmathloop%
10907 \ifnum\pgf@circ@count@a>0
10908 \advance\pgf@circ@count@a-1\relax
10909 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
10910 \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection
10911 \pgfpathmoveto{\pgfpoint
10912 {\pgf@circ@res@right}%
10913 {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10914 \pgfpathlineto{\pgfpoint
10915 {\pgf@circ@res@right}%
10916 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10917 \else
10918 \pgfpathmoveto{\pgfpoint
10919 {\pgf@circ@res@right}%
10920 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10921 \fi
10922 \pgfpathlineto{\pgfpoint
10923 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10924 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}%
10925 \pgfsetroundcap % better when connecting to sloped lines
10926 \pgfusepath{draw}
10927 \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow
10928 \pgfscope
10929 \pgfslopedattimetrue
10930 \pgfallowupsidedownattimetrue
10931 \pgfresetnontranslationattimefalse
10932 \pgftransformlineattime{\@@pos}{%
10933 \pgfpoint
10934 {\pgf@circ@res@right}%
10935 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}%
10936 }{\pgfpoint
10937 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10938 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}%
10939 }
10940 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10941 \endpgfscope
10942 \fi
10943 \repeatpgfmathloop
10944 \endpgfscope
10945 %
10946 % Drawing base
10947 %
10948 \pgfscope
10949 \pgfpathmoveto{\pgfpoint
10950 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10951 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}}
10952 \pgfpathlineto{\pgfpoint
10953 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10954 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}}
10955 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10956 \pgfsetroundcap % I like it more...
10957 \pgfusepath{draw}
10958 \endpgfscope
10959 %
10960 % draw base external connection
10961 %
10962 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}}
10963 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}}
10964 \pgfusepath{draw}
10965 %
10966 % Drawing lower connections
10967 %
10968 \pgfscope
10969 \pgf@circ@count@a=\numdown\relax
10970 \pgfmathloop%
10971 \ifnum\pgf@circ@count@a>0
10972 \advance\pgf@circ@count@a-1\relax
10973 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
10974 \pgfpathmoveto{\pgfpoint
10975 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10976 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}}
10977 \pgfpathlineto{\pgfpoint
10978 {\pgf@circ@res@right}
10979 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}}
10980 \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection
10981 \pgfpathlineto{\pgfpoint
10982 {\pgf@circ@res@right}
10983 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}}
10984 \fi
10985 \pgfsetroundcap % better when connecting to sloped lines
10986 \pgfusepath{draw}
10987 \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow
10988 \pgfscope
10989 \pgfslopedattimetrue
10990 \pgfallowupsidedownattimetrue
10991 \pgfresetnontranslationattimefalse
10992 \pgftransformlineattime{\@@pos}{%
10993 \pgfpoint
10994 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10995 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}%
10996 }{\pgfpoint
10997 {\pgf@circ@res@right}%
10998 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}%
10999 }
11000 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11001 \endpgfscope
11002 \fi
11003 \repeatpgfmathloop
11004 \endpgfscope
11005 }
11006 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
11007 % and is executed just before a node is drawn.
11008 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{%
11009 % Start with the maximum collector number and go backwards.
11010 \pgf@circ@count@a=\numC\relax
11011 \pgfmathloop%
11012 \ifnum\pgf@circ@count@a>0
11013 % we will create two anchors per pin: the "normal one" like `pin 1` for the
11014 % electrical contact, and the "border one" like `bpin 1` for labels.
11015 % they will coincide if `external pins width` is set to 0.
11016 \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{%
11017 \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}%
11018 }
11019 \advance\pgf@circ@count@a by -1\relax%
11020 \repeatpgfmathloop%
11021 % and emitters
11022 \pgf@circ@count@a=\numE\relax
11023 \pgfmathloop%
11024 \ifnum\pgf@circ@count@a>0
11025 % we will create two anchors per pin: the "normal one" like `pin 1` for the
11026 % electrical contact, and the "border one" like `bpin 1` for labels.
11027 % they will coincide if `external pins width` is set to 0.
11028 \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{%
11029 \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}%
11030 }
11031 \advance\pgf@circ@count@a by -1\relax%
11032 \repeatpgfmathloop%
11033 }%
11034 }
11035 }
11036
11037 \declarebjt{npn}
11038 \declarebjt{pnp}
11039
11040 % end of multi-bjts
11041
11042 \long\def\declareigbt#1{
11043 \pgfcircdeclaretransistor{#1}{
11044 \anchor{inner up}{
11045 \northeast
11046 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
11047 }
11048 \anchor{inner down}{
11049 \northeast
11050 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
11051 }
11052 }
11053 {
11054 %draw upper connection
11055 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11056 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11057 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11058 \pgfpathlineto{\pgfpoint
11059 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11060 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}}
11061 \pgfusepath{draw}
11062
11063 %draw thicker gate lines
11064 \pgfscope
11065 \pgfpathmoveto{\pgfpoint
11066 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11067 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11068 \pgfpathlineto{\pgfpoint
11069 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11070 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11071 \pgfpathmoveto{\pgfpoint
11072 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11073 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11074 \pgfpathlineto{\pgfpoint
11075 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11076 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
11077 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11078 \pgfusepath{draw}
11079 \endpgfscope
11080 %draw lower connection
11081 \pgfpathmoveto{\pgfpoint
11082 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11083 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}}
11084 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11085 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11086 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11087 \pgfusepath{draw}
11088 %draw arrow depending on type of transistor
11089 \pgfscope
11090 \pgfslopedattimetrue
11091 \pgfallowupsidedownattimetrue
11092 \pgfresetnontranslationattimefalse
11093 \ifpgf@circuit@trans@arrowatend
11094 \ifpgf@circuit@trans@ntype
11095 \edef\@@anchor{btip}\edef\@@pos{1.0}
11096 \else
11097 \edef\@@anchor{tip}\edef\@@pos{1.0}
11098 \fi
11099 \else
11100 \edef\@@anchor{center}\edef\@@pos{0.5}
11101 \fi
11102 \ifpgf@circuit@trans@ntype
11103 \pgftransformlineattime{\@@pos}{%
11104 \pgfpoint%
11105 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11106 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}%
11107 }{%
11108 \pgfpoint{\pgf@circ@res@right}%
11109 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}%
11110 }
11111 \else
11112 \pgftransformlineattime{\@@pos}{%
11113 \pgfpoint{\pgf@circ@res@right}%
11114 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}%
11115 }{%
11116 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11117 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}%
11118 }
11119 \fi
11120 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11121 \endpgfscope
11122 %draw gate
11123 \ifpgf@circuit@trans@ntype
11124 \pgfpathmoveto{\pgfpoint
11125 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11126 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11127 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
11128 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11129 \else
11130 \pgfpathmoveto{\pgfpoint
11131 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11132 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
11133 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
11134 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
11135 \fi
11136 \pgfusepath{draw}
11137 }
11138 }
11139
11140 \declareigbt{pigbt}
11141 \declareigbt{nigbt}
11142 \declareigbt{Lnigbt}
11143 \declareigbt{Lpigbt}
11144
11145 \pgfcircdeclaretransistor{nmos}{
11146 \anchor{inner up}{
11147 \northeast
11148 \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y
11149 }
11150 \anchor{inner down}{
11151 \northeast
11152 \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
11153 }
11154 }{%
11155 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11156 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11157 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11158 \pgfpathlineto{\pgfpoint
11159 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11160 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11161
11162 \pgfpathmoveto{\pgfpoint
11163 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11164 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11165 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11166 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11167 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11168 \pgfusepath{draw}
11169
11170 \pgfscope
11171 \pgfpathmoveto{\pgfpoint
11172 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11173 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@up}}
11174 \pgfpathlineto{\pgfpoint
11175 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11176 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@down}}
11177 \pgfpathmoveto{\pgfpoint
11178 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11179 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
11180 \pgfpathlineto{\pgfpoint
11181 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11182 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
11183 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11184 \pgfusepath{draw}
11185 \endpgfscope
11186 \ifpgf@circuit@mos@arrows
11187 \pgfscope
11188 \ifpgf@circuit@trans@arrowatend
11189 \pgftransformshift{\pgfpoint
11190 {\pgf@circ@res@right}%
11191 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}%
11192 }
11193 \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}}
11194 \else
11195 \pgfslopedattimetrue
11196 \pgfallowupsidedownattimetrue
11197 \pgfresetnontranslationattimefalse
11198 \pgftransformlineattime{\ctikzvalof{tripoles/nmos/arrow pos}}{%
11199 \pgfpoint%
11200 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}%
11201 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
11202 }{%
11203 \pgfpoint
11204 {\pgf@circ@res@right}%
11205 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
11206 }
11207 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
11208 \fi
11209 \endpgfscope
11210 \fi
11211
11212 \ifpgf@circuit@bpt@drawgate
11213 \pgfpathmoveto{\pgfpoint
11214 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
11215 {\pgf@circ@res@up+\pgf@circ@res@down}}
11216 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11217 \pgfusepath{draw}
11218 \fi
11219
11220 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
11221 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
11222 {\pgf@circ@res@up+\pgf@circ@res@down}}
11223 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11224 {\pgf@circ@res@up+\pgf@circ@res@down}}
11225 \pgfusepath{draw}
11226 \fi
11227 }
11228
11229 \pgfcircdeclaretransistor{pmos}{
11230 \anchor{inner up}{
11231 \northeast
11232 \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y
11233 }
11234 \anchor{inner down}{
11235 \northeast
11236 \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
11237 }
11238 }{%
11239 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11240 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11241 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11242 \pgfpathlineto{\pgfpoint
11243 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11244 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11245 \pgfusepath{draw}
11246
11247 \ifpgf@circuit@mos@arrows
11248 \pgfscope
11249 \ifpgf@circuit@trans@arrowatend
11250 \pgftransformshift{\pgfpoint
11251 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}%
11252 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11253 }
11254 \pgftransformrotate{180}
11255 \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}}
11256 \else
11257 \pgfslopedattimetrue
11258 \pgfallowupsidedownattimetrue
11259 \pgfresetnontranslationattimefalse
11260 \pgftransformlineattime{\ctikzvalof{tripoles/pmos/arrow pos}}{%
11261 \pgfpoint%
11262 {\pgf@circ@res@right}%
11263 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11264 }{%
11265 \pgfpoint
11266 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}%
11267 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
11268 }
11269 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
11270 \fi
11271 \endpgfscope
11272 \fi
11273
11274 \pgfscope
11275 \pgfpathmoveto{\pgfpoint
11276 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11277 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@up}}
11278 \pgfpathlineto{\pgfpoint
11279 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11280 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@down}}
11281 \pgfpathmoveto{\pgfpoint
11282 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11283 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
11284 \pgfpathlineto{\pgfpoint
11285 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11286 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11287 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11288 \pgfusepath{draw}
11289 \endpgfscope
11290
11291 \pgfpathmoveto{\pgfpoint
11292 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11293 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11294 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11295 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
11296 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11297
11298
11299 \pgfusepath{draw}
11300 \ifpgf@circuit@bpt@drawgate
11301 \pgfpathmoveto{\pgfpoint
11302 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
11303 {\pgf@circ@res@up+\pgf@circ@res@down}}
11304 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11305 \pgfusepath{draw}
11306 \fi
11307
11308 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
11309 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
11310 {\pgf@circ@res@up+\pgf@circ@res@down}}
11311 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11312 {\pgf@circ@res@up+\pgf@circ@res@down}}
11313 \pgfusepath{draw}
11314 \fi
11315
11316 \ifpgf@circuit@pmos@nocircle\else
11317 % we are not scaling the circle with the MOS --- I think it's better to have it
11318 % coherent with the poles/nodes of the rest of the circuit.
11319 \pgfpathcircle{\pgfpoint
11320 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left - \ctikzvalof{nodes width}*\pgf@circ@Rlen}
11321 {\pgf@circ@res@up+\pgf@circ@res@down}}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
11322 \ifpgf@circuit@pmos@emptycircle
11323 \pgfsetfillcolor{white}
11324 \fi
11325 \pgfusepath{draw,fill}
11326 \fi
11327 }
11328
11329 %% HEMT FET Transistor
11330 \pgfcircdeclaretransistor{hemt}{
11331 \anchor{inner up}{
11332 \northeast
11333 \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11334 }
11335 \anchor{inner down}{
11336 \northeast
11337 \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11338 }
11339 }{%
11340 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11341 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11342 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11343 \pgfpathlineto{\pgfpoint
11344 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11345 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11346
11347 \pgfpathmoveto{\pgfpoint
11348 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11349 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11350 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11351 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11352 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11353 \pgfusepath{draw}
11354
11355 \pgfscope
11356 \pgfpathmoveto{\pgfpoint
11357 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11358 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}}
11359 \pgfpathlineto{\pgfpoint
11360 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11361 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}}
11362 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11363 \pgfusepath{draw}
11364 \endpgfscope
11365
11366 \pgfpathmoveto{\pgfpoint
11367 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11368 {\pgf@circ@res@up+\pgf@circ@res@down}}
11369 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11370 \pgfusepath{draw}
11371 }
11372
11373 \long\def\drawfetcore#1{
11374 \pgftransformationadjustments
11375 %top connection
11376 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11377 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11378 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11379 \pgfpathlineto{\pgfpoint
11380 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11381 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11382 \pgfusepath{draw}
11383 \pgfscope
11384 \pgfpathmoveto{\pgfpoint
11385 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11386 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
11387 \ifpgf@circuit@trans@depletiontype
11388 \pgfpathlineto{\pgfpoint
11389 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11390 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11391 \else
11392
11393 \pgfpathlineto{\pgfpoint
11394 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11395 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.45}}
11396 \pgfpathmoveto{\pgfpoint
11397 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11398 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.25}}
11399 \pgfpathlineto{\pgfpoint
11400 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11401 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down*0.25}}
11402 \pgfpathmoveto{\pgfpoint
11403 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11404 {\ctikzvalof{tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
11405 \pgfpathlineto{\pgfpoint
11406 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11407 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11408 \fi
11409 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11410 \pgfusepath{draw}
11411 \endpgfscope
11412 %Bulk connection line
11413 \pgfpathmoveto{\pgfpoint
11414 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11415 {\pgf@circ@res@up+\pgf@circ@res@down}}
11416 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11417 {\pgf@circ@res@up+\pgf@circ@res@down}}
11418
11419 %bottom connection
11420 \pgfpathmoveto{\pgfpoint
11421 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11422 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11423 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11424 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11425 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11426 \pgfusepath{draw}
11427
11428 %draw thick gate line
11429 \pgfscope
11430 \pgfpathmoveto{\pgfpoint
11431 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11432 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11433 \pgfpathlineto{\pgfpoint
11434 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11435 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11436 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11437 \pgfusepath{draw}
11438 \endpgfscope
11439
11440 % arrows
11441 \pgfscope
11442 \pgfslopedattimetrue
11443 \pgfallowupsidedownattimetrue
11444 \pgfresetnontranslationattimefalse
11445 \ifpgf@circuit@trans@arrowatend
11446 \ifpgf@circuit@trans@ntype
11447 \edef\@@anchor{tip}
11448 \edef\@@pos{1.0}
11449 \else
11450 \edef\@@anchor{btip}
11451 \edef\@@pos{0.0}
11452 \fi
11453 \else
11454 \edef\@@anchor{center}\edef\@@pos{0.6}
11455 \fi
11456 \pgftransformlineattime{\@@pos}{%
11457 \pgfpoint
11458 {\pgf@circ@res@right}%
11459 {\pgf@circ@res@up+\pgf@circ@res@down}%
11460 }{%
11461 \pgfpoint%
11462 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11463 {\pgf@circ@res@up+\pgf@circ@res@down}%
11464 }
11465 \ifpgf@circuit@trans@ntype
11466 \else
11467 \pgftransformrotate{180}
11468 \fi
11469 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11470 \endpgfscope
11471
11472 % GATE CONNECTION
11473 \ifpgf@circuit@bpt@drawgate
11474 \ifpgf@circuit@trans@ntype
11475 \pgfpathmoveto{\pgfpoint
11476 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11477 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11478 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11479 \else
11480 \pgfpathmoveto{\pgfpoint
11481 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11482 {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11483 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11484 \fi
11485 \pgfusepath{draw}
11486 \fi
11487
11488 }
11489
11490 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
11491 {\pgfcircdeclaretransistor{#1}{
11492 \anchor{bulk}{\left\pgf@x=0pt}
11493 \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
11494 \anchor{inner up}{
11495 \northeast
11496 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
11497 }
11498 \anchor{inner down}{
11499 \northeast
11500 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
11501 }
11502 #2
11503 }
11504 {#3}
11505 }
11506
11507 \pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
11508 \pgf@circuit@trans@depletiontypefalse
11509 \drawfetcore{nfet}
11510 }
11511
11512 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
11513 \pgf@circuit@trans@depletiontypefalse
11514 \drawfetcore{pfet}
11515 }
11516
11517 % N-CHANNEL IGFET ENHANCEMENT TYPE
11518 \pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
11519 \pgf@circuit@trans@depletiontypefalse
11520 \drawfetcore{nigfete}
11521
11522 % SOURCE CONNECTION
11523 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11524 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11525 \pgfusepath{draw}
11526
11527 % SOLDER DOT at source-bulk connection
11528 \ifpgf@circuit@fet@solderdot
11529 \pgfscope
11530 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11531 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11532 \pgfnode{circ}{center}{}{}{}
11533 \endpgfscope{}
11534 \fi
11535 }
11536
11537 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
11538 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
11539 \pgf@circuit@trans@depletiontypefalse
11540 \drawfetcore{nigfetebulk}
11541 % SOLDER DOT at source-bulk connection
11542 \ifpgf@circuit@fet@solderdot
11543 \pgfscope
11544 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11545 \ctikzvalof{tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
11546 \pgfnode{circ}{center}{}{}{}
11547 \endpgfscope{}
11548 \fi
11549 }
11550
11551 % N-CHANNEL IGFET DEPLETION TYPE
11552 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
11553 \pgf@circuit@trans@depletiontypetrue
11554 \drawfetcore{nigfetd}
11555
11556 % SOURCE CONNECTION
11557 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11558 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11559 \pgfusepath{draw}
11560
11561 % SOLDER DOT at source-bulk connection
11562 \ifpgf@circuit@fet@solderdot
11563 \pgfscope
11564 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11565 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11566 \pgfnode{circ}{center}{}{}{}
11567 \endpgfscope{}
11568 \fi
11569 }
11570
11571 % P-CHANNEL IGFET ENHANCEMENT TYPE
11572 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
11573 \pgf@circuit@trans@depletiontypefalse
11574 \drawfetcore{pigfete}
11575 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11576
11577 % SOURCE CONNECTION
11578 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11579 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11580 \pgfusepath{draw}
11581
11582
11583 % SOLDER DOT at source-bulk connection
11584 \ifpgf@circuit@fet@solderdot
11585 \pgfscope
11586 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11587 \ctikzvalof{tripoles/pigfete/gate height}\pgf@circ@res@up}}
11588 \pgfnode{circ}{center}{}{}{}
11589 \endpgfscope
11590 \fi
11591 }
11592
11593 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
11594 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
11595 \pgf@circuit@trans@depletiontypefalse
11596 \drawfetcore{pigfetebulk}
11597 }
11598
11599 % P-CHANNEL IGFET DEPLETION TYPE
11600 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
11601 \pgf@circuit@trans@depletiontypetrue
11602 \drawfetcore{pigfetd}
11603
11604 % SOURCE CONNECTION
11605 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11606 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11607 \pgfusepath{draw}
11608
11609
11610 % SOLDER DOT at source-bulk connection
11611 \ifpgf@circuit@fet@solderdot
11612 \pgfscope
11613 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11614 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@up}}
11615 \pgfnode{circ}{center}{}{}{}
11616 \endpgfscope{}
11617 \fi
11618 }
11619
11620 \pgfcircdeclaretransistor{njfet}{
11621 \anchor{inner up}{
11622 \northeast
11623 \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
11624 }
11625 \anchor{inner down}{
11626 \northeast
11627 \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
11628 }
11629 }{%
11630 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11631 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11632 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
11633 \pgfpathlineto{\pgfpoint
11634 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11635 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
11636
11637 \pgfpathmoveto{\pgfpoint
11638 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11639 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11640 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11641 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11642 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11643 \pgfusepath{draw}
11644
11645 \pgfscope
11646 \pgfpathmoveto{\pgfpoint
11647 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11648 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}}
11649 \pgfpathlineto{\pgfpoint
11650 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11651 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}}
11652 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11653 \pgfusepath{draw}
11654 \endpgfscope
11655
11656 % arrow
11657 \pgfscope
11658 \pgfslopedattimetrue
11659 \pgfallowupsidedownattimetrue
11660 \pgfresetnontranslationattimefalse
11661 \ifpgf@circuit@trans@arrowatend
11662 \edef\@@anchor{tip}\edef\@@pos{1.0}
11663 \else
11664 \edef\@@anchor{center}\edef\@@pos{0.6}
11665 \fi
11666 \pgftransformlineattime{\@@pos}{%
11667 \pgfpoint{\pgf@circ@res@left}%
11668 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
11669 }{%
11670 \pgfpoint
11671 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}%
11672 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
11673 }
11674 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11675 \endpgfscope
11676
11677 \pgfpathmoveto{\pgfpoint
11678 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11679 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11680 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11681 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11682 \pgfusepath{draw}
11683 }
11684
11685 \pgfcircdeclaretransistor{pjfet}{
11686 \anchor{inner up}{
11687 \northeast
11688 \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
11689 }
11690 \anchor{inner down}{
11691 \northeast
11692 \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
11693 }
11694 }{%
11695 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11696 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11697 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11698 \pgfpathlineto{\pgfpoint
11699 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11700 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11701
11702 \pgfpathmoveto{\pgfpoint
11703 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11704 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
11705 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11706 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
11707 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11708 \pgfusepath{draw}
11709
11710 \pgfscope
11711 \pgfpathmoveto{\pgfpoint
11712 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11713 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}}
11714 \pgfpathlineto{\pgfpoint
11715 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11716 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}}
11717 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11718 \pgfusepath{draw}
11719 \endpgfscope
11720
11721 \pgfscope
11722 \pgfslopedattimetrue
11723 \pgfallowupsidedownattimetrue
11724 \pgfresetnontranslationattimefalse
11725 \ifpgf@circuit@trans@arrowatend
11726 \edef\@@anchor{btip}\edef\@@pos{1.0}
11727 \else
11728 \edef\@@anchor{center}\edef\@@pos{0.4}
11729 \fi
11730 \pgftransformlineattime{\@@pos}{%
11731 \pgfpoint%
11732 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}%
11733 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
11734 }{%
11735 \pgfpoint{\pgf@circ@res@left}%
11736 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
11737 }
11738 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11739 \endpgfscope
11740
11741 \pgfpathmoveto{\pgfpoint
11742 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11743 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11744 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11745 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11746 \pgfusepath{draw}
11747 }
11748
11749 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
11750 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11751 % DRAIN CONNECTION
11752 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11753 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
11754 % DRAIN
11755 \pgfpathlineto{\pgfpoint
11756 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11757 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
11758 \pgfusepath{draw}
11759
11760 % GATE, DEPLETION TYPE
11761 \pgfscope %% added
11762 \pgfpathmoveto{\pgfpoint
11763 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11764 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@up}}
11765 \pgfpathlineto{\pgfpoint
11766 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11767 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@down}}
11768 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} %% added
11769 \pgfusepath{draw} %% added
11770 \endpgfscope %% added
11771
11772 % BULK
11773 \pgfpathmoveto{\pgfpoint
11774 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11775 {\pgf@circ@res@up+\pgf@circ@res@down}}
11776 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
11777 {\pgf@circ@res@up+\pgf@circ@res@down}}
11778
11779 % SOURCE
11780 \pgfpathmoveto{\pgfpoint
11781 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11782 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
11783 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11784 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
11785 % SOURCE CONNECTION
11786 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11787 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11788 \pgfusepath{draw}
11789
11790 % SOLDER DOT at source-bulk connection
11791 \ifpgf@circuit@fet@solderdot
11792 \pgfscope
11793 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11794 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11795 \pgfnode{circ}{center}{}{}{}
11796 \endpgfscope{}
11797 \fi
11798 % ARROW
11799 \pgfscope
11800 \pgfslopedattimetrue
11801 \pgfallowupsidedownattimetrue
11802 \pgfresetnontranslationattimefalse
11803 \ifpgf@circuit@trans@arrowatend
11804 \edef\@@anchor{tip}\edef\@@pos{1.0}
11805 \else
11806 \edef\@@anchor{center}\edef\@@pos{0.6}
11807 \fi
11808 \pgftransformlineattime{\@@pos}{%
11809 \pgfpoint
11810 {\pgf@circ@res@right}%
11811 {\pgf@circ@res@up+\pgf@circ@res@down}%
11812 }{%
11813 \pgfpoint%
11814 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}%
11815 {\pgf@circ@res@up+\pgf@circ@res@down}%
11816 }
11817 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11818 \endpgfscope
11819 \pgfusepath{draw}
11820
11821 % Wavy lines
11822 \pgfscope
11823 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
11824 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11825 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11826 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11827 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11828 \pgfusepath{draw}
11829
11830 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
11831 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11832 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11833 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11834 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11835 \pgfusepath{draw}
11836
11837 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
11838 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11839 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11840 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11841 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11842 \pgfusepath{draw}
11843 \endpgfscope
11844 }
11845
11846 % end of transistors
11847
11848 %%%%%%%%%%%%%
11849 %% Switches
11850 %%%%%%%%%%%%%
11851
11852 \pgfcircdeclarebipole{
11853 \anchor{out 1}{
11854 \northeast
11855 \pgf@y=0cm
11856 }
11857 \anchor{out 2}{
11858 \northeast
11859 \pgf@y=.8\pgf@y
11860 }
11861 }
11862 {\ctikzvalof{tripoles/toggleswitch/height 2}}
11863 {toggleswitch}
11864 {\ctikzvalof{tripoles/toggleswitch/height}}
11865 {\ctikzvalof{tripoles/toggleswitch/width}}
11866 {
11867
11868 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
11869 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
11870 \pgfusepath{draw}
11871 \pgfscope
11872 \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
11873 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
11874 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
11875 \pgfusepath{draw}
11876 \endpgfscope
11877
11878 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11879 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
11880
11881 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
11882 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
11883 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
11884 \pgfusepath{draw}
11885
11886
11887 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
11888 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
11889 \pgfusepath{draw}
11890
11891 \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}
11892 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
11893 \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
11894 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
11895 \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
11896 \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
11897 \pgfusepath{draw}
11898 \pgfsetdash{}{0cm}
11899 }
11900
11901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11902 %% operational and instrumentation amplifiers
11903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11904
11905 \pgfdeclareshape{op amp}
11906 {
11907 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
11908 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
11909 \anchor{center}{\pgfpointorigin}
11910 \savedanchor\northwest{%
11911 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11912 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11913 \pgf@y=.5\pgf@y
11914 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11915 \pgf@x=.5\pgf@x
11916 }
11917 \anchor{south}{
11918 \northwest
11919 \pgf@y=-\pgf@y
11920 \pgf@x=0pt
11921 }
11922 \anchor{north}{
11923 \northwest
11924 \pgf@x=0pt
11925 }
11926 \savedanchor\left{%
11927 \pgf@y=0pt
11928 }
11929 \anchor{leftedge}
11930 {\left
11931 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
11932 }
11933 \savedanchor\inOneFixed{%
11934 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11935 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11936 \pgf@y=.5\pgf@y
11937 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
11938 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11939 \pgf@x=.5\pgf@x
11940 }
11941 \anchor{in up}{
11942 \inOneFixed
11943 }
11944 \anchor{in down}{
11945 \inOneFixed
11946 \pgf@y=-\pgf@y
11947 }
11948 \savedanchor\inOne{%
11949 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11950 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11951 \pgf@y=.5\pgf@y
11952 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
11953 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11954 \pgf@x=.5\pgf@x
11955 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11956 }
11957 \anchor{-}{
11958 \inOne
11959 }
11960 \anchor{+}{
11961 \inOne
11962 \pgf@y=-\pgf@y
11963 }
11964 \savedanchor\up{%
11965 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11966 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11967 \pgf@y=.5\pgf@y
11968 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11969 \pgf@x=.5\pgf@x
11970 \pgf@circ@res@up = \pgf@y
11971 \pgf@circ@res@right = -\pgf@x
11972 \pgf@circ@res@left = \pgf@x
11973 \pgfpointlineattime{
11974 \ctikzvalof{tripoles/op amp/up pos}}{
11975 \pgfpoint{
11976 \ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
11977 {\pgf@circ@res@up}}
11978 {\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
11979 }
11980 \anchor{up}{
11981 \up
11982 }
11983 \anchor{down}{
11984 \up
11985 \pgf@y=-\pgf@y
11986 }
11987 \anchor{out}{
11988 \northwest
11989 \pgf@y=0pt
11990 \pgf@x=-\pgf@x
11991 }
11992 \anchor{west}{
11993 \left
11994 }
11995 \anchor{east}{
11996 \left
11997 \pgf@x=-\pgf@x
11998 }
11999
12000 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12001 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12002 \anchor{north west}{ \northwest }
12003 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12004
12005 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12006
12007 \backgroundpath{
12008 \pgfsetcolor{\ctikzvalof{color}}
12009
12010 \northwest
12011 \pgf@circ@res@up = \pgf@y
12012 \pgf@circ@res@down = -\pgf@y
12013 \pgf@circ@res@right = -\pgf@x
12014 \pgf@circ@res@left = \pgf@x
12015 \pgf@circ@scaled@Rlen=\scaledRlen
12016
12017 % Triangle
12018 \pgfscope
12019 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12020 \pgftransformxshift{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12021 \pgf@circ@res@step=\pgf@circ@res@right
12022 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12023 \pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
12024
12025 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12026 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12027 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12028 \pgfpathclose
12029 \pgf@circ@draworfill
12030 \endpgfscope
12031
12032 % Negative input terminal
12033 \pgfpathmoveto{\pgfpoint
12034 {\pgf@circ@res@left}
12035 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
12036 \pgfpathlineto{\pgfpoint
12037 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12038 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
12039 \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$+$\else$-$\fi}
12040
12041 % Positive input terminal
12042 \pgfpathmoveto{\pgfpoint
12043 {\pgf@circ@res@left}
12044 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
12045 \pgfpathlineto{\pgfpoint
12046 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
12047 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
12048 \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$-$\else$+$\fi}
12049
12050 % Output terminal
12051 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12052 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
12053 \pgfsetrectcap
12054 \pgfusepath{draw}
12055 }
12056 }
12057
12058 % Op amp shape as in european standard EN 60617
12059 \pgfdeclareshape{en amp}
12060 {
12061 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12062 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12063 \anchor{center}{\pgfpointorigin}
12064 \savedanchor\northwest{%
12065 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12066 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12067 \pgf@y=.5\pgf@y
12068 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12069 \pgf@x=.5\pgf@x
12070 }
12071 \anchor{south}{
12072 \northwest
12073 \pgf@y=-\pgf@y
12074 \pgf@x=0pt
12075 }
12076 \anchor{north}{
12077 \northwest
12078 \pgf@x=0pt
12079 }
12080 \savedanchor\left{%
12081 \pgf@y=0pt
12082 }
12083 \anchor{leftedge}
12084 {
12085 \left
12086 \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
12087 }
12088 \savedanchor\inOneFixed{%
12089 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12090 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12091 \pgf@y=.5\pgf@y
12092 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
12093 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12094 \pgf@x=.5\pgf@x
12095 }
12096 \anchor{in up}{
12097 \inOneFixed
12098 }
12099 \anchor{in down}{
12100 \inOneFixed
12101 \pgf@y=-\pgf@y
12102 }
12103 \savedanchor\inOne{%
12104 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12105 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
12106 \pgf@y=.5\pgf@y
12107 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
12108 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
12109 \pgf@x=.5\pgf@x
12110 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12111 }
12112 \anchor{-}{
12113 \inOne
12114 }
12115 \anchor{+}{
12116 \inOne
12117 \pgf@y=-\pgf@y
12118 }
12119 \anchor{up}{
12120 \northwest
12121 \pgf@x=0pt
12122 }
12123 \anchor{down}{
12124 \northwest
12125 \pgf@x=0pt
12126 \pgf@y=-\pgf@y
12127 }
12128 \anchor{out}{
12129 \northwest
12130 \pgf@y=0pt
12131 \pgf@x=-\pgf@x
12132 }
12133 \anchor{west}{
12134 \left
12135 }
12136 \anchor{east}{
12137 \left
12138 \pgf@x=-\pgf@x
12139 }
12140 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12141 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12142 \anchor{north west}{ \northwest }
12143 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12144 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12145
12146 \backgroundpath{
12147 \pgfsetcolor{\ctikzvalof{color}}
12148 \northwest
12149 \pgf@circ@res@up = \pgf@y
12150 \pgf@circ@res@down = -\pgf@y
12151 \pgf@circ@res@right = -\pgf@x
12152 \pgf@circ@res@left = \pgf@x
12153 \pgf@circ@scaled@Rlen=\scaledRlen
12154
12155 \pgfscope
12156 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12157 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
12158 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
12159 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
12160 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
12161 \pgfpathclose
12162 \pgf@circ@draworfill
12163 \endpgfscope
12164
12165 \pgfpathmoveto{\pgfpoint
12166 {\pgf@circ@res@left}
12167 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
12168 \pgfpathlineto{\pgfpoint
12169 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
12170 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
12171 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
12172
12173 \pgfpathmoveto{\pgfpoint
12174 {\pgf@circ@res@left}
12175 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
12176 \pgfpathlineto{\pgfpoint
12177 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
12178 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
12179 \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
12180
12181 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12182 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
12183 \pgfsetrectcap
12184 \pgfusepath{draw}
12185
12186
12187 \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
12188 % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
12189 }
12190 }
12191
12192 % Fully differential output op amp
12193 % Contributed by Kristofer M. Monisit
12194 \pgfdeclareshape{fd op amp}
12195 {
12196 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12197 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12198 \anchor{center}{\pgfpointorigin}
12199 \savedanchor\northwest{%
12200 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12201 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12202 \pgf@y=.5\pgf@y
12203 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12204 \pgf@x=.5\pgf@x
12205 }
12206 \savedanchor\outline{%
12207 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12208 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12209 \pgf@y=.5\pgf@y
12210 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12211 \pgf@x=.5\pgf@x
12212 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
12213 }
12214 \anchor{south}{
12215 \northwest
12216 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12217 }
12218 \anchor{north}{
12219 \northwest\pgf@x=0pt\relax
12220 }
12221 \savedanchor\left{%
12222 \pgf@y=0pt
12223 }
12224 \savedanchor\inOneFixed{%
12225 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12226 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12227 \pgf@y=.5\pgf@y
12228 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
12229 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12230 \pgf@x=.5\pgf@x
12231 }
12232 \anchor{in up}{
12233 \inOneFixed
12234 }
12235 \anchor{in down}{
12236 \inOneFixed
12237 \pgf@y=-\pgf@y
12238 }
12239 \savedanchor\inOne{%
12240 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12241 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12242 \pgf@y=.5\pgf@y
12243 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
12244 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12245 \pgf@x=.5\pgf@x
12246 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12247 }
12248 \anchor{-}{
12249 \inOne
12250 }
12251 \anchor{+}{
12252 \inOne
12253 \pgf@y=-\pgf@y
12254 }
12255 \savedanchor\up{%
12256 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12257 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
12258 \pgf@y=.5\pgf@y
12259 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
12260 \pgf@x=.5\pgf@x
12261 \pgf@circ@res@up = \pgf@y
12262 \pgf@circ@res@right = -\pgf@x
12263 \pgf@circ@res@left = \pgf@x
12264 \pgfpointlineattime{
12265 \ctikzvalof{tripoles/fd op amp/up pos}}{
12266 \pgfpoint{
12267 \ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12268 {\pgf@circ@res@up}}
12269 {\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@right}{0pt}}
12270 }
12271 \anchor{up}{
12272 \up
12273 }
12274 \anchor{down}{
12275 \up
12276 \pgf@y=-\pgf@y
12277 }
12278 \anchor{out up}{
12279 \northwest
12280 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12281 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12282 }
12283 \anchor{out down}{
12284 \northwest
12285 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12286 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12287 }
12288 \anchor{out +}{
12289 \outline
12290 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12291 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12292 }
12293 \anchor{out -}{
12294 \outline
12295 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
12296 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12297 }
12298 \anchor{west}{
12299 \left
12300 }
12301 \anchor{east}{
12302 \left
12303 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12304 }
12305 \anchor{out}{% should not be used
12306 \left
12307 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
12308 }
12309 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12310 \anchor{north east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x }
12311 \anchor{north west}{ \northwest }
12312 \anchor{south east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x \pgf@y=-\pgf@y }
12313 \backgroundpath{
12314 \pgfsetcolor{\ctikzvalof{color}}
12315
12316 \northwest
12317 \pgf@circ@res@up = \pgf@y
12318 \pgf@circ@res@down = -\pgf@y
12319 \pgf@circ@res@right = -\pgf@x
12320 \pgf@circ@res@left = \pgf@x
12321 \pgf@circ@scaled@Rlen=\scaledRlen
12322
12323 % Triangle
12324 % Includes output terminals to ensure that diagonal joins are properly displayed
12325 \pgfscope
12326 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
12327 \pgftransformxshift{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12328 \pgf@circ@res@step=\pgf@circ@res@right
12329 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12330 \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step
12331
12332 % Initial point (right vertex)
12333 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12334
12335 % Negative output terminal
12336 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12337 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}}
12338 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12339
12340 % Top vertex
12341 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12342
12343 % Bottom vertex
12344 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12345
12346 % Positive output terminal
12347 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12348 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}}
12349 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12350
12351 % Right vertex
12352 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12353
12354 \pgfpathclose
12355 \pgf@circ@draworfill
12356 \endpgfscope
12357
12358 % Negative input terminal
12359 \pgfpathmoveto{\pgfpoint
12360 {\pgf@circ@res@left}
12361 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12362 \pgfpathlineto{\pgfpoint
12363 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12364 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12365 \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$+$\else$-$\fi}
12366
12367 % Positive input terminal
12368 \pgfpathmoveto{\pgfpoint
12369 {\pgf@circ@res@left}
12370 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12371 \pgfpathlineto{\pgfpoint
12372 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12373 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12374 \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$-$\else$+$\fi}
12375
12376 % Negative output terminal label
12377 \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$-$\else$+$\fi}
12378
12379 % Positive output terminal label
12380 \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$+$\else$-$\fi}
12381
12382 \pgfsetrectcap
12383 \pgfusepath{draw}
12384 }
12385 }
12386
12387
12388 % Instrumentation amplifier with differential output
12389 \pgfdeclareshape{fd inst amp}
12390 {
12391 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12392 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12393 % when tikz calls the anchor it wants the relative position in the lengths
12394 % \pgf@x \pgf@y
12395 % \pgfpoint* functions set that variables
12396 % anchors are visible outside and run on use
12397 \anchor{center}{\pgfpointorigin}
12398 % savedanchors are internals and run on node creation (not use)
12399 % bounding-box top left
12400 \savedanchor\northwest{%
12401 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12402 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12403 \pgf@y=.5\pgf@y
12404 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12405 \pgf@x=.5\pgf@x
12406 }
12407 \anchor{nw}{
12408 \northwest
12409 }
12410 \anchor{south}{
12411 \northwest
12412 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12413 }
12414 \anchor{north}{
12415 \northwest\pgf@x=0pt\relax
12416 }
12417 \savedanchor\left{%
12418 \pgf@y=0pt
12419 }
12420 \anchor{leftedge}
12421 {\left
12422 \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
12423 }
12424 \savedanchor\inOneFixed{%
12425 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12426 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12427 \pgf@y=.5\pgf@y
12428 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12429 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12430 \pgf@x=.5\pgf@x
12431 }
12432 \anchor{in up}{
12433 \inOneFixed
12434 }
12435 \anchor{in down}{
12436 \inOneFixed
12437 \pgf@y=-\pgf@y
12438 }
12439 \savedanchor\inOne{%
12440 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12441 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12442 \pgf@y=.5\pgf@y
12443 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12444 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12445 \pgf@x=.5\pgf@x
12446 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12447 }
12448 \anchor{-}{
12449 \inOne
12450 }
12451 \anchor{+}{
12452 \inOne
12453 \pgf@y=-\pgf@y
12454 }
12455 \savedanchor\up{%
12456 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12457 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12458 \pgf@y=.5\pgf@y
12459 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12460 \pgf@x=.5\pgf@x
12461 \pgf@circ@res@up = \pgf@y
12462 \pgf@circ@res@right = -\pgf@x
12463 \pgf@circ@res@left = \pgf@x
12464 \pgfpointlineattime{
12465 \ctikzvalof{tripoles/fd inst amp/up pos}}{
12466 \pgfpoint{
12467 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12468 {\pgf@circ@res@up}}
12469 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
12470 }
12471 \anchor{up}{
12472 \up
12473 }
12474 \anchor{down}{
12475 \up
12476 \pgf@y=-\pgf@y
12477 }
12478 % reference voltage input anchors.
12479 \savedanchor\refv{%
12480 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12481 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12482 \pgf@y=.5\pgf@y
12483 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12484 \pgf@x=.5\pgf@x
12485 \pgf@circ@res@up = \pgf@y
12486 \pgf@circ@res@right = -\pgf@x
12487 \pgf@circ@res@left = \pgf@x
12488 \pgfpointlineattime{
12489 \ctikzvalof{tripoles/fd inst amp/refv pos}}{
12490 \pgfpoint{
12491 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12492 {\pgf@circ@res@up}}
12493 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
12494 }
12495 % we need both because they are normally drawn under the amp, and if you
12496 % mirror it vertically you need them
12497 \anchor{refv up}{
12498 \refv
12499 }
12500 \anchor{refv down}{
12501 \refv
12502 \pgf@y=-\pgf@y
12503 }
12504 \savedanchor\outport{
12505 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12506 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12507 \pgf@y=.5\pgf@y
12508 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12509 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12510 \pgf@x=-.5\pgf@x
12511 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
12512 }
12513 \anchor{out}{
12514 \outport
12515 \pgf@y=0pt
12516 }
12517 \anchor{out +}{
12518 \outport
12519 }
12520 \anchor{out -}{
12521 \outport
12522 \pgf@y=-\pgf@y
12523 }
12524 \savedanchor\outportfixed{
12525 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12526 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12527 \pgf@y=.5\pgf@y
12528 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12529 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12530 \pgf@x=-.5\pgf@x
12531 }
12532 \anchor{out up}{
12533 \outportfixed
12534 }
12535 \anchor{out down}{
12536 \outportfixed
12537 \pgf@y=-\pgf@y
12538 }
12539 %
12540 \anchor{west}{
12541 \left
12542 }
12543 \anchor{east}{
12544 \left
12545 \pgf@x=-\pgf@x
12546 }
12547 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12548 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12549 \anchor{north west}{ \northwest }
12550 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12551 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12552
12553 % let's start drawing the component
12554 \backgroundpath{
12555 \pgfsetcolor{\ctikzvalof{color}}
12556 %
12557 \northwest
12558 \pgf@circ@res@up = \pgf@y
12559 \pgf@circ@res@down = -\pgf@y
12560 \pgf@circ@res@right = -\pgf@x
12561 \pgf@circ@res@left = \pgf@x
12562 \pgf@circ@scaled@Rlen=\scaledRlen
12563 % main component, normally in thicker lines
12564 \pgfscope
12565 \newdimen\pgf@circ@res@right@double
12566 \pgf@circ@res@right@double=2\pgf@circ@res@right
12567
12568 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12569 \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12570 \pgf@circ@res@step=\pgf@circ@res@right
12571 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12572 \pgf@circ@res@step=\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@step
12573 %first point (near output)
12574 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{0}}
12575 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
12576 \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}}
12577 % and then to the input "front up", "down", to the output short side "down"
12578 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12579 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12580 \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}}
12581 % ...and close
12582 \pgfpathclose
12583 \pgf@circ@draworfill
12584 \endpgfscope
12585
12586 % input terminal up
12587 \pgfpathmoveto{\pgfpoint
12588 {\pgf@circ@res@left}
12589 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
12590 %
12591 \pgfpathlineto{\pgfpoint
12592 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12593 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
12594 %
12595 \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$+$\else$-$\fi}
12596
12597 % input terminal down
12598 \pgfpathmoveto{\pgfpoint
12599 {\pgf@circ@res@left}
12600 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
12601 %
12602 \pgfpathlineto{\pgfpoint
12603 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12604 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
12605 \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$-$\else$+$\fi}
12606
12607 % output leads down and up
12608 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
12609 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
12610 \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}
12611
12612 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
12613 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
12614 \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}
12615 %
12616 \pgfsetrectcap
12617 \pgfusepath{draw}
12618 }
12619 }
12620
12621 % Transconductance amplifier (Transkonduktanzverstärker)
12622 \pgfdeclareshape{gm amp}
12623 {
12624 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12625 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12626 \anchor{center}{\pgfpointorigin}
12627 \savedanchor\northwest{%
12628 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12629 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12630 \pgf@y=.5\pgf@y
12631 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12632 \pgf@x=.5\pgf@x
12633 }
12634 \anchor{south}{
12635 \northwest
12636 \pgf@y=-\pgf@y
12637 }
12638 \anchor{north}{
12639 \northwest
12640 }
12641 \savedanchor\left{%
12642 \pgf@y=0pt
12643 }
12644 \anchor{leftedge}
12645 {\left
12646 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12647 }
12648 \savedanchor\inOneFixed{%
12649 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12650 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12651 \pgf@y=.5\pgf@y
12652 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
12653 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12654 \pgf@x=.5\pgf@x
12655 }
12656 \anchor{in up}{
12657 \inOneFixed
12658 }
12659 \anchor{in down}{
12660 \inOneFixed
12661 \pgf@y=-\pgf@y
12662 }
12663 \savedanchor\inOne{%
12664 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12665 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12666 \pgf@y=.5\pgf@y
12667 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
12668 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12669 \pgf@x=.5\pgf@x
12670 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12671 }
12672 \anchor{-}{
12673 \inOne
12674 }
12675 \anchor{+}{
12676 \inOne
12677 \pgf@y=-\pgf@y
12678 }
12679 \savedanchor\up{%
12680 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12681 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12682 \pgf@y=.5\pgf@y
12683 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12684 \pgf@x=.5\pgf@x
12685 \pgf@circ@res@up = \pgf@y
12686 \pgf@circ@res@right = -\pgf@x
12687 \pgf@circ@res@left = \pgf@x
12688 \pgfpointlineattime{
12689 \ctikzvalof{tripoles/gm amp/up pos}}{
12690 \pgfpoint{
12691 \ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12692 {\pgf@circ@res@up}}
12693 {\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}
12694 }
12695 \anchor{up}{
12696 \up
12697 }
12698 \anchor{down}{
12699 \up
12700 \pgf@y=-\pgf@y
12701 }
12702 \anchor{out}{
12703 \northwest
12704 \pgf@y=0pt
12705 \pgf@x=-\pgf@x
12706 }
12707 \anchor{west}{
12708 \left
12709 }
12710 \anchor{east}{
12711 \left
12712 \pgf@x=-\pgf@x
12713 }
12714 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12715 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12716 \anchor{north west}{ \northwest }
12717 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12718
12719 \anchor{text}{\northwest
12720 \pgf@x=\ctikzvalof{tripoles/op amp/port width}\pgf@x
12721 \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf@x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12722
12723 \backgroundpath{
12724 \pgfsetcolor{\ctikzvalof{color}}
12725
12726 \northwest
12727 \pgf@circ@res@up = \pgf@y
12728 \pgf@circ@res@down = -\pgf@y
12729 \pgf@circ@res@right = -\pgf@x
12730 \pgf@circ@res@left = \pgf@x
12731 \pgf@circ@scaled@Rlen=\scaledRlen
12732
12733 \pgfscope
12734 \newdimen\pgf@circ@res@right@double
12735 \pgf@circ@res@right@double=2\pgf@circ@res@right
12736
12737 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12738 \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12739 \pgf@circ@res@step=\pgf@circ@res@right
12740 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12741 \pgf@circ@res@step=\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@step
12742 %Umrandung:
12743 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{0}} %geändert startpunkt neu am ausgangsstrich
12744 \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
12745 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
12746 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
12747 \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
12748 \pgfpathclose
12749 \pgf@circ@draworfill
12750 \endpgfscope
12751
12752 \pgfpathmoveto{\pgfpoint
12753 {\pgf@circ@res@left}
12754 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
12755 \pgfpathlineto{\pgfpoint
12756 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12757 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
12758 \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$+$\else$-$\fi}
12759
12760
12761 \pgfpathmoveto{\pgfpoint
12762 {\pgf@circ@res@left}
12763 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
12764 \pgfpathlineto{\pgfpoint
12765 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12766 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
12767 \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$-$\else$+$\fi}
12768
12769 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12770 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
12771 \pgfsetrectcap
12772 \pgfusepath{draw}
12773
12774 }
12775 }
12776
12777 % Instrumentation amplifier
12778 \pgfdeclareshape{inst amp}
12779 {
12780 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12781 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12782 % when tikz calls the anchor it wants the relative position in the lengths
12783 % \pgf@x \pgf@y
12784 % \pgfpoint* functions set that variables
12785 % anchors are visible outside and run on use
12786 \anchor{center}{\pgfpointorigin}
12787 % savedanchors are internals and run on node creation (not use)
12788 % bounding-box top left
12789 \savedanchor\northwest{%
12790 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12791 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12792 \pgf@y=.5\pgf@y
12793 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12794 \pgf@x=.5\pgf@x
12795 }
12796 \anchor{nw}{
12797 \northwest
12798 }
12799 \anchor{south}{
12800 \northwest
12801 \pgf@y=-\pgf@y
12802 }
12803 \anchor{north}{
12804 \northwest
12805 }
12806 \savedanchor\left{%
12807 \pgf@y=0pt
12808 }
12809 \anchor{leftedge}
12810 {\left
12811 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12812 }
12813 \savedanchor\inOneFixed{%
12814 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12815 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12816 \pgf@y=.5\pgf@y
12817 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
12818 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12819 \pgf@x=.5\pgf@x
12820 }
12821 \anchor{in up}{
12822 \inOneFixed
12823 }
12824 \anchor{in down}{
12825 \inOneFixed
12826 \pgf@y=-\pgf@y
12827 }
12828 \savedanchor\inOne{%
12829 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12830 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12831 \pgf@y=.5\pgf@y
12832 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
12833 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12834 \pgf@x=.5\pgf@x
12835 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12836 }
12837 \anchor{-}{
12838 \inOne
12839 }
12840 \anchor{+}{
12841 \inOne
12842 \pgf@y=-\pgf@y
12843 }
12844 \savedanchor\up{%
12845 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12846 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12847 \pgf@y=.5\pgf@y
12848 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12849 \pgf@x=.5\pgf@x
12850 \pgf@circ@res@up = \pgf@y
12851 \pgf@circ@res@right = -\pgf@x
12852 \pgf@circ@res@left = \pgf@x
12853 \pgfpointlineattime{
12854 \ctikzvalof{tripoles/inst amp/up pos}}{
12855 \pgfpoint{
12856 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12857 {\pgf@circ@res@up}}
12858 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12859 }
12860 \anchor{up}{
12861 \up
12862 }
12863 \anchor{down}{
12864 \up
12865 \pgf@y=-\pgf@y
12866 }
12867 % reference voltage input anchors.
12868 \savedanchor\refv{%
12869 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12870 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12871 \pgf@y=.5\pgf@y
12872 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12873 \pgf@x=.5\pgf@x
12874 \pgf@circ@res@up = \pgf@y
12875 \pgf@circ@res@right = -\pgf@x
12876 \pgf@circ@res@left = \pgf@x
12877 \pgfpointlineattime{
12878 \ctikzvalof{tripoles/inst amp/refv pos}}{
12879 \pgfpoint{
12880 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12881 {\pgf@circ@res@up}}
12882 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12883 }
12884 % we need both because they are normally drawn under the amp, and if you
12885 % mirror it vertically you need them
12886 \anchor{refv up}{
12887 \refv
12888 }
12889 \anchor{refv down}{
12890 \refv
12891 \pgf@y=-\pgf@y
12892 }
12893 \anchor{out}{
12894 \northwest
12895 \pgf@y=0pt
12896 \pgf@x=-\pgf@x
12897 }
12898 \anchor{west}{
12899 \left
12900 }
12901 \anchor{east}{
12902 \left
12903 \pgf@x=-\pgf@x
12904 }
12905 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12906 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12907 \anchor{north west}{ \northwest }
12908 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12909
12910 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12911
12912 % let's start drawing the component
12913 \backgroundpath{
12914 \pgfsetcolor{\ctikzvalof{color}}
12915 %
12916 \northwest
12917 \pgf@circ@res@up = \pgf@y
12918 \pgf@circ@res@down = -\pgf@y
12919 \pgf@circ@res@right = -\pgf@x
12920 \pgf@circ@res@left = \pgf@x
12921 \pgf@circ@scaled@Rlen=\scaledRlen
12922
12923 % main component, normally in thicker lines
12924 \pgfscope
12925 \newdimen\pgf@circ@res@right@double
12926 \pgf@circ@res@right@double=2\pgf@circ@res@right
12927
12928 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12929 \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12930 \pgf@circ@res@step=\pgf@circ@res@right
12931 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12932 \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@step
12933 %first point (near output)
12934 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{0}}
12935 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
12936 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12937 % and then to the input "front up", "down", to the output short side "down"
12938 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12939 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12940 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@down}}
12941 % ...and close
12942 \pgfpathclose
12943 \pgf@circ@draworfill
12944 \endpgfscope
12945
12946 % Negative input terminal
12947 \pgfpathmoveto{\pgfpoint
12948 {\pgf@circ@res@left}
12949 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
12950 %
12951 \pgfpathlineto{\pgfpoint
12952 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12953 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
12954 %
12955 \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$+$\else$-$\fi}
12956
12957 % Positive input terminal
12958 \pgfpathmoveto{\pgfpoint
12959 {\pgf@circ@res@left}
12960 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
12961 %
12962 \pgfpathlineto{\pgfpoint
12963 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12964 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
12965 \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$-$\else$+$\fi}
12966
12967 % Output terminal
12968 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12969 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} %
12970 %
12971 \pgfsetrectcap
12972 \pgfusepath{draw}
12973 }
12974 }
12975
12976 % Instrumentation amplifier with terminals for gain resistance between inputs
12977 \pgfdeclareshape{inst amp ra}
12978 {
12979 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12980 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12981 \anchor{center}{\pgfpointorigin}
12982 % bounding-box top left
12983 \savedanchor\northwest{%
12984 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12985 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12986 \pgf@y=.5\pgf@y
12987 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12988 \pgf@x=.5\pgf@x
12989 }
12990 \anchor{nw}{
12991 \northwest
12992 }
12993 \anchor{south}{
12994 \northwest
12995 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12996 }
12997 \anchor{north}{
12998 \northwest\pgf@x=0pt\relax
12999 }
13000 \savedanchor\left{%
13001 \pgf@y=0pt
13002 }
13003 \anchor{leftedge}
13004 {\left
13005 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
13006 }
13007 % inputs (+-)
13008 \savedanchor\inOneFixed{%
13009 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13010 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13011 \pgf@y=.5\pgf@y
13012 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
13013 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13014 \pgf@x=.5\pgf@x
13015 }
13016 \anchor{in up}{
13017 \inOneFixed
13018 }
13019 \anchor{in down}{
13020 \inOneFixed
13021 \pgf@y=-\pgf@y
13022 }
13023 \savedanchor\inOne{%
13024 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13025 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13026 \pgf@y=.5\pgf@y
13027 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
13028 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13029 \pgf@x=.5\pgf@x
13030 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13031 }
13032 \anchor{-}{
13033 \inOne
13034 }
13035 \anchor{+}{
13036 \inOne
13037 \pgf@y=-\pgf@y
13038 }
13039 % R ampli anchors. They are by default at 20% more than R-length distance
13040 % you can change that with the `ra pos` key (use 0.5 for one-R).
13041 \savedanchor\raOneFixed{%
13042 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13043 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13044 \pgf@y=.5\pgf@y
13045 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
13046 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13047 \pgf@x=.5\pgf@x
13048 }
13049 \anchor{ra up}{
13050 \inOneFixed
13051 }
13052 \anchor{ra down}{
13053 \inOneFixed
13054 \pgf@y=-\pgf@y
13055 }
13056 \savedanchor\raOne{%
13057 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13058 \pgf@y=\pgf@circ@scaled@Rlen
13059 \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
13060 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13061 \pgf@x=.5\pgf@x
13062 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
13063 }
13064 \anchor{ra-}{
13065 \raOne
13066 }
13067 \anchor{ra+}{
13068 \raOne
13069 \pgf@y=-\pgf@y
13070 }
13071 % power supplies
13072 \savedanchor\up{%
13073 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13074 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13075 \pgf@y=.5\pgf@y
13076 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13077 \pgf@x=.5\pgf@x
13078 \pgf@circ@res@up = \pgf@y
13079 \pgf@circ@res@right = -\pgf@x
13080 \pgf@circ@res@left = \pgf@x
13081 \pgfpointlineattime{
13082 \ctikzvalof{tripoles/inst amp ra/up pos}}{
13083 \pgfpoint{
13084 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13085 {\pgf@circ@res@up}}
13086 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
13087 }
13088 \anchor{up}{
13089 \up
13090 }
13091 \anchor{down}{
13092 \up
13093 \pgf@y=-\pgf@y
13094 }
13095 % reference voltage input anchors.
13096 \savedanchor\refv{%
13097 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13098 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
13099 \pgf@y=0.5\pgf@y
13100 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
13101 \pgf@x=0.5\pgf@x
13102 \pgf@circ@res@up = \pgf@y
13103 \pgf@circ@res@right = -\pgf@x
13104 \pgf@circ@res@left = \pgf@x
13105 \pgfpointlineattime{
13106 \ctikzvalof{tripoles/inst amp ra/refv pos}}{
13107 \pgfpoint{
13108 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13109 {\pgf@circ@res@up}}
13110 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
13111 }
13112 % we need both because they are normally drawn under the amp, and if you
13113 % mirror it vertically you need them
13114 \anchor{refv up}{
13115 \refv
13116 }
13117 \anchor{refv down}{
13118 \refv
13119 \pgf@y=-\pgf@y
13120 }
13121 \anchor{out}{
13122 \northwest
13123 \pgf@y=0pt
13124 \pgf@x=-\pgf@x
13125 }
13126 \anchor{west}{
13127 \left
13128 }
13129 \anchor{east}{
13130 \left
13131 \pgf@x=-\pgf@x
13132 }
13133 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13134 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13135 \anchor{north west}{ \northwest }
13136 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13137
13138 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13139
13140 % drawing of the component
13141 \backgroundpath{
13142 \pgfsetcolor{\ctikzvalof{color}}
13143
13144 \northwest
13145 \pgf@circ@res@up = \pgf@y
13146 \pgf@circ@res@down = -\pgf@y
13147 \pgf@circ@res@right = -\pgf@x
13148 \pgf@circ@res@left = \pgf@x
13149 \pgf@circ@scaled@Rlen=\scaledRlen
13150
13151 \newdimen\pgf@circ@res@right@double
13152 \pgf@circ@res@right@double=2\pgf@circ@res@right
13153
13154 % main component, normally in thicker lines
13155 \pgfscope
13156 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13157 \pgftransformxshift{\ctikzvalof{tripoles/inst amp ra/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/inst amp ra/port width}\pgf@circ@res@step
13161 %primer punto: la linea de salida (lado componente)
13162 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/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 anchor
13164 \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}}
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/inst amp ra/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@down}}
13169 % ...and close
13170 \pgfpathclose
13171 \pgf@circ@draworfill
13172 \endpgfscope
13173
13174 % ra terminal -
13175 \pgfpathmoveto{\pgfpoint
13176 {\pgf@circ@res@left}
13177 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13178 %
13179 \pgfpathlineto{\pgfpoint
13180 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13181 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13182 % ra terminal +
13183 \pgfpathmoveto{\pgfpoint
13184 {\pgf@circ@res@left}
13185 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13186 %
13187 \pgfpathlineto{\pgfpoint
13188 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13189 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
13190
13191 % Negative input terminal
13192 \pgfpathmoveto{\pgfpoint
13193 {\pgf@circ@res@left}
13194 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
13195 %
13196 \pgfpathlineto{\pgfpoint
13197 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13198 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
13199 %
13200 \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$+$\else$-$\fi}
13201
13202 % Positive input terminal
13203 \pgfpathmoveto{\pgfpoint
13204 {\pgf@circ@res@left}
13205 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
13206 %
13207 \pgfpathlineto{\pgfpoint
13208 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
13209 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
13210 \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$-$\else$+$\fi}
13211
13212 % Output terminal
13213 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13214 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} %
13215 %
13216 \pgfsetrectcap
13217 \pgfusepath{draw}
13218 }
13219 }
13220
13221 % Buffer
13222 % Contributed by Danilo Piazzalunga
13223 \pgfdeclareshape{buffer}
13224 {
13225 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13226 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13227 \anchor{center}{\pgfpointorigin}
13228 \savedanchor\northwest{%
13229 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13230 \pgf@y=\ctikzvalof{bipoles/buffer/height}\pgf@circ@scaled@Rlen
13231 \pgf@y=.5\pgf@y
13232 \pgf@x=-\ctikzvalof{bipoles/buffer/width}\pgf@circ@scaled@Rlen
13233 \pgf@x=.5\pgf@x
13234 }
13235 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
13236 \anchor{west}{ \northwest \pgf@y=0pt }
13237 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
13238 \anchor{north}{ \northwest \pgf@x=0pt }
13239 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13240 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13241 \anchor{north west}{ \northwest }
13242 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13243 \savedanchor\left{%
13244 \pgf@y=0pt
13245 }
13246 \anchor{in}{
13247 \northwest
13248 \pgf@y=0pt
13249 }
13250 \anchor{out}{
13251 \northwest
13252 \pgf@y=0pt
13253 \pgf@x=-\pgf@x
13254 }
13255
13256 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13257
13258 \backgroundpath{
13259 \pgfsetcolor{\ctikzvalof{color}}
13260
13261 \northwest
13262 \pgf@circ@res@up = \pgf@y
13263 \pgf@circ@res@down = -\pgf@y
13264 \pgf@circ@res@right = -\pgf@x
13265 \pgf@circ@res@left = \pgf@x
13266 \pgf@circ@scaled@Rlen=\scaledRlen
13267 \pgfscope
13268 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13269 \pgftransformxshift{.7\pgf@circ@res@left}
13270 \pgf@circ@res@step=\pgf@circ@res@right
13271 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13272 \pgf@circ@res@step=.7\pgf@circ@res@step
13273
13274 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13275 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13276 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13277 \pgfpathclose
13278 \pgf@circ@draworfill
13279 \endpgfscope
13280
13281 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
13282 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
13283
13284 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13285 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
13286
13287 \pgfusepath{draw}
13288 }
13289 }
13290
13291 % plain amplifier, no symbols
13292 \pgfdeclareshape{plain amp}
13293 {
13294 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
13295 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13296 \anchor{center}{\pgfpointorigin}
13297 \savedanchor\northwest{%
13298 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13299 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
13300 \pgf@y=.5\pgf@y
13301 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
13302 \pgf@x=.5\pgf@x
13303 }
13304 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
13305 \anchor{west}{ \northwest \pgf@y=0pt }
13306 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
13307 \anchor{north}{ \northwest \pgf@x=0pt }
13308 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13309 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13310 \anchor{north west}{ \northwest }
13311 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13312 \savedanchor\left{%
13313 \pgf@y=0pt
13314 }
13315 \savedanchor\inOne{%
13316 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13317 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
13318 \pgf@y=.5\pgf@y
13319 \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
13320 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
13321 \pgf@x=.5\pgf@x
13322 }
13323 \anchor{-}{
13324 \inOne
13325 }
13326 \anchor{+}{
13327 \inOne
13328 \pgf@y=-\pgf@y
13329 }
13330 \anchor{in up}{
13331 \inOne
13332 }
13333 \anchor{in down}{
13334 \inOne
13335 \pgf@y=-\pgf@y
13336 }
13337 \savedanchor\up{%
13338 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13339 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
13340 \pgf@y=.5\pgf@y
13341 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
13342 \pgf@x=.5\pgf@x
13343 \pgf@circ@res@up = \pgf@y
13344 \pgf@circ@res@right = -\pgf@x
13345 \pgf@circ@res@left = \pgf@x
13346 \pgfpointlineattime{
13347 \ctikzvalof{tripoles/plain amp/up pos}}{
13348 \pgfpoint{
13349 \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13350 {\pgf@circ@res@up}}
13351 {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
13352 }
13353 \anchor{up}{
13354 \up
13355 }
13356 \anchor{down}{
13357 \up
13358 \pgf@y=-\pgf@y
13359 }
13360 \anchor{out}{
13361 \northwest
13362 \pgf@y=0pt
13363 \pgf@x=-\pgf@x
13364 }
13365
13366 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13367
13368 \backgroundpath{
13369 \pgfsetcolor{\ctikzvalof{color}}
13370
13371 \northwest
13372 \pgf@circ@res@up = \pgf@y
13373 \pgf@circ@res@down = -\pgf@y
13374 \pgf@circ@res@right = -\pgf@x
13375 \pgf@circ@res@left = \pgf@x
13376
13377 \pgfscope
13378 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13379 \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13380 \pgf@circ@res@step=\pgf@circ@res@right
13381 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13382 \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
13383
13384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13385 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13386 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13387 \pgfpathclose
13388 \pgf@circ@draworfill
13389 \endpgfscope
13390 \pgfpathmoveto{\pgfpoint
13391 {\pgf@circ@res@left}
13392 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
13393 \pgfpathlineto{\pgfpoint
13394 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13395 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
13396
13397
13398 \pgfpathmoveto{\pgfpoint
13399 {\pgf@circ@res@left}
13400 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
13401 \pgfpathlineto{\pgfpoint
13402 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13403 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
13404
13405 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13406 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
13407
13408 \pgfusepath{draw}
13409 }
13410 }
13411
13412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13413 %% electromechanical device (motor/generator)
13414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13415
13416 \pgfdeclareshape{elmech}
13417 {
13418 \savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}}
13419 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13420 \savedanchor\northwest{
13421 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13422 \pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
13423 \pgf@y=.5\pgf@y
13424 \pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
13425 \pgf@x=.5\pgf@x
13426 }
13427 \anchor{center}{
13428 \pgfpointorigin
13429 }
13430 \anchor{text}{
13431 \pgfpointorigin
13432 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
13433 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
13434 }
13435 \anchor{left}{%
13436 \northwest
13437 \pgf@y=0pt
13438 }
13439 \anchor{right}{%
13440 \northwest
13441 \pgf@y=0pt
13442 \pgf@x=-\pgf@x
13443 }
13444 \anchor{top}{
13445 \northwest
13446 \pgf@x=0pt
13447 }
13448 \anchor{pathstart}{
13449 \northwest
13450 \pgf@x=0pt
13451 }
13452 \anchor{pathend}{
13453 \northwest
13454 \pgf@x=0pt
13455 \pgf@y=-\pgf@y
13456 }
13457 \anchor{bottom}{
13458 \northwest
13459 \pgf@x=0pt
13460 \pgf@y=-\pgf@y
13461 }
13462 \anchor{center}{
13463 \pgf@y=0pt
13464 \pgf@x=0pt
13465 }
13466 \anchor{east}{
13467 \northwest
13468 \pgf@y=0pt
13469 \pgf@x=-\pgf@x
13470 }
13471 \anchor{west}{
13472 \northwest
13473 \pgf@y=0pt
13474 }
13475 \anchor{south}{
13476 \northwest
13477 \pgf@x=0pt
13478 \pgf@y=-\pgf@y
13479 }
13480 \anchor{north}{
13481 \northwest
13482 \pgf@x=0pt
13483 }
13484 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13485 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13486 \anchor{north west}{ \northwest }
13487 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13488 \anchorborder{%
13489 \@tempdima=\pgf@x\@tempdimb=\pgf@y
13490 \northwest\pgf@circ@res@other=-\pgf@x
13491 \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}}
13492 }
13493 \anchor{block north west}{\northwest\pgf@x=0.5\pgf@x}
13494 \anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y}
13495 \anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x}
13496 \anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y}
13497 \anchor{block up right}{
13498 \northwest
13499 % remember that pgf@x is negative
13500 % center of the block is at 0.5*H+W*cos(30)/2
13501 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13502 \pgf@x=-0.5\pgf@x
13503 }
13504 \anchor{block up left}{
13505 \northwest
13506 % remember that pgf@x is negative
13507 % center of the block is at 0.5*H+W*cos(30)/2
13508 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13509 \pgf@x=0.5\pgf@x
13510 }
13511 \anchor{block down right}{
13512 \northwest
13513 % remember that pgf@x is negative
13514 % center of the block is at 0.5*H+W*cos(30)/2
13515 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13516 \pgf@y=-\pgf@y
13517 \pgf@x=-0.5\pgf@x
13518 }
13519 \anchor{block down left}{
13520 \northwest
13521 % remember that pgf@x is negative
13522 % center of the block is at 0.5*H+W*cos(30)/2
13523 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13524 \pgf@y=-\pgf@y
13525 \pgf@x=0.5\pgf@x
13526 }
13527 \behindbackgroundpath{
13528 \pgfsetcolor{\ctikzvalof{color}}
13529 \pgf@circ@scaled@Rlen=\scaledRlen
13530 \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
13531 \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
13532 \pgfscope
13533 \pgfstartlinewidth=\pgflinewidth
13534 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
13535 \pgfscope % clip the bar: whole size minus the circle
13536 \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
13537 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
13538 \pgfseteorule
13539 \pgfusepath{clip}
13540 \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
13541 \pgfsetfillcolor{\ctikzvalof{color}}
13542 \pgfusepath{fill, draw}
13543 \endpgfscope
13544 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
13545 \ifx\tikz@fillcolor\pgfutil@empty
13546 % set the default fill color to white
13547 \pgfsetfillcolor{white}
13548 % ...but override it if the class is defined!
13549 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
13550 \else
13551 \pgfsetfillcolor{\tikz@fillcolor}
13552 \pgfusepath{draw, fill}
13553 \fi
13554 \endpgfscope
13555 }
13556 }
13557
13558 %%%%%%%%%%%%%%%%%%%
13559 %% Magnetron
13560 %%%%%%%%%%%%%%%%%%%
13561
13562 \pgfdeclareshape{magnetron}
13563 {
13564 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}} % class of these components
13565 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13566 \savedanchor\northwest{
13567 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13568 \pgf@y=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13569 \pgf@y=.5\pgf@y
13570 \pgf@x=-\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13571 \pgf@x=.5\pgf@x
13572 }
13573 \anchor{center}{
13574 \pgfpointorigin
13575 }
13576 \anchor{anode}{
13577 \northwest
13578 \pgf@x=0pt
13579 \pgf@y=-\pgf@y
13580 }
13581 \anchor{cathode1}{
13582 \northwest
13583 \pgf@circ@res@step=\pgf@y
13584 \pgfmathparse{cos(105)}
13585 \pgf@x=\pgfmathresult\pgf@circ@res@step
13586 \pgfmathparse{sin(105)}
13587 \pgf@y=\pgfmathresult\pgf@circ@res@step
13588 %\pgfpointorigin
13589 %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
13590 }
13591 \anchor{cathode2}{
13592 \northwest
13593 \pgf@circ@res@step=\pgf@y
13594 \pgfmathparse{cos(75)}
13595 \pgf@x=\pgfmathresult\pgf@circ@res@step
13596 \pgfmathparse{sin(75)}
13597 \pgf@y=\pgfmathresult\pgf@circ@res@step
13598 %\pgfpointorigin
13599 %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
13600 }
13601 \anchor{text}{
13602 \pgfpointorigin
13603 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
13604 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
13605 }
13606 \anchor{left}{%
13607 \northwest
13608 \pgf@y=0pt
13609 }
13610 \anchor{right}{%
13611 \northwest
13612 \pgf@y=0pt
13613 \pgf@x=-\pgf@x
13614 }
13615 \anchor{top}{
13616 \northwest
13617 \pgf@x=0pt
13618 }
13619 \anchor{pathstart}{
13620 \northwest
13621 \pgf@x=0pt
13622 }
13623 \anchor{pathend}{
13624 \northwest
13625 \pgf@x=0pt
13626 \pgf@y=-\pgf@y
13627 }
13628 \anchor{bottom}{
13629 \northwest
13630 \pgf@x=0pt
13631 \pgf@y=-\pgf@y
13632 }
13633 \anchor{center}{
13634 \pgf@y=0pt
13635 \pgf@x=0pt
13636 }
13637 \anchor{east}{
13638 \northwest
13639 \pgf@y=0pt
13640 \pgf@x=-\pgf@x
13641 }
13642 \anchor{west}{
13643 \northwest
13644 \pgf@y=0pt
13645 }
13646 \anchor{south}{
13647 \northwest
13648 \pgf@x=0pt
13649 \pgf@y=-\pgf@y
13650 }
13651 \anchor{north}{
13652 \northwest
13653 \pgf@x=0pt
13654 }
13655 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13656 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13657 \anchor{north west}{ \northwest }
13658 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13659 \backgroundpath{
13660 \pgfsetcolor{\ctikzvalof{color}}
13661 \pgf@circ@scaled@Rlen=\scaledRlen
13662 \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13663 \northwest
13664 \pgf@circ@res@up = \pgf@y
13665 \pgf@circ@res@down = -\pgf@y
13666 \pgf@circ@res@right = -\pgf@x
13667 \pgf@circ@res@left = \pgf@x
13668 \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
13669
13670 \pgfscope
13671 \pgfstartlinewidth=\pgflinewidth
13672 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
13673 %create outer circle
13674 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
13675 \pgf@circ@draworfill
13676 %create chambers
13677 \foreach \angle in {45,135,225,315}{
13678 \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
13679 \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
13680 }
13681 \pgfsetroundcap
13682 \pgfusepath{draw}
13683 \pgfscope
13684 %draw connection from outside
13685 %anode
13686 \pgfsetlinewidth{\pgfstartlinewidth}
13687 \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
13688 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
13689 %cathodes
13690 \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
13691 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13692 \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
13693 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13694 \pgfsetbuttcap
13695 \pgfusepath{draw}
13696 \endpgfscope
13697 %create cathode
13698 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13699 \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
13700 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13701 \pgfusepath{draw}
13702 %create anode
13703 \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
13704 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
13705
13706 \pgfsetbuttcap
13707 \pgfusepath{draw}
13708 \endpgfscope
13709 }
13710 }
13711
13712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13713 % Electronic tubes, submitted by J. op den Brouw
13714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13715
13716 % Draw tube outline
13717 \def\pgf@circ@tubes@drawtube{%
13718 \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
13719 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13720 \pgfutil@tempdima=\pgf@circ@res@right
13721 \advance\pgfutil@tempdima by -\pgf@circ@res@up
13722 \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
13723 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
13724 \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
13725 \pgfpatharc{270}{90}{\pgf@circ@res@up}
13726 \else
13727 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
13728 \pgfutil@tempdima=\pgf@circ@res@up
13729 \advance\pgfutil@tempdima by -\pgf@circ@res@right
13730 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
13731 \pgfpatharc{180}{0}{\pgf@circ@res@right}
13732 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
13733 \pgfpatharc{180}{0}{-\pgf@circ@res@right}
13734 \fi
13735 \pgfpathclose
13736 }
13737
13738 %% The diode (tube), triode, tetrode and pentode only differ in the
13739 %% number of grids. So we construct a generic declare function in
13740 %% which we can put code for the grid anchors and grid drawing code
13741 %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
13742 \long\def\pgfcircdeclaretube#1#2#3{%
13743 \pgfdeclareshape{#1}{
13744 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
13745 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13746 \anchor{center}{
13747 \pgfpointorigin
13748 }
13749 \savedanchor\northwest{%
13750 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13751 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13752 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13753 % x and y should be half the Rlen
13754 \pgf@y=\pgf@circ@res@up
13755 \pgf@y=.5\pgf@y
13756 \pgf@x=-\pgf@circ@res@right
13757 \pgf@x=.5\pgf@x
13758 }
13759 \anchor{north} {%
13760 \northwest
13761 \pgf@x=0pt
13762 }
13763 \anchor{east}{%
13764 \northwest
13765 \pgf@x=-\pgf@x
13766 \pgf@y=0pt
13767 }
13768 \anchor{south}{%
13769 \northwest
13770 \pgf@y=-\pgf@y
13771 \pgf@x=0pt
13772 }
13773 \anchor{west}{%
13774 \northwest
13775 \pgf@y=0pt
13776 }
13777 \anchor{north west}{%
13778 \northwest
13779 }
13780 \anchor{north east}{%
13781 \northwest
13782 \pgf@x=-\pgf@x
13783 }
13784 \anchor{south east}{
13785 \northwest
13786 \pgf@x=-\pgf@x
13787 \pgf@y=-\pgf@y
13788 }
13789 \anchor{south west}{
13790 \northwest
13791 \pgf@y=-\pgf@y
13792 }
13793 \anchor{anode} {%
13794 \northwest
13795 \pgf@x=0pt
13796 }
13797 \anchor{cathode}{%
13798 \northwest
13799 \pgf@y=-\pgf@y
13800 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
13801 }
13802 \anchor{cathode 1}{%
13803 \northwest
13804 \pgf@y=-\pgf@y
13805 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
13806 }
13807 \anchor{cathode 2}{%
13808 \northwest
13809 \pgf@y=-\pgf@y
13810 \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
13811 }
13812 \anchor{filament 1}{%
13813 \northwest
13814 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13815 \pgf@x=\pgfmathresult\pgf@x
13816 \pgf@y=-\pgf@y
13817 }
13818 \anchor{filament 2}{%
13819 \northwest
13820 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13821 \pgf@x=-\pgfmathresult\pgf@x
13822 \pgf@y=-\pgf@y
13823 }
13824
13825 % Extra anchors
13826 #2
13827
13828 \backgroundpath{
13829 \pgfscope
13830 % Line width for tripoles
13831 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13832 \pgf@circ@scaled@Rlen=\scaledRlen
13833
13834 % Setup to draw tube
13835 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13836 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13837 \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
13838 \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13839
13840 % Tube outline
13841 \pgf@circ@tubes@drawtube
13842
13843 % Setup to draw grid, filament, anode and cathode
13844 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13845 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13846 \pgf@circ@res@up=0.5\pgf@circ@res@up
13847 \pgf@circ@res@right=0.5\pgf@circ@res@right
13848
13849 % Tube fill color (if any)
13850 \pgf@circ@draworfill
13851
13852 % Grid drawing
13853 #3
13854
13855 % Filament (is not drawn by default)
13856 \ifpgf@circuit@tubes@filament
13857 \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
13858 \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
13859 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13860 \pgf@xa=\pgfmathresult\pgf@circ@res@right
13861 \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
13862 \pgf@ya=\pgfmathresult\pgf@circ@res@up
13863 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
13864 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
13865 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
13866 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
13867 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
13868 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
13869 \pgf@circuit@tubes@filamentfalse
13870 \fi
13871
13872 % Anode (or plate)
13873 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
13874 \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13875 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13876 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13877
13878 % Cathode
13879 \ifpgf@circuit@tubes@nocathode
13880 \pgf@circuit@tubes@nocathodefalse
13881 \else
13882 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
13883 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
13884 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
13885 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
13886 \ifpgf@circuit@tubes@fullcathode
13887 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
13888 \pgf@circuit@tubes@fullcathodefalse
13889 \else
13890 \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}}
13891 \fi
13892 \fi
13893
13894 % Draw the background
13895 \pgfusepath{draw}
13896 \endpgfscope
13897 }
13898 }
13899 }
13900
13901 \pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
13902
13903 \pgfcircdeclaretube{triode}
13904 {
13905 \anchor{grid} {% should not be used
13906 \northwest
13907 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13908 }
13909 \anchor{control} {%
13910 \northwest
13911 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13912 }
13913 }
13914 {
13915 % Grid protrusion
13916 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13917 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13918 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13919 \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13920 % Grid dashes: calculations
13921 \pgf@xb=2\pgf@circ@res@right
13922 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13923 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13924 \multiply\pgf@circ@count@a by 2\relax
13925 \advance\pgf@circ@count@a by 1\relax
13926 \advance\pgf@circ@res@step by -\pgf@xa
13927 \divide\pgf@circ@res@step by \pgf@circ@count@a
13928 % Grid dashes: draw
13929 \pgf@circ@res@temp=\pgf@xa
13930 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13931 \loop
13932 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13933 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13934 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13935 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13936 \advance\pgf@circ@count@a by-1
13937 \ifnum\pgf@circ@count@a>0\relax
13938 \repeat
13939 }
13940
13941 \pgfcircdeclaretube{tetrode}
13942 {
13943 \anchor{grid} {% should not be used
13944 \northwest
13945 \pgfutil@tempdima=\pgf@y
13946 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13947 \pgf@y=0.5\pgf@y
13948 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13949 }
13950 \anchor{control} {%
13951 \northwest
13952 \pgfutil@tempdima=\pgf@y
13953 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13954 \pgf@y=0.5\pgf@y
13955 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13956 }
13957 \anchor{screen} {%
13958 \northwest
13959 \pgfutil@tempdima=\pgf@y
13960 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
13961 \pgf@y=0.5\pgf@y
13962 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13963 }
13964 }
13965 {
13966 % Grid x/y points
13967 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13968 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13969 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
13970 \pgfutil@tempdimb=-\pgfutil@tempdima
13971 \pgfutil@tempdima=0.5\pgfutil@tempdima
13972 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13973 \pgfutil@tempdimb=0.5\pgfutil@tempdimb
13974 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13975 % Grid protrusion
13976 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
13977 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
13978 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
13979 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
13980 % Grid dashes: calculations
13981 \pgf@xb=2\pgf@circ@res@right
13982 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13983 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13984 \multiply\pgf@circ@count@a by 2\relax
13985 \advance\pgf@circ@count@a by 1\relax
13986 \advance\pgf@circ@res@step by -\pgf@xa
13987 \divide\pgf@circ@res@step by \pgf@circ@count@a
13988 % Grid dashes: draw
13989 \pgf@circ@res@temp=\pgf@xa
13990 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13991 \loop
13992 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13993 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
13994 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
13995 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
13996 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
13997 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13998 \advance\pgf@circ@count@a by-1
13999 \ifnum\pgf@circ@count@a>0\relax
14000 \repeat
14001 }
14002
14003 \pgfcircdeclaretube{pentode}
14004 {
14005 \anchor{grid} {% should not be used
14006 \northwest
14007 \pgfutil@tempdima=\pgf@y
14008 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14009 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14010 }
14011 \anchor{control} {%
14012 \northwest
14013 \pgfutil@tempdima=\pgf@y
14014 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14015 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14016 }
14017 \anchor{screen} {%
14018 \northwest
14019 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14020 }
14021 \anchor{suppressor} {%
14022 \northwest
14023 \pgfutil@tempdima=\pgf@y
14024 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
14025 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14026 }
14027 }
14028 {
14029 % Grid x/y points
14030 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14031 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14032 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
14033 \pgfutil@tempdimb=-\pgfutil@tempdima
14034 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14035 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14036 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14037 % Grid protrusion
14038 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
14039 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
14040 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
14041 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
14042 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
14043 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
14044 % Grid dashes: calculations
14045 \pgf@xb=2\pgf@circ@res@right
14046 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14047 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14048 \multiply\pgf@circ@count@a by 2\relax
14049 \advance\pgf@circ@count@a by 1\relax
14050 \advance\pgf@circ@res@step by -\pgf@xa
14051 \divide\pgf@circ@res@step by \pgf@circ@count@a
14052 % Grid dashes: draw
14053 \pgf@circ@res@temp=\pgf@xa
14054 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14055 \loop
14056 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14057 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
14058 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
14059 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
14060 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
14061 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
14062 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
14063 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14064 \advance\pgf@circ@count@a by-1
14065 \ifnum\pgf@circ@count@a>0\relax
14066 \repeat
14067 }
14068
14069 \pgfcircdeclaretube{pentode suppressor to cathode}
14070 {
14071 \anchor{grid} {% should not be used
14072 \northwest
14073 \pgfutil@tempdima=\pgf@y
14074 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14075 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14076 }
14077 \anchor{control} {%
14078 \northwest
14079 \pgfutil@tempdima=\pgf@y
14080 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
14081 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
14082 }
14083 \anchor{screen} {%
14084 \northwest
14085 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
14086 }
14087 }
14088 {
14089 % Grid x/y points
14090 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
14091 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
14092 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
14093 \pgfutil@tempdimb=-\pgfutil@tempdima
14094 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14095 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14096 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
14097 % Grid protrusion
14098 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
14099 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
14100 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
14101 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
14102 % Grid dashes: calculations
14103 \pgf@xb=2\pgf@circ@res@right
14104 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
14105 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
14106 \multiply\pgf@circ@count@a by 2\relax
14107 \advance\pgf@circ@count@a by 1\relax
14108 \advance\pgf@circ@res@step by -\pgf@xa
14109 \divide\pgf@circ@res@step by \pgf@circ@count@a
14110 % Grid dashes: draw
14111 \pgf@circ@res@temp=\pgf@xa
14112 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
14113 \loop
14114 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14115 \ifnum\pgf@circ@count@a>1\relax
14116 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
14117 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
14118 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
14119 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
14120 \fi
14121 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
14122 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
14123 \advance\pgf@circ@res@temp by\pgf@circ@res@step
14124 \advance\pgf@circ@count@a by-1
14125 \ifnum\pgf@circ@count@a>0\relax
14126 \repeat
14127 % Grid: connection from suppressor to cathode
14128 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
14129 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
14130 \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}}
14131
14132 }
14133
14134 %%%---------- close: tex/pgfcirctripoles
14135 %%%%%%%%%%% Springe nach tex/pgfcircquadpoles
14136 %%%---------- open: tex/pgfcircquadpoles.tex
14137 % Copyright 2007-2009 by Massimo Redaelli
14138 %
14139 % This file may be distributed and/or modified
14140 %
14141 % 1. under the LaTeX Project Public License and/or
14142 % 2. under the GNU Public License.
14143 %
14144 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
14145
14146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14147 %% Quadripoles
14148
14149 \long\def\pgfcircdeclarequadpole#1#2#3{
14150 \pgfdeclareshape{#1}
14151 {
14152 \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}}
14153 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14154 % shapename
14155 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
14156 \anchor{center}{
14157 \northwest
14158 \pgf@x=0pt
14159 \pgf@y=0pt
14160 }
14161 \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
14162 \savedanchor\northwest{%
14163 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14164 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
14165 \pgf@y=.5\pgf@y
14166 \pgf@x=.5\pgf@circ@scaled@Rlen
14167 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
14168 }
14169 %% we define the upper right (positive coord) dot (which is B1)
14170 \savedanchor{\innerdot}{%
14171 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14172 \pgf@xa=.5\pgf@circ@scaled@Rlen
14173 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
14174 % by default use the cute inductor size
14175 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
14176 % check if it's american
14177 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
14178 \edef\pgf@temp{american}
14179 \ifx\pgf@circ@temp\pgf@temp
14180 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
14181 \fi
14182 % check if it's european
14183 \edef\pgf@temp{european}
14184 \ifx\pgf@circ@temp\pgf@temp
14185 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
14186 \fi
14187 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
14188 }
14189 \savedanchor{\outerdot}{%
14190 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14191 \pgf@xa=.5\pgf@circ@scaled@Rlen
14192 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
14193 % by default use the cute inductor size
14194 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
14195 % check if it's american
14196 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
14197 \edef\pgf@temp{american}
14198 \ifx\pgf@circ@temp\pgf@temp
14199 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
14200 \fi
14201 % check if it's european
14202 \edef\pgf@temp{european}
14203 \ifx\pgf@circ@temp\pgf@temp
14204 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
14205 \fi
14206 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
14207 }
14208 \anchor{A2}{
14209 \northwest
14210 \pgf@y=-\pgf@y
14211 }
14212 \anchor{B1}{
14213 \northwest
14214 \pgf@x=-\pgf@x
14215 }
14216 \anchor{A1}{
14217 \northwest
14218 }
14219 \anchor{B2}{
14220 \northwest
14221 \pgf@x=-\pgf@x
14222 \pgf@y=-\pgf@y
14223 }
14224 %% dot's anchors
14225 \anchor{inner dot A1}{\innerdot\pgf@x=-\pgf@x}
14226 \anchor{outer dot A1}{\outerdot\pgf@x=-\pgf@x}
14227 \anchor{inner dot A2}{\innerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
14228 \anchor{outer dot A2}{\outerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
14229 \anchor{inner dot B1}{\innerdot}
14230 \anchor{outer dot B1}{\outerdot}
14231 \anchor{inner dot B2}{\innerdot\pgf@y=-\pgf@y}
14232 \anchor{outer dot B2}{\outerdot\pgf@y=-\pgf@y}
14233 % geographical
14234 \anchor{north}{
14235 \northwest
14236 \pgf@x=0pt
14237 }
14238 \anchor{south}{
14239 \northwest
14240 \pgf@x=0pt
14241 \pgf@y=-\pgf@y
14242 }
14243 \anchor{west}{
14244 \northwest
14245 \pgf@y=0pt
14246 }
14247 \anchor{east}{
14248 \northwest
14249 \pgf@y=0pt
14250 \pgf@x=-\pgf@x
14251 }
14252 \anchor{south west}{
14253 \northwest
14254 \pgf@y=-\pgf@y
14255 }
14256 \anchor{north east}{
14257 \northwest
14258 \pgf@x=-\pgf@x
14259 }
14260 \anchor{north west}{
14261 \northwest
14262 }
14263 \anchor{south east}{
14264 \northwest
14265 \pgf@x=-\pgf@x
14266 \pgf@y=-\pgf@y
14267 }
14268 \anchor{base}{
14269 \northwest
14270 \pgf@x=0pt
14271 }
14272 #3
14273 \backgroundpath{
14274 \pgfsetcolor{\ctikzvalof{color}}
14275
14276 \northwest
14277 \pgf@circ@res@up = \pgf@y
14278 \pgf@circ@res@down = -\pgf@y
14279 \pgf@circ@res@right = -\pgf@x
14280 \pgf@circ@res@left = \pgf@x
14281 #2
14282 }
14283 }
14284 }
14285
14286
14287 \def\pgf@circ@drawtransformerbasicanchor{
14288 \ctikzvalof{quadpoles/trans/height}
14289 \anchor{AA2}{
14290 \northwest
14291 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
14292 \pgf@x=.7\pgf@x
14293 \pgf@y=-\pgf@y
14294 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
14295 }
14296 \anchor{BB1}{
14297 \northwest
14298 \pgf@x=-\pgf@x
14299 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
14300 \pgf@x=.7\pgf@x
14301 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
14302 }
14303 \anchor{AA1}{
14304 \northwest
14305 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
14306 \pgf@x=.7\pgf@x
14307 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
14308 }
14309 \anchor{BB2}{
14310 \northwest
14311 \pgf@x=-\pgf@x
14312 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
14313 \pgf@x=.7\pgf@x
14314 \pgf@y=-\pgf@y
14315 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
14316 }
14317 }
14318
14319 %% Null styles that can be used to change individually the L1 and L2
14320 %% inductors of the transformer.
14321
14322 \ctikzset{transformer L1/.style={}}
14323 \ctikzset{transformer L2/.style={}}
14324
14325 \def\pgf@circ@drawtransformerbasicbody{
14326 \pgfscope
14327 \pgfslopedattimetrue
14328 \pgfallowupsidedownattimetrue
14329 \pgftransformlineattime{.5}{%
14330 \pgfpoint%
14331 {\stretto\pgf@circ@res@left}%
14332 {\pgf@circ@res@up}%
14333 }{%
14334 \pgfpoint
14335 {\stretto\pgf@circ@res@left}%
14336 {\pgf@circ@res@down}%
14337 }
14338
14339 \pgfkeys{\circuitikzbasekey/.cd, transformer L1}
14340 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
14341 \def\pgf@temp{european}%
14342 \ifx\pgf@temp\pgf@circ@temp%
14343 \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14344 \else%
14345 \def\pgf@temp{cute}
14346 \ifx\pgf@temp\pgf@circ@temp%
14347 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14348 \else%
14349 \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14350 \fi%
14351 \fi%
14352
14353
14354 \endpgfscope
14355 \pgfscope
14356 \pgfslopedattimetrue
14357 \pgfallowupsidedownattimetrue
14358 \pgftransformlineattime{.5}{%
14359 \pgfpoint%
14360 {\stretto\pgf@circ@res@right}%
14361 {\pgf@circ@res@down}%
14362 }{%
14363 \pgfpoint
14364 {\stretto\pgf@circ@res@right}%
14365 {\pgf@circ@res@up}%
14366 }
14367
14368 \pgfkeys{\circuitikzbasekey/.cd, transformer L2}
14369 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
14370 \def\pgf@temp{european}%
14371 \ifx\pgf@temp\pgf@circ@temp%
14372 \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14373 \else%
14374 \def\pgf@temp{cute}
14375 \ifx\pgf@temp\pgf@circ@temp%
14376 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14377 \else%
14378 \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14379 \fi%
14380 \fi%
14381
14382 \endpgfscope
14383
14384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
14385 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
14386 \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}}
14387
14388 \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}}
14389 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
14390 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
14391
14392 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
14393 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
14394 \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}}
14395
14396 \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}}
14397 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
14398 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14399
14400 \pgfusepath{draw}
14401
14402 }
14403
14404
14405 \pgfcircdeclarequadpole{transformer}{
14406 \pgf@circ@drawtransformerbasicbody
14407 }{\pgf@circ@drawtransformerbasicanchor}
14408
14409 \pgfcircdeclarequadpole{transformer core}{
14410
14411 \pgf@circ@drawtransformerbasicbody
14412
14413 % use the chocke line thickness
14414 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
14415
14416 % Find the distance from center for the lines representing the core
14417 % the 2.5 is for backward compatibility --- the distance was calculated as a fraction
14418 % of the whole component, now as a fraction of the distance between coils, to be
14419 % compatible with the quadpoles "inner" style.
14420 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
14421
14422 \pgfmoveto{\pgfpoint%
14423 {\pgf@circ@res@other}%
14424 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
14425 }
14426 \pgflineto{
14427 \pgfpoint%
14428 {\pgf@circ@res@other}%
14429 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
14430 }
14431
14432 %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
14433 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
14434 \pgfmoveto{\pgfpoint%
14435 {\pgf@circ@res@other}%
14436 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
14437 }
14438 \pgflineto{
14439 \pgfpoint%
14440 {\pgf@circ@res@other}%
14441 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
14442 }
14443
14444 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
14445 \pgfusepath{draw}
14446 }{\pgf@circ@drawtransformerbasicanchor}
14447
14448
14449 \pgfcircdeclarequadpole{gyrator}{
14450
14451 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
14452 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
14453 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
14454 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
14455
14456 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
14457 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
14458 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
14459 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14460
14461 \pgfusepath{draw}
14462
14463 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
14464 \pgfmathsetlength{\pgf@circ@res@other}{min(.7*\stretto*\pgf@circ@res@up, .8*\pgf@circ@res@right)} % radius
14465 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{-\pgf@circ@res@other}}
14466 \pgfpatharc{-90}{90}{\pgf@circ@res@other}
14467 \pgfpathclose
14468 \pgf@circ@draworfill
14469
14470 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@other}}
14471 \pgfpatharc{90}{270}{\pgf@circ@res@other}
14472 \pgfpathclose
14473 \pgf@circ@draworfill
14474 }{}
14475
14476 %%%%%%%%%%%%%%%%%%%%
14477 %% Block elements
14478 %%%%%%%%%%%%%%%%%%%%
14479
14480 \pgfdeclareshape{mixer}
14481 {
14482 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14483 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14484 \savedanchor\northwest{
14485 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14486 \ifpgf@circuit@boxed
14487 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14488 \pgf@y=.5\pgf@y
14489 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14490 \pgf@x=.5\pgf@x
14491 \else
14492 \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14493 \pgf@y=.5\pgf@y
14494 \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14495 \pgf@x=.5\pgf@x
14496 \fi
14497 }
14498 \anchor{center}{
14499 \pgfpointorigin
14500 }
14501 \anchor{left}{%
14502 \northwest
14503 \pgf@y=0pt
14504 }
14505 \anchor{1}{
14506 \northwest
14507 \pgf@y=0pt
14508 }
14509 \anchor{2}{
14510 \northwest
14511 \pgf@y=-\pgf@y
14512 \pgf@x=0pt
14513 }
14514 \anchor{3}{
14515 \northwest
14516 \pgf@y=0pt
14517 \pgf@x=-\pgf@x
14518 }
14519 \anchor{4}{
14520 \northwest
14521 \pgf@y=\pgf@y
14522 \pgf@x=0pt
14523 }
14524 \anchor{in 1}{
14525 \northwest
14526 \pgf@y=0pt
14527 }
14528 \anchor{in1}{
14529 \northwest
14530 \pgf@y=0pt
14531 }
14532 \anchor{in}{
14533 \northwest
14534 \pgf@y=0pt
14535 }
14536 \anchor{in 2}{
14537 \northwest
14538 \pgf@y=-\pgf@y
14539 \pgf@x=0pt
14540 }
14541 \anchor{in2}{
14542 \northwest
14543 \pgf@y=-\pgf@y
14544 \pgf@x=0pt
14545 }
14546 \anchor{out}{
14547 \northwest
14548 \pgf@y=0pt
14549 \pgf@x=-\pgf@x
14550 }
14551 \anchor{center}{
14552 \pgf@y=0pt
14553 \pgf@x=0pt
14554 }
14555 \anchor{east}{
14556 \northwest
14557 \pgf@y=0pt
14558 \pgf@x=-\pgf@x
14559 }
14560 \anchor{west}{
14561 \northwest
14562 \pgf@y=0pt
14563 }
14564 \anchor{south}{
14565 \northwest
14566 \pgf@x=0pt
14567 \pgf@y=-\pgf@y
14568 }
14569 \anchor{north}{
14570 \northwest
14571 \pgf@x=0pt
14572 }
14573 \anchor{south west}{
14574 \northwest
14575 \pgf@y=-\pgf@y
14576 }
14577 \anchor{north east}{
14578 \northwest
14579 \pgf@x=-\pgf@x
14580 }
14581 \anchor{north west}{
14582 \northwest
14583 }
14584 \anchor{south east}{
14585 \northwest
14586 \pgf@x=-\pgf@x
14587 \pgf@y=-\pgf@y
14588 }
14589 \backgroundpath{
14590 \pgfsetcolor{\ctikzvalof{color}}
14591 \pgf@circ@scaled@Rlen=\scaledRlen
14592
14593 \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14594
14595 \pgfscope
14596 \pgfstartlinewidth=\pgflinewidth
14597
14598 % draw outer box
14599 \ifpgf@circuit@boxed
14600 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14601 \fi
14602
14603 % draw outer circle
14604 \ifpgf@circuit@boxed
14605 \pgf@circ@res@step=.7\pgf@circ@res@step
14606 \pgfsetdash{}{0pt} % draw solid circle if boxed
14607 \else
14608 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14609 \fi
14610 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14611 \pgf@circ@draworfill
14612
14613 % draw inner stuff
14614 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14615 \pgfsetlinewidth{\pgfstartlinewidth}
14616 \pgfpathmoveto{\pgfpointorigin}
14617 \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
14618 \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
14619 \pgfpathmoveto{\pgfpointorigin}
14620 \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
14621 \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
14622 \pgfusepath{draw}
14623
14624 \endpgfscope
14625 }
14626 }
14627
14628 \pgfdeclareshape{adder}
14629 {
14630 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14631 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14632 \savedanchor\northwest{
14633 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14634 \ifpgf@circuit@boxed
14635 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14636 \pgf@y=.5\pgf@y
14637 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14638 \pgf@x=.5\pgf@x
14639 \else
14640 \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14641 \pgf@y=.5\pgf@y
14642 \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14643 \pgf@x=.5\pgf@x
14644 \fi
14645 }
14646 \anchor{center}{
14647 \pgfpointorigin
14648 }
14649 \anchor{left}{%
14650 \northwest
14651 \pgf@y=0pt
14652 }
14653 \anchor{1}{
14654 \northwest
14655 \pgf@y=0pt
14656 }
14657 \anchor{2}{
14658 \northwest
14659 \pgf@y=-\pgf@y
14660 \pgf@x=0pt
14661 }
14662 \anchor{3}{
14663 \northwest
14664 \pgf@y=0pt
14665 \pgf@x=-\pgf@x
14666 }
14667 \anchor{4}{
14668 \northwest
14669 \pgf@y=\pgf@y
14670 \pgf@x=0pt
14671 }
14672 \anchor{in 1}{
14673 \northwest
14674 \pgf@y=0pt
14675 }
14676 \anchor{in1}{
14677 \northwest
14678 \pgf@y=0pt
14679 }
14680 \anchor{in}{
14681 \northwest
14682 \pgf@y=0pt
14683 }
14684 \anchor{in 2}{
14685 \northwest
14686 \pgf@y=-\pgf@y
14687 \pgf@x=0pt
14688 }
14689 \anchor{in2}{
14690 \northwest
14691 \pgf@y=-\pgf@y
14692 \pgf@x=0pt
14693 }
14694 \anchor{out}{
14695 \northwest
14696 \pgf@y=0pt
14697 \pgf@x=-\pgf@x
14698 }
14699 \anchor{center}{
14700 \pgf@y=0pt
14701 \pgf@x=0pt
14702 }
14703 \anchor{east}{
14704 \northwest
14705 \pgf@y=0pt
14706 \pgf@x=-\pgf@x
14707 }
14708 \anchor{west}{
14709 \northwest
14710 \pgf@y=0pt
14711 }
14712 \anchor{south}{
14713 \northwest
14714 \pgf@x=0pt
14715 \pgf@y=-\pgf@y
14716 }
14717 \anchor{north}{
14718 \northwest
14719 \pgf@x=0pt
14720 }
14721 \anchor{south west}{
14722 \northwest
14723 \pgf@y=-\pgf@y
14724 }
14725 \anchor{north east}{
14726 \northwest
14727 \pgf@x=-\pgf@x
14728 }
14729 \anchor{north west}{
14730 \northwest
14731 }
14732 \anchor{south east}{
14733 \northwest
14734 \pgf@x=-\pgf@x
14735 \pgf@y=-\pgf@y
14736 }
14737 \backgroundpath{
14738 \pgfsetcolor{\ctikzvalof{color}}
14739 \pgf@circ@scaled@Rlen=\scaledRlen
14740
14741 \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14742
14743 \pgfscope
14744 \pgfstartlinewidth=\pgflinewidth
14745
14746 % draw outer box
14747 \ifpgf@circuit@boxed
14748 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14749 \fi
14750
14751 % draw outer circle
14752 \ifpgf@circuit@boxed
14753 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14754 \pgfsetdash{}{0pt} % draw solid circle if boxed
14755 \else
14756 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14757 \fi
14758 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14759 \pgf@circ@draworfill
14760
14761 % draw inner stuff
14762 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14763 \pgfsetlinewidth{\pgfstartlinewidth}
14764
14765 \pgfpathmoveto{\pgfpointorigin}
14766 \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
14767 \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
14768 \pgfpathmoveto{\pgfpointorigin}
14769 \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
14770 \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
14771 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
14772 \pgfusepath{draw}
14773
14774 \endpgfscope
14775 }
14776 }
14777
14778 \pgfdeclareshape{oscillator}
14779 {
14780 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14781 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14782 \savedanchor\northwest{
14783 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14784 \ifpgf@circuit@boxed
14785 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14786 \pgf@y=.5\pgf@y
14787 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14788 \else
14789 \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
14790 \pgf@y=.5\pgf@y
14791 \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
14792 \fi
14793 }
14794 \anchor{center}{
14795 \pgfpointorigin
14796 }
14797 \anchor{north}{
14798 \northwest
14799 \pgf@x=.5\pgf@x
14800 }
14801 \anchor{south}{
14802 \northwest
14803 \pgf@x=.5\pgf@x
14804 \pgf@y=-\pgf@y
14805 }
14806 \anchor{east}{
14807 \northwest
14808 \pgf@y=0pt
14809 \pgf@x=0pt
14810 }
14811 \anchor{west}{
14812 \northwest
14813 \pgf@y=0pt
14814 }
14815 \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
14816 \anchor{north east}{ \northwest \pgf@x=0pt\relax}
14817 \anchor{north west}{ \northwest }
14818 \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
14819 \anchor{text}{
14820 \pgf@x=-2\pgf@x
14821 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
14822 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
14823 }
14824 \backgroundpath{
14825 \pgfsetcolor{\ctikzvalof{color}}
14826 \pgf@circ@scaled@Rlen=\scaledRlen
14827
14828 \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
14829
14830 \pgfscope
14831 \pgfstartlinewidth=\pgflinewidth
14832
14833 \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
14834
14835 % draw outer box
14836 \ifpgf@circuit@boxed{}
14837 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14838 \fi
14839
14840 % draw outer circle
14841 \ifpgf@circuit@boxed
14842 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14843 \pgfsetdash{}{0pt} % draw solid circle if boxed
14844 \else
14845 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14846 \fi
14847 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14848 \pgf@circ@draworfill
14849
14850 % draw inner sine waves
14851 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14852 \pgfsetlinewidth{\pgfstartlinewidth}
14853 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
14854 \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
14855 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
14856 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
14857 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
14858 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
14859
14860 \pgfusepath{draw}
14861
14862 \endpgfscope
14863 }
14864 }
14865
14866 \pgfdeclareshape{circulator}
14867 {
14868 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14869 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14870 \savedanchor\northwest{
14871 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14872 \ifpgf@circuit@boxed
14873 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14874 \pgf@y=.5\pgf@y
14875 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14876 \pgf@x=.5\pgf@x
14877 \else
14878 \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14879 \pgf@y=.5\pgf@y
14880 \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14881 \pgf@x=.5\pgf@x
14882 \fi
14883 }
14884 \anchor{center}{
14885 \pgfpointorigin
14886 }
14887 \anchor{left}{%
14888 \northwest
14889 \pgf@y=0pt
14890 }
14891 \anchor{1}{
14892 \northwest
14893 \pgf@y=0pt
14894 }
14895 \anchor{2}{
14896 \northwest
14897 \pgf@y=0pt
14898 \pgf@x=-\pgf@x
14899 }
14900 \anchor{3}{
14901 \northwest
14902 \pgf@y=-\pgf@y
14903 \pgf@x=0pt
14904 }
14905 \anchor{east}{
14906 \northwest
14907 \pgf@y=0pt
14908 \pgf@x=-\pgf@x
14909 }
14910 \anchor{west}{
14911 \northwest
14912 \pgf@y=0pt
14913 }
14914 \anchor{south}{
14915 \northwest
14916 \pgf@x=0pt
14917 \pgf@y=-\pgf@y
14918 }
14919 \anchor{north}{
14920 \northwest
14921 \pgf@x=0pt
14922 }
14923 \anchor{south west}{
14924 \northwest
14925 \pgf@y=-\pgf@y
14926 }
14927 \anchor{north east}{
14928 \northwest
14929 \pgf@x=-\pgf@x
14930 }
14931 \anchor{north west}{
14932 \northwest
14933 }
14934 \anchor{south east}{
14935 \northwest
14936 \pgf@x=-\pgf@x
14937 \pgf@y=-\pgf@y
14938 }
14939 \backgroundpath{
14940 \pgfsetcolor{\ctikzvalof{color}}
14941 \pgf@circ@scaled@Rlen=\scaledRlen
14942
14943 \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14944
14945 \pgfscope
14946 \pgfstartlinewidth=\pgflinewidth
14947
14948 % draw outer box
14949 \ifpgf@circuit@boxed
14950 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14951 \fi
14952
14953 % draw outer circle
14954 \ifpgf@circuit@boxed{}
14955 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14956 \pgfsetdash{}{0pt} % draw solid circle if boxed
14957 \else
14958 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14959 \fi
14960 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14961 \pgf@circ@draworfill
14962
14963 % inner arrow
14964 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14965 \pgfsetlinewidth{\pgfstartlinewidth}
14966
14967 \pgfsetarrowsend{latex}
14968 \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
14969 \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
14970 \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
14971 \pgfusepath{draw}
14972
14973 \endpgfscope
14974 }
14975 }
14976
14977
14978 % Wilkinson divider
14979 \pgfdeclareshape{wilkinson}{
14980 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14981 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14982 \savedanchor\northwest{%
14983 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14984 \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen
14985 \pgf@y=.5\pgf@y
14986 \pgf@x= \pgf@circ@scaled@Rlen
14987 \pgf@x=.5\pgf@x
14988 \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x
14989 }
14990 \anchor{center}{
14991 \northwest
14992 \pgf@x=0pt
14993 \pgf@y=0pt
14994 }
14995 \anchor{north}{
14996 \northwest
14997 \pgf@x=0pt
14998 }
14999 \anchor{south}{
15000 \northwest
15001 \pgf@x=0pt
15002 \pgf@y=-\pgf@y
15003 }
15004 \anchor{west}{
15005 \northwest
15006 \pgf@y=0pt
15007 }
15008 \anchor{east}{
15009 \northwest
15010 \pgf@y=0pt
15011 \pgf@x=-\pgf@x
15012 }
15013 \anchor{south west}{
15014 \northwest
15015 \pgf@y=-\pgf@y
15016 }
15017 \anchor{north east}{
15018 \northwest
15019 \pgf@x=-\pgf@x
15020 }
15021 \anchor{north west}{
15022 \northwest
15023 }
15024 \anchor{south east}{
15025 \northwest
15026 \pgf@x=-\pgf@x
15027 \pgf@y=-\pgf@y
15028 }
15029 \anchor{in}{
15030 \northwest
15031 \pgf@y=0pt
15032 }
15033 \anchor{out1}{
15034 \northwest
15035 \pgf@x=-\pgf@x
15036 \pgf@y=-0.5\pgf@y
15037 }
15038 \anchor{out2}{
15039 \northwest
15040 \pgf@x=-\pgf@x
15041 \pgf@y=0.5\pgf@y
15042 }
15043 \anchor{text}{
15044 \northwest
15045 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
15046 \pgf@x=-.5\wd\pgfnodeparttextbox
15047 }
15048 \backgroundpath{
15049 \pgfsetcolor{\ctikzvalof{color}}
15050 \pgf@circ@scaled@Rlen=\scaledRlen
15051
15052 \northwest
15053 \pgf@circ@res@up = \pgf@y
15054 \pgf@circ@res@down = -\pgf@y
15055 \pgf@circ@res@right = -\pgf@x
15056 \pgf@circ@res@left = \pgf@x
15057
15058 \pgfstartlinewidth=\pgflinewidth
15059
15060 % draw outer box
15061 \pgf@circ@twoportbox
15062
15063 % draw inner stuff
15064 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15065 \pgfsetarrows{-} %never draw arrows
15066 \pgfsetlinewidth{\pgfstartlinewidth}
15067 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
15068 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
15069 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15070 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15071 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
15072 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15073 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15074
15075 \pgfusepath{draw}
15076
15077 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
15078 % draw inner resisitor - european or american style is recognised
15079 {
15080 \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
15081 \pgftransformrotate{90}
15082
15083 % calculate size of resistor
15084 \ifpgf@circuit@europeanresistor
15085 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
15086 \pgftransformscale{\pgfmathresult}
15087 \pgfnode{genericshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
15088 \else
15089 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
15090 \pgftransformscale{\pgfmathresult}
15091 \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
15092 \fi
15093 }
15094
15095 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15096 \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}}
15097
15098 \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}}
15099 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15100 \pgfusepath{draw}
15101
15102 }
15103 }
15104
15105 %% couplers generics
15106 \long\def\pgfcircdeclarefourport#1#2{
15107
15108 \pgfdeclareshape{#1}{
15109 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
15110 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15111 \anchor{center}{
15112 \northwest
15113 \pgf@x=0pt
15114 \pgf@y=0pt
15115 }
15116 \savedanchor\northwest{%
15117 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15118 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
15119 \pgf@y=.5\pgf@y
15120 \pgf@x=.5\pgf@circ@scaled@Rlen
15121 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
15122 }
15123 \anchor{north}{
15124 \northwest
15125 \pgf@x=0pt
15126 }
15127 \anchor{south}{
15128 \northwest
15129 \pgf@x=0pt
15130 \pgf@y=-\pgf@y
15131 }
15132 \anchor{west}{
15133 \northwest
15134 \pgf@y=0pt
15135 }
15136 \anchor{east}{
15137 \northwest
15138 \pgf@y=0pt
15139 \pgf@x=-\pgf@x
15140 }
15141 \anchor{south west}{
15142 \northwest
15143 \pgf@y=-\pgf@y
15144 }
15145 \anchor{north east}{
15146 \northwest
15147 \pgf@x=-\pgf@x
15148 }
15149 \anchor{north west}{
15150 \northwest
15151 }
15152 \anchor{south east}{
15153 \northwest
15154 \pgf@x=-\pgf@x
15155 \pgf@y=-\pgf@y
15156 }
15157 \anchor{port1}{
15158 \northwest
15159 \pgf@y=-0.5\pgf@y
15160 }
15161 \anchor{port2}{
15162 \northwest
15163 \pgf@x=-\pgf@x
15164 \pgf@y=-0.5\pgf@y
15165 }
15166 \anchor{port3}{
15167 \northwest
15168 \pgf@x=-\pgf@x
15169 \pgf@y=0.5\pgf@y
15170 }
15171 \anchor{port4}{
15172 \northwest
15173 \pgf@y=0.5\pgf@y
15174 }
15175 \anchor{1}{
15176 \northwest
15177 \pgf@y=-0.5\pgf@y
15178 }
15179 \anchor{2}{
15180 \northwest
15181 \pgf@x=-\pgf@x
15182 \pgf@y=-0.5\pgf@y
15183 }
15184 \anchor{3}{
15185 \northwest
15186 \pgf@x=-\pgf@x
15187 \pgf@y=0.5\pgf@y
15188 }
15189 \anchor{4}{
15190 \northwest
15191 \pgf@y=0.5\pgf@y
15192 }
15193
15194 \anchor{text}{
15195 \northwest
15196 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
15197 \pgf@x=-.5\wd\pgfnodeparttextbox
15198 }
15199 \backgroundpath{
15200 \pgfsetcolor{\ctikzvalof{color}}
15201
15202 \northwest
15203 \pgf@circ@res@up = \pgf@y
15204 \pgf@circ@res@down = -\pgf@y
15205 \pgf@circ@res@right = -\pgf@x
15206 \pgf@circ@res@left = \pgf@x
15207 \pgf@circ@scaled@Rlen=\scaledRlen
15208
15209 \pgfstartlinewidth=\pgflinewidth
15210
15211 % draw outer box
15212 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
15213 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
15214 \pgf@circ@draworfill
15215
15216 % draw inner stuff
15217 #2
15218
15219 % draw inner text
15220 \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
15221 }
15222 }
15223 }
15224
15225 % four-port
15226 \pgfcircdeclarefourport{fourport}{}
15227
15228 % straight coupler
15229 \pgfcircdeclarefourport{coupler}{
15230 \pgfsetlinewidth{\pgfstartlinewidth}
15231 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
15232 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15233 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
15234 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15235 \pgfusepath{draw}
15236
15237 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
15238 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
15239 \pgfsetarrows{latex-latex}
15240 \pgfusepath{draw}
15241 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
15242 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
15243 \pgfsetarrows{latex-latex}
15244 \pgfusepath{draw}
15245 }
15246
15247 % "bended" coupler
15248 \pgfcircdeclarefourport{coupler2}{
15249 \pgfsetlinewidth{\pgfstartlinewidth}
15250 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
15251 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
15252 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
15253 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
15254 \pgfusepath{draw}
15255
15256 \pgfscope
15257 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
15258 \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
15259 \pgfsetarrowsend{latex}
15260 \pgfusepath{draw}
15261 \endpgfscope
15262 \pgfscope
15263 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
15264 \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
15265 \pgfsetarrowsend{latex}
15266 \pgfusepath{draw}
15267 \endpgfscope
15268 \pgfscope
15269 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
15270 \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
15271 \pgfsetarrowsend{latex}
15272 \pgfusepath{draw}
15273 \endpgfscope
15274 \pgfscope
15275 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
15276 \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
15277 \pgfsetarrowsend{latex}
15278 \pgfusepath{draw}
15279 \endpgfscope
15280 }
15281
15282 %%%---------- close: tex/pgfcircquadpoles
15283 %%%%%%%%%%% Springe nach tex/pgfcircmultipoles
15284 %%%---------- open: tex/pgfcircmultipoles.tex
15285 % Copyright 2007-2009 by Massimo Redaelli
15286 % Copyright 2019 by Romano Giannetti
15287 %
15288 % This file may be distributed and/or modified
15289 %
15290 % 1. under the LaTeX Project Public License and/or
15291 % 2. under the GNU Public License.
15292 %
15293 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15294
15295 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15296 %% Multipoles
15297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15298
15299 %%%%%%%%%
15300 %% Chips
15301 %%%%%%%%%
15302
15303 % let's use the same shifts everywhere, no magic numbers
15304 \def\pgf@circ@dip@pin@shift{0.5}
15305 \def\pgf@circ@qfp@pin@shift{0.25}
15306
15307 % derived from https://tex.stackexchange.com/a/146753/38080
15308 % original author Mark Wibrow
15309 % Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
15310 % a lot of thanks to @marmot for the un-rotation hint
15311 % https://tex.stackexchange.com/a/473571/38080
15312
15313 % DIP (dual in line package) chips
15314
15315 \pgfdeclareshape{dipchip}{
15316 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
15317 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15318 \savedmacro\numpins{%
15319 \pgf@circ@count@a=\ctikzvalof{multipoles/dipchip/num pins}%
15320 \def\numpins{\the\pgf@circ@count@a}
15321 }
15322 \savedanchor\centerpoint{%
15323 \pgf@x=-.5\wd\pgfnodeparttextbox%
15324 \pgf@y=-.5\ht\pgfnodeparttextbox%
15325 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
15326 }%
15327 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
15328 \anchor{center}{\origin}
15329 \anchor{text}{\centerpoint}% to adjust text
15330 \saveddimen\height{%
15331 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15332 \pgfmathsetlength\pgf@x{((\numpins)
15333 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
15334 }%
15335 \saveddimen{\chipspacing}{
15336 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15337 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/pin spacing}}}
15338 \saveddimen{\width}{
15339 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15340 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}}
15341 \saveddimen{\extshift}{
15342 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15343 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
15344 % standard anchors
15345 \savedanchor\northwest{%
15346 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15347 \pgfmathsetlength\pgf@y{0.5*((\numpins)
15348 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
15349 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}
15350 }
15351 \anchor{dot}{\northwest
15352 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
15353 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
15354 }
15355 \anchor{nw}{\northwest}
15356 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
15357 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15358 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
15359 \anchor{north west}{\northwest}
15360 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
15361 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
15362 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
15363 \anchor{n}{\northwest\pgf@x=0pt }
15364 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15365 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15366 \anchor{w}{\northwest\pgf@y=0pt }
15367 \anchor{north}{\northwest\pgf@x=0pt }
15368 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15369 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15370 \anchor{west}{\northwest\pgf@y=0pt }
15371 % start drawing
15372 \backgroundpath{%
15373 \northwest
15374 \pgf@circ@res@up = \pgf@y
15375 \pgf@circ@res@down = -\pgf@y
15376 \pgf@circ@res@right = -\pgf@x
15377 \pgf@circ@res@left = \pgf@x
15378 \pgf@circ@scaled@Rlen=\scaledRlen
15379 \pgf@circ@res@step = \ctikzvalof{multipoles/dipchip/pin spacing}\pgf@circ@scaled@Rlen
15380 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
15381 \pgfscope% (for the line width)
15382 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
15383 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
15384 \pgf@circ@draworfill
15385 %% upside mark
15386 \ifpgf@circuit@chip@topmark
15387 \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
15388 \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
15389 \fi
15390 \pgfusepath{stroke}%
15391 \pgfsetcolor{\ctikzvalof{color}}
15392 % Adding the pin number
15393 \ifpgf@circuit@chip@shownumbers
15394 \pgf@circ@count@a=\numpins\relax
15395 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
15396 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
15397 \ifpgf@circuit@chip@straightnumbers
15398 \pgfgettransformentries\a\b\temp\temp\temp\temp
15399 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
15400 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
15401 \else
15402 \pgfmathsetmacro{\rot}{0}
15403 \pgfmathsetmacro{\quadrant}{0}
15404 \fi
15405 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
15406 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
15407 \pgfmathloop%
15408 \ifnum\pgf@circ@count@a>0
15409 \ifcase\quadrant % rotation 0
15410 % left
15411 \pgf@circ@count@c=\pgf@circ@count@a
15412 \pgftext[left,
15413 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15414 rotate=\rot]{\mytext}
15415 % right
15416 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15417 \pgftext[right,
15418 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15419 rotate=\rot]{\mytext}
15420 \or % rotation -90
15421 % left
15422 \pgf@circ@count@c=\pgf@circ@count@a
15423 \pgftext[top,
15424 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15425 rotate=\rot]{\mytext}
15426 % right
15427 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15428 \pgftext[bottom,
15429 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15430 rotate=\rot]{\mytext}
15431 \or %rotation 180
15432 % left
15433 \pgf@circ@count@c=\pgf@circ@count@a
15434 \pgftext[right,
15435 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15436 rotate=\rot]{\mytext}
15437 % right
15438 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15439 \pgftext[left,
15440 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15441 rotate=\rot]{\mytext}
15442 \or % rotation +90
15443 % left
15444 \pgf@circ@count@c=\pgf@circ@count@a
15445 \pgftext[bottom,
15446 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15447 rotate=\rot]{\mytext}
15448 % right
15449 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15450 \pgftext[top,
15451 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15452 rotate=\rot]{\mytext}
15453 \fi
15454 \advance\pgf@circ@count@a-1\relax%
15455 \repeatpgfmathloop
15456 \fi
15457 \endpgfscope
15458 \ifdim\pgf@circ@res@other>0pt
15459 \pgfscope
15460 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
15461 \pgf@circ@count@a=\numpins\relax
15462 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
15463 \pgfmathloop%
15464 \ifnum\pgf@circ@count@a>0
15465 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
15466 \ifnum\padfrac>0
15467 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
15468 % left side pads
15469 \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}}
15470 \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}}
15471 \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}}
15472 \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}}
15473 % right side pads
15474 \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}}
15475 \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}}
15476 \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}}
15477 \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}}
15478 \else
15479 % left side pins
15480 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15481 \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}}
15482 % right side pins
15483 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15484 \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}}
15485 \fi
15486 \advance\pgf@circ@count@a by -1\relax%
15487 \repeatpgfmathloop
15488 \pgfusepath{stroke}
15489 \endpgfscope
15490 \fi
15491 }%
15492 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15493 % and is executed just before a node is drawn.
15494 \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
15495 % Start with the maximum pin number and go backwards.
15496 \pgf@circ@count@a=\numpins\relax
15497 \pgfmathloop%
15498 \ifnum\pgf@circ@count@a>0
15499 % we will create two anchors per pin: the "normal one" like `pin 1` for the
15500 % electrical contact, and the "border one" like `bpin 1` for labels.
15501 % they will coincide if `external pins width` is set to 0.
15502 \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
15503 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
15504 }
15505 \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
15506 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
15507 }
15508 \advance\pgf@circ@count@a by -1\relax%
15509 \repeatpgfmathloop%
15510 }%
15511 }
15512
15513 % QFP (quad flat package) chips
15514
15515 \pgfdeclareshape{qfpchip}{
15516 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
15517 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15518 \savedmacro\numpins{%
15519 \pgf@circ@count@a=\ctikzvalof{multipoles/qfpchip/num pins}%
15520 \def\numpins{\the\pgf@circ@count@a}
15521 }
15522 \savedanchor\centerpoint{%
15523 \pgf@x=-.5\wd\pgfnodeparttextbox%
15524 \pgf@y=-.5\ht\pgfnodeparttextbox%
15525 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
15526 }%
15527 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
15528 \anchor{center}{\origin}
15529 \anchor{text}{\centerpoint}% to adjust text
15530 \saveddimen\height{%
15531 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15532 \pgfmathsetlength\pgf@x{((\numpins+2)
15533 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15534 }%
15535 \saveddimen\width{%
15536 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15537 \pgfmathsetlength\pgf@x{((\numpins+2)
15538 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15539 }%
15540 \saveddimen{\chipspacing}{
15541 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15542 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/qfpchip/pin spacing}}}
15543 \saveddimen{\extshift}{
15544 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15545 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
15546 % standard anchors
15547 \savedanchor\northwest{%
15548 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15549 \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
15550 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15551 \pgf@x=-\pgf@y
15552 }
15553 \anchor{dot}{\northwest
15554 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
15555 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
15556 }
15557 \anchor{nw}{\northwest}
15558 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
15559 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15560 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
15561 \anchor{north west}{\northwest}
15562 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
15563 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
15564 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
15565 \anchor{n}{\northwest\pgf@x=0pt }
15566 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15567 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15568 \anchor{w}{\northwest\pgf@y=0pt }
15569 \anchor{north}{\northwest\pgf@x=0pt }
15570 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15571 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15572 \anchor{west}{\northwest\pgf@y=0pt }
15573 % start drawing
15574 \backgroundpath{%
15575 \northwest
15576 \pgf@circ@res@up = \pgf@y
15577 \pgf@circ@res@down = -\pgf@y
15578 \pgf@circ@res@right = -\pgf@x
15579 \pgf@circ@res@left = \pgf@x
15580 \pgf@circ@scaled@Rlen=\scaledRlen
15581 \pgf@circ@res@step = \ctikzvalof{multipoles/qfpchip/pin spacing}\pgf@circ@scaled@Rlen
15582 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
15583 \pgfscope% (for the line width)
15584 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
15585 %% upside mark
15586 \ifpgf@circuit@chip@topmark
15587 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
15588 \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
15589 \else
15590 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
15591 \fi
15592 %% rest of the shape
15593 \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
15594 \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
15595 \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
15596 \pgfpathclose
15597 \pgf@circ@draworfill
15598 % Adding the pin number
15599 \pgfsetcolor{\ctikzvalof{color}}
15600 \ifpgf@circuit@chip@shownumbers
15601 \pgf@circ@count@a=\numpins%
15602 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
15603 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
15604 \ifpgf@circuit@chip@straightnumbers
15605 \pgfgettransformentries\a\b\temp\temp\temp\temp
15606 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
15607 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
15608 \else
15609 \pgfmathsetmacro{\rot}{0}
15610 \pgfmathsetmacro{\quadrant}{0}
15611 \fi
15612 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
15613 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
15614 \pgfmathloop%
15615 \ifnum\pgf@circ@count@a>0
15616 \ifcase\quadrant % rotation 0
15617 % left
15618 \pgf@circ@count@c=\pgf@circ@count@a
15619 \pgftext[left,
15620 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15621 rotate=\rot]{\mytext}
15622 % bottom
15623 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15624 \pgftext[bottom,
15625 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15626 rotate=\rot]{\mytext}
15627 % right
15628 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15629 \pgftext[right,
15630 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15631 rotate=\rot]{\mytext}
15632 % top
15633 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15634 \pgftext[top,
15635 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15636 rotate=\rot]{\mytext}
15637 \or % rotation -90
15638 % left
15639 \pgf@circ@count@c=\pgf@circ@count@a
15640 \pgftext[top,
15641 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15642 rotate=\rot]{\mytext}
15643 % bottom
15644 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15645 \pgftext[left,
15646 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15647 rotate=\rot]{\mytext}
15648 % right
15649 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15650 \pgftext[bottom,
15651 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15652 rotate=\rot]{\mytext}
15653 % top
15654 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15655 \pgftext[right,
15656 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15657 rotate=\rot]{\mytext}
15658 \or %rotation 180
15659 % left
15660 \pgf@circ@count@c=\pgf@circ@count@a
15661 \pgftext[right,
15662 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15663 rotate=\rot]{\mytext}
15664 % bottom
15665 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15666 \pgftext[top,
15667 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15668 rotate=\rot]{\mytext}
15669 % right
15670 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15671 \pgftext[left,
15672 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15673 rotate=\rot]{\mytext}
15674 % top
15675 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15676 \pgftext[bottom,
15677 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15678 rotate=\rot]{\mytext}
15679 \or % rotation +90
15680 % left
15681 \pgf@circ@count@c=\pgf@circ@count@a
15682 \pgftext[bottom,
15683 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15684 rotate=\rot]{\mytext}
15685 % bottom
15686 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15687 \pgftext[right,
15688 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15689 rotate=\rot]{\mytext}
15690 % right
15691 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15692 \pgftext[top,
15693 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15694 rotate=\rot]{\mytext}
15695 % top
15696 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15697 \pgftext[left,
15698 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15699 rotate=\rot]{\mytext}
15700 \fi
15701 \advance\pgf@circ@count@a-1\relax%
15702 \repeatpgfmathloop
15703 \fi
15704 \endpgfscope
15705 \ifdim\pgf@circ@res@other>0pt
15706 \pgfscope
15707 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
15708 \pgf@circ@count@a=\numpins%
15709 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
15710 \pgfmathloop%
15711 \ifnum\pgf@circ@count@a>0
15712 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
15713 \ifnum\padfrac>0
15714 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
15715 % left side pads
15716 \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}}
15717 \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}}
15718 \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}}
15719 \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}}
15720 % bottom side pads
15721 \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}}
15722 \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}}
15723 \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}}
15724 \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}}
15725 % right side pads
15726 \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}}
15727 \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}}
15728 \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}}
15729 \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}}
15730 % top side pads
15731 \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}}
15732 \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}}
15733 \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}}
15734 \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}}
15735 \else
15736 % left side pins
15737 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15738 \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}}
15739 % bottom side pins
15740 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
15741 \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}}
15742 % right side pins
15743 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15744 \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}}
15745 % top side pins
15746 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
15747 \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}}
15748 \fi
15749 \advance\pgf@circ@count@a-1\relax%
15750 \repeatpgfmathloop
15751 \pgfusepath{stroke}
15752 \endpgfscope
15753 \fi
15754 }%
15755 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15756 % and is executed just before a node is drawn.
15757 \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
15758 % Start with the maximum pin number and go backwards.
15759 \pgf@circ@count@a=\numpins%
15760 \pgfmathloop%
15761 \ifnum\pgf@circ@count@a>0
15762 \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
15763 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
15764 }
15765 \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
15766 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
15767 }
15768 \advance\pgf@circ@count@a-1\relax%
15769 \repeatpgfmathloop%
15770 }%
15771 }
15772
15773 %% anchors for DIP
15774 \def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
15775 \c@pgf@countc=\numpins\relax
15776 \divide\c@pgf@countc by 2
15777 \ifnum #1 > \the\c@pgf@countc
15778 % right side
15779 \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
15780 \else
15781 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
15782 \fi
15783 }
15784
15785 %% anchors for QFP
15786 \def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
15787 \c@pgf@countc=\numpins\relax
15788 \divide\c@pgf@countc by 4
15789 \ifnum #1 > \the\c@pgf@countc
15790 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
15791 \ifnum #1 > \the\c@pgf@countb
15792 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
15793 \ifnum #1 > \the\c@pgf@countb
15794 % 3*npins/4 < pin, top side
15795 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
15796 \else
15797 % 2*npins/4 < pin <= 3*npins/4, right side
15798 \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
15799 \fi
15800 \else
15801 % npins/4 < pin <= 2*npins/4, bottom side
15802 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
15803 \fi
15804 \else
15805 % <= npins/4, left side
15806 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
15807 \fi
15808 }
15809
15810 %%%%%%%%%%%%%%%%%
15811 %% Rotary Switch
15812 %%%%%%%%%%%%%%%%%
15813
15814 \pgfdeclareshape{rotaryswitch}
15815 {
15816 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
15817 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15818 \savedanchor\northeast{%
15819 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15820 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15821 % the magic number is 0.25/cos(35)
15822 % try to recalculate it for the actual switch
15823 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15824 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15825 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15826 \edef\r{\ctikzvalof{nodes width}}
15827 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15828 \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@scaled@Rlen + \pgf@circ@res@temp}
15829 }
15830 \savedanchor\northwest{%
15831 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15832 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15833 % the magic number is 0.25/cos(35)
15834 % try to recalculate it for the actual switch
15835 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15836 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15837 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15838 \edef\r{\ctikzvalof{nodes width}}
15839 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15840 \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@scaled@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
15841 }
15842 \savedanchor\central{%
15843 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15844 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15845 % the magic number is 0.25/cos(35)
15846 % try to recalculate it for the actual switch
15847 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15848 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15849 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15850 \edef\r{\ctikzvalof{nodes width}}
15851 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15852 \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
15853 }
15854 % external square limits
15855 \savedanchor\extnorthwest{%
15856 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15857 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15858 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15859 \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
15860 \pgf@x=2.5\pgf@x % external square size
15861 \pgf@y=-\pgf@x %square thing when angle=180?
15862 }
15863 \saveddimen{\width}{
15864 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15865 \pgfmathsetlength\pgf@x{0.3052*\pgf@circ@scaled@Rlen*\ctikzvalof{tripoles/spdt/width}}}
15866 % radius of the connector
15867 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
15868 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
15869 % shapename
15870 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
15871 % shape type
15872 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
15873 \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
15874 \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
15875 \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
15876 \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
15877 % mid of the lever, to stack switches
15878 %\anchor{mid}{\midlever}
15879 \anchor{mid}{\northwest
15880 \pgf@circ@res@temp=-\pgf@x
15881 \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
15882 \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
15883 }
15884 % center anchors
15885 \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
15886 % horizontal angles
15887 \anchor{in}{ \northwest \pgf@y=0pt}
15888 \anchor{ain}{ \northwest \pgf@y=0pt}
15889
15890 \anchor{center}{ \central \pgf@y=0pt }
15891 \anchor{east}{ \northeast \pgf@y=0pt }
15892 \anchor{west}{ \northwest \pgf@y=0pt }
15893 \anchor{south}{ \central \pgf@y=-\pgf@y }
15894 \anchor{north}{ \central }
15895 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
15896 \anchor{north east}{ \northeast }
15897 \anchor{north west}{ \northwest }
15898 \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
15899
15900 \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
15901 \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
15902 \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
15903 \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15904 \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
15905 \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15906 \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
15907 \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
15908 \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15909
15910 \backgroundpath{
15911 \pgfsetcolor{\ctikzvalof{color}}
15912 \pgf@circ@res@right = \width
15913 \pgf@circ@res@left = -\width
15914
15915 \pgfscope %wiper
15916 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
15917 \pgf@circ@res@temp=\radius\relax
15918 \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
15919 \pgfsetlinewidth{2\pgf@circ@res@temp}
15920 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
15921 \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
15922 \pgfsetroundcap\pgfusepath{draw}
15923 \endpgfscope
15924
15925 \ifpgf@circ@rotaryarrow
15926 \pgfscope % arrow
15927 \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
15928 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
15929 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
15930 \pgftransformrotate{\wiper}
15931 \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
15932 \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
15933 \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
15934 \pgfusepath{draw}
15935 \endpgfscope
15936 \fi
15937
15938 % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
15939 \pgf@circ@count@a=\channels\relax
15940 \pgfmathsetmacro{\currenta}{-\angle}
15941 \pgfmathloop%
15942 \ifnum\pgf@circ@count@a>0
15943 % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
15944 \pgfscope
15945 \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
15946 \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
15947 \endpgfscope
15948 \pgfmathsetmacro{\currenta}{\currenta+\stepa}
15949 % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
15950 \advance\pgf@circ@count@a by -1\relax%
15951 \repeatpgfmathloop
15952
15953 \pgfscope % input
15954 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
15955 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
15956 \endpgfscope
15957 }
15958 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15959 % and is executed just before a node is drawn.
15960 \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
15961 % Start with the maximum pin number and go backwards.
15962 \pgf@circ@count@a=\channels\relax
15963 \pgfmathloop%
15964 \ifnum\pgf@circ@count@a>0
15965 % we will create two anchors per pin: the "normal one" like `pin 1` for the
15966 % electrical contact, and the "border one" like `bpin 1` for labels.
15967 % they will coincide if `external pins width` is set to 0.
15968 \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
15969 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
15970 }
15971 \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
15972 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
15973 }
15974 \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
15975 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
15976 }
15977 \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
15978 \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
15979 }
15980 \advance\pgf@circ@count@a by -1\relax%
15981 \repeatpgfmathloop%
15982 }%
15983 }
15984
15985 \def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
15986 \pgf@circ@res@temp=\width
15987 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
15988 \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
15989 \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
15990 \advance\pgf@x by -\pgf@circ@res@temp
15991 }
15992
15993 \def\pgf@circ@rotarysqanchor#1{% external square anchors
15994 \pgf@circ@res@temp=\width
15995 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
15996 \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
15997 \advance\pgf@x by -\pgf@circ@res@temp
15998 }
15999
16000 %%%%%%%%%%%%%%%%%%%%%%%%%%
16001 % Seven segments displays
16002 %%%%%%%%%%%%%%%%%%%%%%%%%%
16003
16004 \pgfdeclareshape{bare7seg}{
16005 \savedmacro{\ctikzclass}{\edef\ctikzclass{displays}}
16006 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
16007 \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
16008 \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
16009 \ifpgf@circ@sevenseg@dot
16010 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
16011 \else
16012 \pgf@x=0pt
16013 \fi
16014 }
16015 % The object extension is more or less (-width/2,-width) to (width/2,width)
16016 % and adjusted for line thickness (both sides) and eventually the dot
16017 \saveddimen{\width}{
16018 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16019 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}}
16020 \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
16021 \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
16022 \savedanchor{\southwest}{% both negative
16023 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16024 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16025 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
16026 \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16027 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
16028 }
16029 \savedanchor{\northeast}{% both positive
16030 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16031 \ifpgf@circ@sevenseg@dot
16032 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
16033 \else
16034 \pgf@circ@res@other=0pt
16035 \fi
16036 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16037 +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
16038 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
16039 +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
16040 }
16041 \savedanchor{\topright}{% anchor without the box sep and the thickness
16042 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16043 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
16044 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
16045 }
16046 \anchor{center}{\pgfpointorigin}
16047 \anchor{north west}{\southwest\pgf@y=-\pgf@y}
16048 \anchor{north east}{\northeast}
16049 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
16050 \anchor{south west}{\southwest}
16051 \anchor{north}{\northeast\pgf@x=0pt}
16052 \anchor{east}{\northeast\pgf@y=0pt}
16053 \anchor{south}{\southwest\pgf@x=0pt}
16054 \anchor{west}{\southwest\pgf@y=0pt}
16055 \anchor{a}{\topright\pgf@x=0pt}
16056 \anchor{b}{\topright\pgf@y=0.5\pgf@y}
16057 \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
16058 \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
16059 \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
16060 \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
16061 \anchor{g}{\pgfpointorigin}
16062 \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
16063 \behindbackgroundpath{%
16064 \southwest % I do not want the dot here, it will stick out
16065 \pgf@circ@res@up = -\pgf@y
16066 \pgf@circ@res@down = \pgf@y
16067 \pgf@circ@res@right = \pgf@x
16068 \pgf@circ@res@left = -\pgf@x
16069 \pgfscope
16070 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
16071 \pgfsetcolor{\ctikzvalof{color}}
16072 \pgfpathrectanglecorners%
16073 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
16074 {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
16075 \ifpgf@circ@sevenseg@box
16076 \pgf@circ@draworfill
16077 \else
16078 \pgf@circ@maybefill
16079 \fi
16080 \endpgfscope
16081 \edef\bits{\ctikzvalof{seven seg/bits}}
16082 \pgfscope
16083 \pfg@circ@sseg@drawbits{\bits}
16084 \endpgfscope
16085 \pgfscope
16086 \ifpgf@circ@sevenseg@dot
16087 \pgf@circ@sseg@drawdots
16088 \fi
16089 \endpgfscope
16090 }
16091 }
16092
16093 \def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
16094 \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
16095 }
16096 \def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
16097 \ifnum #1 > 0\relax
16098 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
16099 \else
16100 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
16101 \fi
16102 \pgfpathmoveto{\pgfpoint{#2}{#3}}
16103 \pgfpathlineto{\pgfpoint{#4}{#5}}
16104 \pgfusepath{draw}
16105 }
16106 \def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
16107 \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
16108 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
16109 \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
16110 % \pgfsetroundcap
16111 \pgfsetarrowsstart{Triangle Cap[]}
16112 \pgfsetarrowsend{Triangle Cap[]}
16113 % segments
16114 \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
16115 \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
16116 \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
16117 \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
16118 \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
16119 \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
16120 \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
16121 }
16122 \def\pgf@circ@sseg@drawdots{% dots
16123 \edef\what{empty}
16124 \ifx\what\pgf@circ@sevenseg@dotstate
16125 % do nothing
16126 \else
16127 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
16128 \edef\what{off}
16129 \ifx\what\pgf@circ@sevenseg@dotstate
16130 % dot off
16131 \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
16132 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
16133 \else
16134 % dot on
16135 \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
16136 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
16137 \fi
16138 \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
16139 \pgfusepath{draw,fill}
16140 \fi
16141 }
16142 %%%---------- close: tex/pgfcircmultipoles
16143
16144 %%%%%%%%%%% Springe nach tex/pgfcirclabel
16145 %%%---------- open: tex/pgfcirclabel.tex
16146 % Copyright 2007-2009 by Massimo Redaelli
16147 %
16148 % This file may be distributed and/or modified
16149 %
16150 % 1. under the LaTeX Project Public License and/or
16151 % 2. under the GNU Public License.
16152 %
16153 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16154
16155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16156 %% Bipole label positioning
16157
16158 %% bipole labels and annotation extra style
16159
16160 \ctikzset{bipole label style/.style={}}
16161 \tikzset{bipole label style/.code={
16162 \ctikzset{bipole label style/.style={#1}}
16163 }}
16164 \tikzset{bipole label append style/.code={
16165 \ctikzset{bipole label style/.append style={#1}}
16166 }}
16167 \ctikzset{bipole annotation style/.style={}}
16168 \tikzset{bipole annotation style/.code={
16169 \ctikzset{bipole annotation style/.style={#1}}
16170 }}
16171 \tikzset{bipole annotation append style/.code={
16172 \ctikzset{bipole annotation style/.append style={#1}}
16173 }}
16174
16175 %% Options
16176 \ctikzset{label/.style = { l=#1 } }
16177 \ctikzset{l/.code = {
16178 \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
16179 \ctikzsetvalof{bipole/label/unit}{}
16180 \ifpgf@circ@siunitx
16181 \pgf@circ@handleSI{#1}
16182 \ifpgf@circ@siunitx@res
16183 \edef\pgf@temp{\pgf@circ@handleSI@val}
16184 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
16185 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16186 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
16187 \else
16188 \fi
16189 \else
16190 \fi
16191 }}
16192
16193 \ctikzset{label above/.code = {
16194 l=#1,
16195 \circuitikzbasekey/bipole/label/position=90 }
16196 }
16197
16198 \ctikzset{l^/.style = {
16199 l=#1,
16200 \circuitikzbasekey/bipole/label/position=90 }
16201 }
16202
16203 \ctikzset{label below/.code = {
16204 l=#1,
16205 \circuitikzbasekey/bipole/label/position=-90 }
16206 }
16207
16208 \ctikzset{l_/.style = {
16209 l=#1,
16210 \circuitikzbasekey/bipole/label/position=-90 }
16211 }
16212
16213 \ctikzset{annotation/.style = { a=#1 } }
16214 \ctikzset{a/.code = {
16215 \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
16216 \ctikzsetvalof{bipole/annotation/unit}{}
16217 \ifpgf@circ@siunitx
16218 \pgf@circ@handleSI{#1}
16219 \ifpgf@circ@siunitx@res
16220 \edef\pgf@temp{\pgf@circ@handleSI@val}
16221 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
16222 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16223 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
16224 \else
16225 \fi
16226 \else
16227 \fi
16228 }}
16229
16230 \ctikzset{annotation above/.code = {
16231 a=#1,
16232 \circuitikzbasekey/bipole/annotation/position=90 }
16233 }
16234
16235 \ctikzset{a^/.style = {
16236 a=#1,
16237 \circuitikzbasekey/bipole/annotation/position=90 }
16238 }
16239
16240 \ctikzset{annotation below/.code = {
16241 a=#1,
16242 \circuitikzbasekey/bipole/annotation/position=-90 }
16243 }
16244 \ctikzset{a_/.style = {
16245 a=#1,
16246 \circuitikzbasekey/bipole/annotation/position=-90 }
16247 }
16248
16249 % This is to adjust spacing for the labels so that they are not cramped on components
16250 \def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
16251
16252 \def\pgf@circ@drawlabels#1{
16253 \pgfextra{
16254 % This function will be called with argument #1 equal
16255 % to "label" or "annotation" form pgfcircpath.tex.
16256 % pgf@circ@direction is the direction of the path,
16257 % its value is set in pgfcircpath.tex
16258 \pgfmathsubtract{\pgf@circ@direction}{90}
16259 \pgfmathround{\pgfmathresult} % avoid precision loss errors
16260 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16261
16262 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
16263 \ifnum \pgf@circ@temp < 0
16264 \pgfmathadd{\pgf@circ@labanc}{180}
16265 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16266 \fi
16267 % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
16268 %
16269 % normalize the angle values
16270 %
16271 \pgfmathmod{\pgf@circ@labanc}{360}
16272 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16273 %
16274 \ifpgf@circuit@bipole@inverted
16275 \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
16276 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16277 \fi
16278 %
16279 \ifnum \ctikzvalof{mirror value} = -1
16280 \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
16281 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16282 \fi
16283 % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
16284 }
16285 %Firstly, place a coordinate directly at the edge of the shape
16286 (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
16287 %now decide, which labels should be drawn
16288 \pgfextra{
16289 \edef\pgf@temp{\ctikzvalof{label/align}}
16290 \def\pgf@circ@temp{straight}
16291 }
16292 \ifx\pgf@temp\pgf@circ@temp %straight
16293 \pgf@circ@drawreglabels{#1}
16294 \else
16295 \pgfextra{\def\pgf@circ@temp{rotate}}
16296 \ifx\pgf@temp\pgf@circ@temp %rotate
16297 \pgf@circ@drawrotlabels{#1}
16298 \else% smart
16299 \pgf@circ@drawsmartlabels{#1}
16300 \fi
16301 \fi
16302 }
16303
16304
16305 \def\pgf@circ@drawsmartlabels#1{
16306 \pgfextra{
16307 \pgfmathmod{\pgf@circ@direction}{90}
16308 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16309 }
16310 \ifnum \pgfcircmathresult > 20
16311 \ifnum \pgfcircmathresult < 70
16312 \pgf@circ@drawrotlabels{#1}
16313 \else
16314 \pgf@circ@drawreglabels{#1}
16315 \fi
16316 \else
16317 \pgf@circ@drawreglabels{#1}
16318 \fi
16319 }
16320
16321
16322 \def\pgf@circ@drawrotlabels#1{
16323 \pgfextra{
16324 % scale the distances in function of zoom, so that they are not
16325 % dependent on it but on font size. Thanks to @marmot
16326 % https://tex.stackexchange.com/a/476018/38080
16327 % the coeffcient is adjusted so that the distance is more or less
16328 % the same for rotated labels and straight ones (although it will
16329 % depend on the font, so it's not exact).
16330 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
16331 \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
16332 \ifnum \ctikzvalof{bipole/#1/position}>0
16333 %we need some more space for placement below, due to mid-anchor
16334 \else % we do not have <= in \ifnum...
16335 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
16336 \fi
16337 %Calculate rotation of the label from direction and strip decimals
16338 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
16339 % rotate the label at second or third quadrant:
16340 \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
16341 \pgfmathsubtract{\pgf@circ@direction}{180}
16342 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16343 %invert the space relationships due to rotated strings
16344 \ifnum \ctikzvalof{bipole/#1/position}>0
16345 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
16346 \fi
16347 \fi\fi
16348 \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
16349 \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16350 }
16351 % reset cm is not working correctly here
16352 (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
16353 node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
16354 (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
16355 }
16356
16357 \def\pgf@circ@drawreglabels#1{
16358 %Now calculate all shape positions
16359 %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
16360 %All points between will be addressed by angled-anchors:
16361 \pgfextra{
16362 % scale ex-distance to make it independent on scale
16363 % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
16364 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
16365 \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
16366 \pgfmathadd{\pgf@circ@labanc}{90}
16367 \pgfmathround{\pgfmathresult}
16368 \def\pgf@circ@labanctext{\pgf@circ@labanc}
16369 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16370 \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
16371 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16372 }
16373 %Values around 90 are at both y-axis
16374 \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
16375 \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
16376 \ifnum \pgf@circ@labpos > 180
16377 \ifnum \ctikzvalof{bipole/#1/position} > 0
16378 \pgfextra{\def\pgf@circ@labanctext{mid west}}
16379 \else
16380 \pgfextra{\def\pgf@circ@labanctext{mid east}}
16381 \fi
16382 \else
16383 \ifnum \ctikzvalof{bipole/#1/position} > 0
16384 \pgfextra{\def\pgf@circ@labanctext{mid east}}
16385 \else
16386 \pgfextra{\def\pgf@circ@labanctext{mid west}}
16387 \fi
16388 \fi
16389 \fi\fi
16390 %Values between -5 and 5 are at pos /neg x-axis
16391 \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
16392 \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
16393 \ifnum \ctikzvalof{bipole/#1/position} < 0
16394 \ifnum \pgf@circ@labanc > 90
16395 % using base coordinate instead of south to naturally align
16396 % symbols with descendants; but this invalidate the effect of
16397 % the inner sep, so recover it by shifting the anchor
16398 % reset cm is not working sometime, use @marmot solution
16399 % see https://tex.stackexchange.com/a/476018/38080
16400 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16401 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16402 \else
16403 \pgfextra{\def\pgf@circ@labanctext{north}}%north
16404 \fi
16405 \else
16406 \ifnum \pgf@circ@labanc < 90
16407 % shift, as above
16408 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16409 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16410 \else
16411 \ifnum \pgf@circ@labanc > 180
16412 % this shouldn't happen, but somehow it does (270 degree anchors)
16413 % shift, as above
16414 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16415 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16416 \else
16417 \pgfextra{\def\pgf@circ@labanctext{north}}%north
16418 \fi
16419 \fi
16420 \fi
16421 \fi\fi
16422 (labelcoor) node[anchor=\pgf@circ@labanctext,
16423 inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style,
16424 ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
16425 }
16426 }
16427
16428 \def\pgf@circ@finallabels#1{%
16429 \edef\pgf@temp{}%
16430 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
16431 \ifx\pgf@temp\pgf@circ@temp%
16432 \ctikzvalof{bipole/#1/name}%
16433 \else%
16434 $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
16435 \fi%
16436 }
16437
16438 \ctikzset{text/.style={t=#1}}
16439 \ctikzset{t/.code={%
16440 \ctikzsetvalof{bipoles/twoport/text}{#1}%
16441 }}
16442
16443 %%%% Stacked labels
16444 %
16445 % stacked labels by Romano Giannetti [email protected]
16446 % heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
16447 % \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
16448 %
16449 % labels are in a tabular, globally aligned:
16450 % vertically with key l2 valign (default c)
16451 % c: center t: top b: bottom
16452 % horizontally with key l2 align (default l)
16453 % l: left c: centered r: right
16454 % you can switch sides using l2_=... and l2^=...
16455 % syntax is l2_ = line1 and line2 (same for l2^)
16456 %
16457 \ctikzset{%
16458 l2 valign/.store in=\ltwo@valign, l2 valign=c,
16459 l2 halign/.store in=\ltwo@halign, l2 halign=l,
16460 }
16461 \ctikzset{l2base/.code n args={2}{
16462 \pgfkeys{/tikz/circuitikz/bipole/label/name=%
16463 \bgroup
16464 \setlength{\tabcolsep}{2pt}%
16465 \def\ltwo@tabu{\tabular[\ltwo@valign]}%
16466 \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
16467 #1\\ #2%
16468 \endtabular
16469 \egroup
16470 }%
16471 \ctikzsetvalof{bipole/label/unit}{}
16472 \ifpgf@circ@siunitx
16473 \pgf@circ@handleSI{#2}
16474 \ifpgf@circ@siunitx@res
16475 \edef\pgf@temp{\pgf@circ@handleSI@val}
16476 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
16477 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16478 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
16479 \else
16480 \fi
16481 \else
16482 \fi
16483 }}
16484 \ctikzset{l2/.style args={#1 and #2}{
16485 l2base={#1}{#2},
16486 \circuitikzbasekey/bipole/label/position=90 }
16487 }
16488 \ctikzset{l2 above/.style args={#1 and #2}{
16489 l2base={#1}{#2},
16490 \circuitikzbasekey/bipole/label/position=90 }
16491 }
16492 \ctikzset{l2^/.style args={#1 and #2}{
16493 l2base={#1}{#2},
16494 \circuitikzbasekey/bipole/label/position=90 }
16495 }
16496 \ctikzset{l2 below/.style args={#1 and #2}{
16497 l2base={#1}{#2},
16498 \circuitikzbasekey/bipole/label/position=-90 }
16499 }
16500 \ctikzset{l2_/.style args={#1 and #2}{
16501 l2base={#1}{#2},
16502 \circuitikzbasekey/bipole/label/position=-90 }
16503 }
16504
16505 %%%---------- close: tex/pgfcirclabel
16506 %%%%%%%%%%% Springe nach tex/pgfcircvoltage
16507 %%%---------- open: tex/pgfcircvoltage.tex
16508 % Copyright 2007-2009 by Massimo Redaelli
16509 %
16510 % This file may be distributed and/or modified
16511 %
16512 % 1. under the LaTeX Project Public License and/or
16513 % 2. under the GNU Public License.
16514 %
16515 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16516
16517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16518 %% Voltage management
16519
16520 %% styles
16521 \ctikzset{bipole voltage style/.style={}}
16522 \tikzset{bipole voltage style/.code={
16523 \ctikzset{bipole voltage style/.style={#1}}
16524 }}
16525 \tikzset{bipole voltage append style/.code={
16526 \ctikzset{bipole voltage style/.append style={#1}}
16527 }}
16528
16529 \ctikzset{v^>/.style = {
16530 v = #1,
16531 \circuitikzbasekey/bipole/voltage/direction = forward,
16532 \circuitikzbasekey/bipole/voltage/position = above
16533 }
16534 }
16535
16536 \ctikzset{v^</.style = {
16537 v = #1,
16538 \circuitikzbasekey/bipole/voltage/direction = backward,
16539 \circuitikzbasekey/bipole/voltage/position = above
16540 }
16541 }
16542
16543 \ctikzset{v_>/.style = {
16544 v = #1,
16545 \circuitikzbasekey/bipole/voltage/direction = forward,
16546 \circuitikzbasekey/bipole/voltage/position = below
16547 }
16548 }
16549
16550 \ctikzset{v_</.style = {
16551 v = #1,
16552 \circuitikzbasekey/bipole/voltage/direction = backward,
16553 \circuitikzbasekey/bipole/voltage/position = below
16554 }
16555 }
16556
16557 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
16558 \ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
16559 \ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
16560 \ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
16561
16562 % Default position varies whether the component is a voltage source
16563 % or not
16564 \ctikzset{v/.code = {
16565 \ifpgf@circuit@bipole@isvoltage
16566 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
16567 \circuitikzbasekey/bipole/voltage/direction=forward}
16568 \else
16569 \ifpgf@circ@oldvoltagedirection
16570 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16571 \circuitikzbasekey/bipole/voltage/direction=backward}
16572 \else
16573 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16574 \circuitikzbasekey/bipole/voltage/direction=forward}
16575 \fi
16576 \fi
16577 \ifpgf@circ@oldvoltagedirection
16578 \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
16579 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16580 \circuitikzbasekey/bipole/voltage/direction=forward}
16581 \fi\fi
16582 \else
16583 \ifpgf@circuit@bipole@iscurrent
16584 \ifpgf@circuit@bipole@current@backward
16585 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16586 \circuitikzbasekey/bipole/voltage/direction=forward}
16587 \else
16588 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16589 \circuitikzbasekey/bipole/voltage/direction=backward}
16590 \fi\fi\fi
16591 \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
16592 \ctikzsetvalof{bipole/voltage/label/unit}{}
16593 \ifpgf@circ@siunitx
16594 \pgf@circ@handleSI{#1}
16595 \ifpgf@circ@siunitx@res
16596 \edef\pgf@temp{\pgf@circ@handleSI@val}
16597 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
16598 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16599 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
16600 \else
16601 \fi
16602 \else
16603 \fi
16604 }
16605 }
16606
16607 % american voltage font selection and symbol definition
16608 % the default font command is {} --- nothing
16609 \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
16610 %
16611 % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
16612 %
16613 \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
16614 \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
16615
16616 %%
16617 \def\setscaledRlenforclass{%
16618 \csname pgf@sh@ma@\ctikzvalof{bipole/name}\endcsname
16619 \ifdefined\ctikzclass
16620 \edef\pgf@temp{/tikz/circuitikz/\ctikzclass/scale}
16621 \pgfkeysifdefined{\pgf@temp}
16622 {\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16623 {\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}
16624 \else
16625 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
16626 \fi
16627 }
16628
16629 %% Output routine for generic bipoles
16630
16631 \def\pgf@circ@drawvoltagegeneric{
16632 \pgfextra{
16633 % \typeout{NAME:\ctikzvalof{bipole/name}}
16634 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}
16635 \pgfkeysifdefined{\pgf@temp}
16636 {
16637 \edef\partheight{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}}
16638 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
16639 }
16640 {
16641 \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
16642 {
16643 \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
16644 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
16645 }
16646 {%calculate default value from part height
16647 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
16648 \pgfkeysifdefined{\pgf@temp}
16649 {
16650 \edef\partheight{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
16651 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen+0.2\pgf@circ@scaled@Rlen)}
16652 }
16653 {
16654 \edef\tmpdistfromline{(.5\pgf@circ@scaled@Rlen)} %fallback to fixed value
16655 }
16656 }
16657 }
16658 % \typeout{KIND:\ctikzvalof{bipole/kind}\space RLEN:\the\pgf@circ@Rlen\space SCALED:\the\pgf@circ@scaled@Rlen}
16659 \ifnum \ctikzvalof{mirror value}=-1
16660 \ifpgf@circuit@bipole@inverted
16661 \ifpgf@circuit@bipole@voltage@straight
16662 \def\distfromline{\tmpdistfromline}
16663 \else
16664 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16665 \fi
16666 \else
16667 \ifpgf@circuit@bipole@voltage@straight
16668 \def\distfromline{-\tmpdistfromline}
16669 \else
16670 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16671 \fi
16672 \fi
16673 \else
16674 \ifpgf@circuit@bipole@inverted
16675 \ifpgf@circuit@bipole@voltage@straight
16676 \def\distfromline{-\tmpdistfromline}
16677 \else
16678 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16679 \fi
16680 \else
16681 \ifpgf@circuit@bipole@voltage@straight
16682 \def\distfromline{\tmpdistfromline}
16683 \else
16684 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16685 \fi
16686 \fi
16687 \fi
16688 \ifpgf@circuit@bipole@voltage@below
16689 \def\pgf@circ@voltage@angle{90}
16690 \else
16691 \def\pgf@circ@voltage@angle{-90}
16692 \fi
16693 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}
16694 \pgfkeysifdefined{\pgf@temp}
16695 { \edef\distancefromnode{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}} }
16696 { \edef\distancefromnode{\ctikzvalof{voltage/distance from node}} }
16697 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}
16698 \pgfkeysifdefined{\pgf@temp}
16699 { \edef\bumpb{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}} }
16700 { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
16701 \edef\shiftv{\ctikzvalof{voltage/shift}}
16702 \newdimen{\absvshift}
16703 \pgfmathsetlength{\absvshift}{\shiftv*\distfromline+\distfromline}
16704 % put this to true to see the voltage label coordinate anchors
16705 \newif\ifpgf@circ@debugv\pgf@circ@debugvfalse
16706 }
16707 % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow
16708 coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
16709 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorstartnode)$)
16710 coordinate (pgfcirc@Vfrom@flat) at (pgfcirc@midtmp)
16711 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
16712
16713 coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
16714 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorendnode)$)
16715 coordinate (pgfcirc@Vto@flat) at (pgfcirc@midtmp)
16716 coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
16717
16718 \ifpgf@circuit@bipole@voltage@below
16719 \ifpgf@circ@debugv
16720 node [ocirc, fill=red] at (anchorstartnode) {}
16721 node [ocirc, fill=blue] at (anchorendnode) {}
16722 node [ocirc, fill=green] at (pgfcirc@Vto) {}
16723 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
16724 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
16725 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
16726 \fi
16727 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! \absvshift!90 : (anchorendnode)$)
16728 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! \absvshift!-90 : (anchorstartnode)$)
16729 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
16730 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
16731 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! -\absvshift!90 : (pgfcirc@Vcont2t)$)
16732 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! -\absvshift!-90 : (pgfcirc@Vcont1t)$)
16733 \ifpgf@circ@debugv
16734 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
16735 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
16736 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
16737 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
16738 \fi
16739 \else
16740 \ifpgf@circ@debugv
16741 node [ocirc, fill=red] at (anchorstartnode) {}
16742 node [ocirc, fill=blue] at (anchorendnode) {}
16743 node [ocirc, fill=green] at (pgfcirc@Vto) {}
16744 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
16745 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
16746 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
16747 \fi
16748 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! -\absvshift!90 : (anchorendnode)$)
16749 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! -\absvshift!-90 : (anchorstartnode)$)
16750 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
16751 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
16752 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! \absvshift!90 : (pgfcirc@Vcont2t)$)
16753 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! \absvshift!-90 : (pgfcirc@Vcont1t)$)
16754 \ifpgf@circ@debugv
16755 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
16756 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
16757 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
16758 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
16759 \fi
16760 \fi
16761
16762 \ifpgf@circuit@europeanvoltage
16763 \ifpgf@circuit@bipole@voltage@straight
16764 \ifpgf@circuit@bipole@voltage@backward
16765 (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
16766 \else
16767 (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
16768 \fi
16769 \else
16770 \ifpgf@circuit@bipole@voltage@backward
16771 (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
16772 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
16773 (pgfcirc@Vfrom)
16774 \else
16775 (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
16776 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
16777 (pgfcirc@Vto)
16778 \fi
16779 \fi
16780 \else
16781 \ifpgf@circuit@bipole@voltage@backward
16782 \ifpgf@circ@oldvoltagedirection
16783 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16784 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16785 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16786 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16787 \else
16788 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16789 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16790 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16791 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16792 \fi
16793 \else
16794 \ifpgf@circ@oldvoltagedirection
16795 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16796 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16797 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16798 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16799 \else
16800 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16801 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16802 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16803 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16804 \fi
16805 \fi
16806 \fi
16807 }
16808
16809 %% Output routine for voltage sources
16810 \def\pgf@circ@drawvoltagegenerator{
16811 % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
16812 % it's not perfect, but I can't find the way to do it correctly...
16813 \pgfextra{
16814 \edef\shiftv{\ctikzvalof{voltage/shift}}
16815 \edef\bumpa{\ctikzvalof{voltage/bump a}}
16816 \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry.
16817 }
16818 \ifpgf@circuit@bipole@voltage@below
16819 coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
16820 coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
16821 \else
16822 coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
16823 coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
16824 \fi
16825 % fix the (unused in this case) Vcont1/2 coords for label placement along the line
16826 coordinate (pgfcirc@Vcont1) at (pgfcirc@Vto)
16827 coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom)
16828 \ifpgf@circuit@europeanvoltage
16829 \ifpgf@circuit@bipole@voltage@backward
16830 (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom)
16831 \else
16832 (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto)
16833 \fi
16834 \else% american voltage
16835 \ifpgf@circuit@bipole@voltageoutsideofsymbol
16836 % if it is a battery, must put + and -
16837
16838 \ifpgf@circ@fixbatteries
16839 \ifpgf@circuit@bipole@voltage@backward
16840 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16841 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16842 \else
16843 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16844 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16845 \fi
16846 \else
16847 \ifpgf@circuit@bipole@voltage@backward
16848 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16849 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16850 \else
16851 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16852 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16853 \fi
16854 \fi
16855 \fi
16856 \fi
16857 }
16858
16859 %% Output routine
16860 \def\pgf@circ@drawvoltage{% node name
16861 \pgfextra{ %WARNING: indentation is probably wrong
16862 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
16863 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
16864 \ifpgf@circuit@bipole@voltage@below
16865 \def\pgf@circ@bipole@voltage@label@anchor{north west}
16866 \else
16867 \def\pgf@circ@bipole@voltage@label@anchor{south east}
16868 \fi
16869 \fi\fi
16870 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
16871 \ifpgf@circuit@bipole@voltage@below
16872 \def\pgf@circ@bipole@voltage@label@anchor{west}
16873 \else
16874 \def\pgf@circ@bipole@voltage@label@anchor{east}
16875 \fi
16876 \fi\fi
16877 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
16878 \ifpgf@circuit@bipole@voltage@below
16879 \def\pgf@circ@bipole@voltage@label@anchor{south west}
16880 \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
16881 \fi
16882 \fi\fi
16883 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
16884 \ifpgf@circuit@bipole@voltage@below
16885 \def\pgf@circ@bipole@voltage@label@anchor{south}
16886 \else\def\pgf@circ@bipole@voltage@label@anchor{north}
16887 \fi
16888 \fi\fi
16889 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
16890 \ifpgf@circuit@bipole@voltage@below
16891 \def\pgf@circ@bipole@voltage@label@anchor{south east}
16892 \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
16893 \fi
16894 \fi\fi
16895 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
16896 \ifpgf@circuit@bipole@voltage@below
16897 \def\pgf@circ@bipole@voltage@label@anchor{east}
16898 \else \def\pgf@circ@bipole@voltage@label@anchor{west}
16899 \fi
16900 \fi\fi
16901 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
16902 \ifpgf@circuit@bipole@voltage@below
16903 \def\pgf@circ@bipole@voltage@label@anchor{north east}
16904 \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
16905 \fi
16906 \fi\fi
16907 \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
16908 \ifpgf@circuit@bipole@voltage@below
16909 \def\pgf@circ@bipole@voltage@label@anchor{north}
16910 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
16911 \fi
16912 \fi\fi
16913 \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
16914 \ifpgf@circuit@bipole@voltage@below
16915 \def\pgf@circ@bipole@voltage@label@anchor{north}
16916 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
16917 \fi
16918 \fi\fi
16919
16920 % this must be set *before* changing for mirroring and inverting; in that case
16921 % the xscale/yscale parameters take it into account
16922 \ifpgf@circuit@bipole@voltage@below
16923 \def\pgf@circ@bipole@voltage@label@where{-90}
16924 \else
16925 \def\pgf@circ@bipole@voltage@label@where{90}
16926 \fi
16927
16928 % magic to counteract the scale and yscale effects (there should be a better way...)
16929 \ifnum \ctikzvalof{mirror value}=-1
16930 \ifpgf@circuit@bipole@voltage@below
16931 \pgf@circuit@bipole@voltage@belowfalse
16932 \else
16933 \pgf@circuit@bipole@voltage@belowtrue
16934 \fi
16935 \fi
16936
16937 \ifpgf@circuit@bipole@inverted
16938 \ifpgf@circuit@bipole@voltage@below
16939 \pgf@circuit@bipole@voltage@belowfalse
16940 \else
16941 \pgf@circuit@bipole@voltage@belowtrue
16942 \fi
16943 \fi
16944
16945 % take into account scaling
16946 \setscaledRlenforclass
16947
16948 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}
16949 \pgfkeysifdefined{\pgf@temp}
16950 { \edef\eudist{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}} }
16951 { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
16952 % find the height of the bipole or use a default value
16953 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
16954 \pgfkeysifdefined{\pgf@temp}
16955 {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
16956 \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}}
16957 {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value
16958 \newdimen{\alshift}
16959 % this is more or less the same of the legacy code; we shift the american label a bit
16960 % outside the (+) -- (-) line
16961 \pgfmathsetlength{\alshift}{(\ctikzvalof{voltage/american label distance}-0.6)*\partheight}
16962 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
16963 }%end pgfextra
16964
16965 \ifpgf@circuit@bipole@isvoltage
16966 \pgf@circ@drawvoltagegenerator
16967 \else
16968 \pgf@circ@drawvoltagegeneric
16969 \fi
16970
16971 \ifpgf@circuit@bipole@voltage@straight
16972 coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
16973 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
16974 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
16975 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
16976 \else
16977 \ifpgf@circuit@europeanvoltage
16978 coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$)
16979 \else
16980 coordinate (Vlab) at ($(pgfcirc@Vfrom)!0.5!(pgfcirc@Vto)$)
16981 \ifpgf@circuit@bipole@isvoltage\else
16982 % add a bit of space for american labels above their symbols in the normal case. You can avoid that
16983 % with voltage/american label distance=0.5 (it's measured from the center of the component, in heights)
16984 coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$)
16985 \fi
16986 \fi
16987 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
16988 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
16989 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
16990 \fi
16991 }%end drawvoltages
16992 %%%---------- close: tex/pgfcircvoltage
16993 %%%%%%%%%%% Springe nach tex/pgfcirccurrent
16994 %%%---------- open: tex/pgfcirccurrent.tex
16995 % Copyright 2007-2009 by Massimo Redaelli
16996 %
16997 % This file may be distributed and/or modified
16998 %
16999 % 1. under the LaTeX Project Public License and/or
17000 % 2. under the GNU Public License.
17001 %
17002 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
17003
17004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17005 %% Current handling
17006
17007 %% styles
17008 \ctikzset{bipole current style/.style={}}
17009 \tikzset{bipole current style/.code={
17010 \ctikzset{bipole current style/.style={#1}}
17011 }}
17012 \tikzset{bipole current append style/.code={
17013 \ctikzset{bipole current style/.append style={#1}}
17014 }}
17015
17016 %% Options
17017 \ctikzset{i^>/.style = {
17018 i = #1,
17019 \circuitikzbasekey/bipole/current/direction = forward,
17020 \circuitikzbasekey/bipole/current/x position = after,
17021 \circuitikzbasekey/bipole/current/y position = above
17022 }
17023 }
17024
17025 \ctikzset{i_>/.style = {
17026 i = #1,
17027 \circuitikzbasekey/bipole/current/direction = forward,
17028 \circuitikzbasekey/bipole/current/x position = after,
17029 \circuitikzbasekey/bipole/current/y position = below
17030 }
17031 }
17032
17033 \ctikzset{i>^/.style = {
17034 i = #1,
17035 \circuitikzbasekey/bipole/current/direction = forward,
17036 \circuitikzbasekey/bipole/current/x position = before,
17037 \circuitikzbasekey/bipole/current/y position = above
17038 }
17039 }
17040
17041 \ctikzset{i>_/.style = {
17042 i = #1,
17043 \circuitikzbasekey/bipole/current/direction = forward,
17044 \circuitikzbasekey/bipole/current/x position = before,
17045 \circuitikzbasekey/bipole/current/y position = below
17046 }
17047 }
17048
17049 \ctikzset{i^</.style = {
17050 i = #1,
17051 \circuitikzbasekey/bipole/current/direction = backward,
17052 \circuitikzbasekey/bipole/current/x position = after,
17053 \circuitikzbasekey/bipole/current/y position = above
17054 }
17055 }
17056
17057 \ctikzset{i_</.style = {
17058 i = #1,
17059 \circuitikzbasekey/bipole/current/direction = backward,
17060 \circuitikzbasekey/bipole/current/x position = after,
17061 \circuitikzbasekey/bipole/current/y position = below
17062 }
17063 }
17064
17065 \ctikzset{i<^/.style = {
17066 i = #1,
17067 \circuitikzbasekey/bipole/current/direction = backward,
17068 \circuitikzbasekey/bipole/current/x position = before,
17069 \circuitikzbasekey/bipole/current/y position = above
17070 }
17071 }
17072
17073 \ctikzset{i<_/.style = {
17074 i = #1,
17075 \circuitikzbasekey/bipole/current/direction = backward,
17076 \circuitikzbasekey/bipole/current/x position = before,
17077 \circuitikzbasekey/bipole/current/y position = below
17078 }
17079 }
17080
17081 \ctikzset{i/.code = {
17082 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
17083 \circuitikzbasekey/bipole/current/x position = after,
17084 \circuitikzbasekey/bipole/current/y position = above }
17085 \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
17086 \ctikzsetvalof{bipole/current/label/unit}{}
17087 \ifpgf@circ@siunitx
17088 \pgf@circ@handleSI{#1}
17089 \ifpgf@circ@siunitx@res
17090 \edef\pgf@temp{\pgf@circ@handleSI@val}
17091 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
17092 \edef\pgf@temp{\pgf@circ@handleSI@unit}
17093 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
17094 \else
17095 \fi
17096 \else
17097 \fi
17098 %reverse current direction for voltage sources
17099 \ifpgf@circ@oldvoltagedirection\else
17100 \ifpgf@circuit@bipole@isvoltage
17101 \ifpgf@circuit@bipole@voltage@backward
17102 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
17103 \circuitikzbasekey/bipole/current/x position = after,
17104 \circuitikzbasekey/bipole/current/y position = below }
17105 \else
17106 \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
17107 \circuitikzbasekey/bipole/current/x position = before,
17108 \circuitikzbasekey/bipole/current/y position = above }
17109 \fi\fi\fi
17110 }
17111 }
17112
17113 \ifpgf@circ@oldvoltagedirection
17114 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
17115 \else
17116 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
17117 \fi
17118 \ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
17119 \ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
17120 \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
17121
17122 %% Output routine
17123 \def\pgf@circ@drawcurrent{
17124 \pgfextra{
17125 \edef\pgf@circ@ffffff{\pgf@circ@direction}
17126 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
17127
17128 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
17129 \ifpgf@circuit@bipole@current@below
17130 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
17131 \fi
17132 \fi\fi
17133 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
17134 \ifpgf@circuit@bipole@current@below
17135 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
17136 \fi
17137 \fi\fi
17138 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
17139 \ifpgf@circuit@bipole@current@below
17140 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
17141 \fi
17142 \fi\fi
17143 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
17144 \ifpgf@circuit@bipole@current@below
17145 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
17146 \fi
17147 \fi\fi
17148 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
17149 \ifpgf@circuit@bipole@current@below
17150 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
17151 \fi
17152 \fi\fi
17153 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
17154 \ifpgf@circuit@bipole@current@below
17155 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
17156 \fi
17157 \fi\fi
17158 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
17159 \ifpgf@circuit@bipole@current@below
17160 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
17161 \fi
17162 \fi\fi
17163 \ifnum\pgfcircmathresult <5
17164 \ifpgf@circuit@bipole@current@below
17165 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17166 \fi
17167 \fi
17168 \ifnum\pgfcircmathresult >355
17169 \ifpgf@circuit@bipole@current@below
17170 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17171 \fi
17172 \fi
17173
17174 \ifpgf@circuit@bipole@current@below
17175 \def\pgf@circ@bipole@current@label@where{-90}
17176 \else
17177 \def\pgf@circ@bipole@current@label@where{+90}
17178 \fi
17179 }
17180
17181 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
17182 \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
17183 (\tikztostart)--(\tikztotarget)
17184 \else% normal bipole or source
17185 \ifpgf@circuit@bipole@current@before
17186 (\tikztostart)--(anchorstartnode)
17187 \else
17188 (anchorendnode)--(\tikztotarget)
17189 \fi
17190 \fi
17191 \ifpgf@circuit@bipole@current@backward
17192 \pgfextra{
17193 \pgfmathsubtract{\pgf@circ@ffffff}{180}
17194 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
17195 }
17196 \fi
17197 coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff,
17198 anchor=center](Iarrow)
17199 (Iarrow.\pgf@circ@bipole@current@label@where)
17200 node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
17201 (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}}
17202 }
17203
17204 %%%---------- close: tex/pgfcirccurrent
17205 %%%%%%%%%%% Springe nach tex/pgfcircflow
17206 %%%---------- open: tex/pgfcircflow.tex
17207 % Copyright 2007-2009 by Massimo Redaelli
17208 %
17209 % This file may be distributed and/or modified
17210 %
17211 % 1. under the LaTeX Project Public License and/or
17212 % 2. under the GNU Public License.
17213 %
17214 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
17215
17216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17217 %% flow handling
17218
17219 %% styles
17220 \ctikzset{bipole flow style/.style={}}
17221 \tikzset{bipole flow style/.code={
17222 \ctikzset{bipole flow style/.style={#1}}
17223 }}
17224 \tikzset{bipole flow append style/.code={
17225 \ctikzset{bipole flow style/.append style={#1}}
17226 }}
17227
17228 %% Options
17229 \ctikzset{f^>/.style = {
17230 f = #1,
17231 \circuitikzbasekey/bipole/flow/direction = forward,
17232 \circuitikzbasekey/bipole/flow/x position = after,
17233 \circuitikzbasekey/bipole/curflowrent/y position = above
17234 }
17235 }
17236
17237 \ctikzset{f_>/.style = {
17238 f = #1,
17239 \circuitikzbasekey/bipole/flow/direction = forward,
17240 \circuitikzbasekey/bipole/flow/x position = after,
17241 \circuitikzbasekey/bipole/flow/y position = below
17242 }
17243 }
17244
17245 \ctikzset{f>^/.style = {
17246 f = #1,
17247 \circuitikzbasekey/bipole/flow/direction = forward,
17248 \circuitikzbasekey/bipole/flow/x position = before,
17249 \circuitikzbasekey/bipole/flow/y position = above
17250 }
17251 }
17252
17253 \ctikzset{f>_/.style = {
17254 f = #1,
17255 \circuitikzbasekey/bipole/flow/direction = forward,
17256 \circuitikzbasekey/bipole/flow/x position = before,
17257 \circuitikzbasekey/bipole/flow/y position = below
17258 }
17259 }
17260
17261 \ctikzset{f^</.style = {
17262 f = #1,
17263 \circuitikzbasekey/bipole/flow/direction = backward,
17264 \circuitikzbasekey/bipole/flow/x position = after,
17265 \circuitikzbasekey/bipole/flow/y position = above
17266 }
17267 }
17268
17269 \ctikzset{f_</.style = {
17270 f = #1,
17271 \circuitikzbasekey/bipole/flow/direction = backward,
17272 \circuitikzbasekey/bipole/flow/x position = after,
17273 \circuitikzbasekey/bipole/flow/y position = below
17274 }
17275 }
17276
17277 \ctikzset{f<^/.style = {
17278 f = #1,
17279 \circuitikzbasekey/bipole/flow/direction = backward,
17280 \circuitikzbasekey/bipole/flow/x position = before,
17281 \circuitikzbasekey/bipole/flow/y position = above
17282 }
17283 }
17284
17285 \ctikzset{f<_/.style = {
17286 f = #1,
17287 \circuitikzbasekey/bipole/flow/direction = backward,
17288 \circuitikzbasekey/bipole/flow/x position = before,
17289 \circuitikzbasekey/bipole/flow/y position = below
17290 }
17291 }
17292
17293 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
17294 \ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
17295 \ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
17296 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
17297
17298 \ctikzset{f/.code = {
17299 \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
17300 \circuitikzbasekey/bipole/flow/x position = after,
17301 \circuitikzbasekey/bipole/flow/y position = above }
17302 \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
17303 \ctikzsetvalof{bipole/flow/label/unit}{}
17304 \ifpgf@circ@siunitx
17305 \pgf@circ@handleSI{#1}
17306 \ifpgf@circ@siunitx@res
17307 \edef\pgf@temp{\pgf@circ@handleSI@val}
17308 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
17309 \edef\pgf@temp{\pgf@circ@handleSI@unit}
17310 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
17311 \else
17312 \fi
17313 \else
17314 \fi
17315 }
17316 }
17317
17318 %% Output routine
17319 \def\pgf@circ@drawflow{
17320 \pgfextra{
17321 \edef\pgf@circ@ffffff{\pgf@circ@direction}
17322 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
17323
17324 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
17325 \ifpgf@circuit@bipole@flow@below
17326 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
17327 \fi
17328 \fi\fi
17329 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
17330 \ifpgf@circuit@bipole@flow@below
17331 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
17332 \fi
17333 \fi\fi
17334 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
17335 \ifpgf@circuit@bipole@flow@below
17336 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
17337 \fi
17338 \fi\fi
17339 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
17340 \ifpgf@circuit@bipole@flow@below
17341 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
17342 \fi
17343 \fi\fi
17344 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
17345 \ifpgf@circuit@bipole@flow@below
17346 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
17347 \fi
17348 \fi\fi
17349 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
17350 \ifpgf@circuit@bipole@flow@below
17351 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
17352 \fi
17353 \fi\fi
17354 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
17355 \ifpgf@circuit@bipole@flow@below
17356 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
17357 \fi
17358 \fi\fi
17359 \ifnum\pgfcircmathresult <5
17360 \ifpgf@circuit@bipole@flow@below
17361 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17362 \fi
17363 \fi
17364 \ifnum\pgfcircmathresult >355
17365 \ifpgf@circuit@bipole@flow@below
17366 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17367 \fi
17368 \fi
17369
17370 \ifpgf@circuit@bipole@flow@below
17371 \def\pgf@circ@bipole@flow@label@where{-90}
17372 \else
17373 \def\pgf@circ@bipole@flow@label@where{+90}
17374 \fi
17375 }
17376
17377 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
17378 \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
17379 (\tikztostart)--(\tikztotarget)
17380 \else% normal bipole or source
17381 \ifpgf@circuit@bipole@flow@before
17382 (\tikztostart)--(anchorstartnode)
17383 \else
17384 (anchorendnode)--(\tikztotarget)
17385 \fi
17386 \fi
17387 \pgfextra{
17388 \ifpgf@circuit@bipole@flow@backward
17389 \ifpgf@circuit@bipole@flow@below
17390 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17391 \else
17392 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17393 \fi
17394 \pgfmathsubtract{\pgf@circ@ffffff}{180}
17395 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
17396 \else
17397 \ifpgf@circuit@bipole@flow@below
17398 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17399 \else
17400 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17401 \fi
17402 \fi
17403 }
17404 coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos)
17405 (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
17406 (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}}
17407 }
17408
17409 %%%---------- close: tex/pgfcircflow
17410
17411 % notice that the default is nooldvoltagedirection; it's not explicitly set to allow for the warning
17412 \ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
17413
17414 \ProcessOptions\relax
17415
17416 %%%%%%%%%%% Springe nach tex/pgfcircpath
17417 %%%---------- open: tex/pgfcircpath.tex
17418
17419 \def\pgf@circ@direction{0.0}
17420
17421 % Names
17422 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
17423 \ctikzset{n/.code = {
17424 \pgfkeys{/tikz/circuitikz/bipole/name=#1}
17425 }}
17426
17427 % Reflect the node along
17428 \ctikzset{mirrored/.is choice}
17429 \ctikzset{mirror value/.initial=1}
17430 \ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
17431 \ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
17432 \ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
17433
17434 % Invert node along path
17435 \ctikzset{inverted/.is choice}
17436 \ctikzset{invert value/.initial=1}
17437 \ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
17438 \ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
17439 \ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
17440 \newif\ifpgf@circuit@bipole@inverted
17441 \ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
17442
17443 \newif\ifpgf@circuit@bipole@voltage@backward
17444 \ctikzset{bipole/voltage/direction/.is choice}
17445 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
17446 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
17447
17448 % Initialize paths
17449 \def\pgfcircresetpath{
17450 \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
17451 bipole/inverted=false, bipole/kind=,
17452 bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
17453 bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
17454 bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
17455 bipole/current/y position=above, bipole/current/direction=forward,
17456 mirrored=false
17457 }
17458 }
17459
17460 %% Helper function for path-function to ensure using anchors between nodes
17461 \def\set@explicit@center@anchor#1{
17462 \pgfutil@ifundefined{pgf@sh@ns@#1}
17463 {
17464 %This coordinate is no node(but a relative position or a coordinate), no further handling needed
17465 }{
17466 \pgfutil@in@.{#1}
17467 \ifpgfutil@in@
17468 % Anchor is used, do nothing!
17469 \else%
17470 \let\tikz@moveto@waiting=\relax
17471 \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
17472 \edef#1{#1.center}%ensure using center anchor
17473 \fi
17474 }
17475 }
17476
17477
17478 %% Generic bipole path
17479 %% I am not user what the second argument is needed for
17480 \def\pgf@circ@bipole@path#1#2{
17481
17482 \pgfextra{
17483 \set@explicit@center@anchor{\tikztostart}
17484 \set@explicit@center@anchor{\tikztotarget}
17485 \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
17486 \ctikzset{bipole/kind = #1}
17487 \edef\pgf@temp{\ctikzvalof{bipole/name}}
17488 \def\pgf@circ@temp{}
17489 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
17490 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
17491 \ctikzset{bipole/name = #1\pgf@circ@rand} % create it (re-usage should not create problem, but...)
17492 \fi
17493 }
17494
17495 (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
17496 (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
17497 \pgfextra{
17498 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
17499 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
17500 \pgfmathround{\pgfmathresult}
17501 \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
17502 \pgfsyssoftpath@setcurrentpath{\myp@th}
17503 }
17504 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17505 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17506 \else
17507 --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
17508 \fi
17509 ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
17510 node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
17511 (\ctikzvalof{bipole/name}) {}
17512 \ifpgf@circuit@bipole@inverted
17513 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
17514 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
17515 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
17516 \else
17517 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
17518 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
17519 \fi
17520 \else
17521 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
17522 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
17523 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
17524 \else
17525 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
17526 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
17527 \fi
17528 \fi
17529 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17530 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17531 \else
17532 (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
17533 (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
17534 \fi
17535
17536 \drawpoles
17537 \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
17538 \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
17539 \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
17540 \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
17541 \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
17542 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17543 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17544 (\ctikzvalof{bipole/name}end)%Move to end of path
17545 \else
17546 ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
17547 %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
17548
17549 \fi
17550 % reset
17551 \pgfextra{
17552 \pgfcircresetpath
17553 }
17554 \tikztonodes%draw pending nodes an path
17555 }
17556
17557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17558 %% Handling of terminals
17559
17560 \ctikzset{bipole/nodes/.is family}
17561 \ctikzset{bipole/nodes/left/.initial=none}
17562 \ctikzset{bipole/nodes/right/.initial=none}
17563 \tikzset{bipole nodes/.style n args={2}{%
17564 \circuitikzbasekey/bipole/nodes/left=#1,
17565 \circuitikzbasekey/bipole/nodes/right=#2
17566 }
17567 }
17568
17569 %% Easily usable styles
17570
17571 \ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17572 \ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17573 \ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
17574 \ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17575 \ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
17576 \ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17577 \ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17578 \ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
17579 \ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
17580 \ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
17581 \ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17582 \ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
17583 \ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
17584 \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17585 \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17586
17587 % rectjoinfill workarounds
17588
17589 \ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
17590 \ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
17591 \ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17592 \ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17593 \ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17594 \ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17595 \ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17596 \ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17597 \ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17598
17599 \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
17600
17601 \def\drawpoles{
17602 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
17603 \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
17604 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
17605 \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
17606 }
17607
17608 %% Path definitions
17609 \def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
17610 \def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
17611 \def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
17612 \def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
17613 \def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
17614 \def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
17615 \def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
17616 \def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
17617 \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
17618 \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
17619 \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
17620 %% polar capacitor is deprectaed, use curved capacitor instead
17621 \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
17622 \def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}}
17623 \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
17624 \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
17625 \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
17626 \def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
17627 \def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
17628 \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
17629 \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
17630 \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
17631 \def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
17632 \def\pgf@circ@inductor@path#1{%
17633 \pgfextra{
17634 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17635 \def\pgf@temp{european}%
17636 }
17637 \ifx\pgf@temp\pgf@circ@temp%
17638 \pgf@circ@europeaninductor@path{#1}%
17639 \else%
17640 \pgfextra{ \def\pgf@temp{cute} }%
17641 \ifx\pgf@temp\pgf@circ@temp%
17642 \pgf@circ@cuteinductor@path{#1}%
17643 \else%
17644 \pgf@circ@americaninductor@path{#1}%
17645 \fi%
17646 \fi%
17647 }
17648 \def\pgf@circ@vinductor@path#1{
17649 \pgfextra{
17650 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17651 \def\pgf@temp{european}%
17652 }
17653 \ifx\pgf@temp\pgf@circ@temp%
17654 \pgf@circ@veuropeaninductor@path{#1}%
17655 \else%
17656 \pgfextra{ \def\pgf@temp{cute} }%
17657 \ifx\pgf@temp\pgf@circ@temp%
17658 \pgf@circ@vcuteinductor@path{#1}%
17659 \else%
17660 \pgf@circ@vamericaninductor@path{#1}%
17661 \fi%
17662 \fi%
17663 }
17664 \def\pgf@circ@inductivesens@path#1{%
17665 \pgfextra{
17666 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17667 \def\pgf@temp{european}%
17668 }
17669 \ifx\pgf@temp\pgf@circ@temp%
17670 \pgf@circ@europeaninductivesens@path{#1}%
17671 \else%
17672 \pgfextra{ \def\pgf@temp{cute} }%
17673 \ifx\pgf@temp\pgf@circ@temp%
17674 \pgf@circ@cuteinductivesens@path{#1}%
17675 \else%
17676 \pgf@circ@americaninductivesens@path{#1}%
17677 \fi%
17678 \fi%
17679 }
17680 \def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
17681 \def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
17682 \def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
17683 \def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
17684 \def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
17685 \def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
17686 \def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
17687 \def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
17688 \def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
17689 \def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
17690 \def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
17691 \def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
17692 \def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
17693 \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
17694 \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
17695 \def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
17696 \def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
17697 \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
17698 \def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
17699 \def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
17700 \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
17701 \def\pgf@circ@ecsource@path#1{\pgf@circ@bipole@path{ecsource}{#1}}
17702 \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
17703 \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
17704 \def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
17705 \def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
17706 \def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
17707 \def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
17708 \def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
17709 \def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
17710 \def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
17711 \def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
17712 \def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
17713 \def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
17714 \def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
17715 \def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
17716 \def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
17717 \def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
17718 \def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
17719 \def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
17720 \def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
17721 \def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
17722 \def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
17723 \def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
17724 \def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
17725 \def\pgf@circ@empty@path#1{}
17726 \def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
17727 \def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
17728 \def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
17729 \def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
17730 \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
17731 \def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
17732 \def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
17733 \def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
17734 \def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
17735 \def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
17736 \def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
17737 \def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
17738 \def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
17739 \def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
17740
17741 \def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
17742 \def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
17743 \def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
17744
17745 \def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
17746 \def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
17747 \def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
17748 \def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
17749 \def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
17750 \def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
17751 \def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
17752 \def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
17753 \def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
17754 \def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
17755 \def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
17756 \def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
17757 \def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
17758 \def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
17759 \def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
17760 \def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
17761 \def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
17762 \def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
17763 \def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
17764
17765 %%Mechanical
17766 \def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
17767 \def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
17768 \def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
17769 \def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
17770
17771 %% Styles
17772
17773 \def\comnpatname{\ifpgf@circuit@compat *\else\fi}
17774 \def\compattikzset#1{\tikzset{\comnpatname#1}}
17775
17776 %\def\ctikzsetbipole#1#2{%
17777 % \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
17778 %}
17779
17780 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
17781 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
17782 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
17783 \compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
17784 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
17785 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
17786 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
17787 \compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
17788 \compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
17789 \compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
17790 \compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
17791 \compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
17792 \compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
17793 \compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
17794 \compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
17795 \compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
17796 \compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
17797 \compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
17798 \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
17799 \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
17800 \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
17801 % polar capacitor is deprecated, use curved capacitor instead
17802 \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
17803 \compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}}
17804 \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
17805 \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
17806 \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17807 \compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17808 \compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17809 \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
17810 \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
17811 \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
17812 \compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
17813 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
17814 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
17815 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
17816 \compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
17817 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
17818 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
17819 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
17820 \compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
17821 \compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
17822 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
17823 \compattikzset{transmission line/.style = {tline = #1}}
17824 \compattikzset{TL/.style = {tline = #1}}
17825 \compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
17826 \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}}
17827 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17828 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17829 \compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17830 \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}}
17831 \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}}
17832 \compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17833 \compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17834 \compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17835 \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 }}
17836 \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 }}
17837 \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 }}
17838 \compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17839 \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}}
17840 \compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17841
17842 \compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17843 \compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
17844 \compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17845 \compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
17846
17847
17848 \compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
17849 \compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
17850 \compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
17851 \compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
17852 \compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
17853 \compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
17854 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
17855
17856 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
17857 \compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
17858
17859 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
17860 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
17861 \compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
17862 \compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
17863 \compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
17864
17865 \compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
17866 \compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
17867 \compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
17868 \compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
17869 \compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
17870 \compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
17871 \compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
17872 \compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
17873 \compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
17874 \compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
17875 \compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
17876 \compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
17877 \compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
17878 \compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
17879 \compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
17880 \compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
17881 \compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
17882 \compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
17883 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
17884
17885 % % % % % %
17886 % % Begin of Diodes
17887 % % % % % %
17888
17889 \def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
17890 \def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
17891 \def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
17892 \def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
17893 \def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
17894 \def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
17895 \def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
17896 \def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
17897 \def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
17898 \def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
17899 \def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
17900 \def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
17901 \def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
17902 \def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
17903 \def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
17904 \def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
17905 \def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
17906 \def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
17907
17908 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
17909 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
17910 \compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
17911 \compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
17912 \compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
17913 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
17914 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
17915 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
17916 \compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
17917 \compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
17918 \compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
17919
17920 \compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
17921 \compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
17922 \compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
17923 \compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
17924 \compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
17925 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
17926 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
17927 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
17928 \compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
17929 \compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
17930 \compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
17931
17932 \compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
17933 \compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
17934 \compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
17935 \compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
17936 \compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
17937 \compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
17938 \compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
17939 \compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
17940 \compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
17941 %\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
17942
17943 \def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
17944
17945 \compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
17946 \compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
17947 \compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
17948 \compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
17949 \compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
17950 \compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
17951 \compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
17952 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
17953 \compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
17954 \compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
17955 \compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
17956
17957 %% Define Shortcuts
17958 \compattikzset{Do/.style = {\comnpatname empty diode}}
17959 \compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
17960 \compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
17961 \compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
17962 \compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
17963 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
17964 \compattikzset{leDo/.style = {\comnpatname empty led}}
17965 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
17966 \compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
17967 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
17968 \compattikzset{Tro/.style = {\comnpatname empty triac}}
17969
17970 \compattikzset{D*/.style = {\comnpatname full diode}}
17971 \compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
17972 \compattikzset{zD*/.style = {\comnpatname full Zener diode}}
17973 \compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
17974 \compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
17975 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
17976 \compattikzset{leD*/.style = {\comnpatname full led}}
17977 \compattikzset{VC*/.style = {\comnpatname full varcap}}
17978 \compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
17979 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
17980 \compattikzset{Tr*/.style = {\comnpatname full triac}}
17981
17982 \compattikzset{D/.style = {\comnpatname diode}}
17983 \compattikzset{tD/.style = {\comnpatname tunnel diode}}
17984 \compattikzset{zD/.style = {\comnpatname Zener diode}}
17985 \compattikzset{zzD/.style = {\comnpatname ZZener diode}}
17986 \compattikzset{sD/.style = {\comnpatname Schottky diode}}
17987 \compattikzset{pD/.style = {\comnpatname photodiode}}
17988 \compattikzset{leD/.style = {\comnpatname led}}
17989 \compattikzset{VC/.style = {\comnpatname varcap}}
17990 \compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
17991 \compattikzset{Ty/.style = {\comnpatname thyristor}}
17992 \compattikzset{Tr/.style = {\comnpatname triac}}
17993
17994 \compattikzset{D-/.style = {\comnpatname stroke diode}}
17995 \compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
17996 \compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
17997 \compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
17998 \compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
17999 \compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
18000 \compattikzset{leD-/.style = {\comnpatname stroke led}}
18001 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
18002 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
18003 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
18004 \compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
18005
18006 % % % % % %
18007 % % End of Diodes
18008 % % % % % %
18009
18010
18011 \compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
18012 \compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
18013 \compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
18014 \compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
18015 \compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
18016 \compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
18017 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
18018 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
18019 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
18020 \compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
18021 \compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
18022 \compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
18023 \compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
18024 \compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
18025
18026 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
18027 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
18028 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
18029 \tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
18030
18031 % cute switches
18032 %% closed cute switch
18033 \def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
18034 \compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
18035 \compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
18036
18037 %% open cute switch
18038 \def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
18039 \compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
18040 \compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
18041
18042 %% closing cute switch
18043 \def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
18044 \compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
18045 \compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
18046
18047 %% opening cute switch
18048 \def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
18049 \compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
18050 \compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
18051
18052
18053 % short forms
18054 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
18055 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
18056 \compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
18057 \compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
18058
18059 \compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
18060 \compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
18061
18062 \compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
18063 \compattikzset{isource/.style = {\comnpatname current source = #1}}
18064 \compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
18065 \compattikzset{ecsource/.style = {\comnpatname empty controlled source = #1}}
18066 \compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
18067 \compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
18068 \compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
18069 \compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
18070 \compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
18071 \compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
18072 \compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
18073
18074 \compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
18075 \compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
18076 \compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
18077 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
18078
18079 \compattikzset{R/.style= {\comnpatname resistor = #1}}
18080 \compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
18081 \compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
18082 \compattikzset{thR/.style= {\comnpatname thermistor = #1}}
18083 \compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
18084 \compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
18085 \compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
18086 \compattikzset{C/.style = {\comnpatname capacitor = #1}}
18087 \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
18088 %% pC is deprecated, use cC instead
18089 \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
18090 \compattikzset{cC/.style = {\comnpatname curved capacitor = #1}}
18091 \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
18092 \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
18093 \compattikzset{L/.style = {\comnpatname inductor = #1}}
18094 \compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
18095 \compattikzset{V/.style = {\comnpatname voltage source = #1}}
18096 \compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
18097 \compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
18098 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
18099 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
18100 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
18101 \def\pgf@temp#1{
18102 \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
18103 \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
18104 \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
18105 \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
18106 }
18107 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
18108 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
18109
18110 %current sources
18111 \compattikzset{I/.style = {\comnpatname current source = #1}}
18112 \compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
18113 \compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
18114 \compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
18115 \def\pgf@temp#1{
18116 \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
18117 \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
18118 \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
18119 \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
18120 }
18121 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
18122 \pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
18123 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
18124
18125 % cute sources
18126 \def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
18127 \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}}
18128 \compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
18129 \compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
18130
18131 \def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
18132 \compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
18133 \compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
18134 \compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
18135
18136 \def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
18137 \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}}
18138 \compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
18139 \compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
18140
18141 \def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
18142 \compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
18143 \compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
18144 \compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
18145
18146 % noise sources
18147 \def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
18148 \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}}
18149 \compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
18150 \compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
18151
18152 \def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
18153 \compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
18154 \compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
18155 \compattikzset{nI/.style= {\comnpatname noise current source= #1}}
18156
18157 % resistive sensor american style
18158 \def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
18159 \compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
18160 \compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
18161 \compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
18162 \compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
18163
18164 \compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
18165 \compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
18166
18167 \compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
18168 \compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
18169 \compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
18170 \compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
18171 \compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
18172
18173 \compattikzset{Mr/.style = {\comnpatname memristor}}
18174
18175 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
18176 \compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
18177 \compattikzset{spst/.style = {\comnpatname switch = #1}}
18178
18179 \compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
18180
18181 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
18182 \compattikzset{vss/.style = {\comnpatname vee = #1}}
18183
18184 % activate the to-style crossing
18185 \def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
18186 \compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
18187 \compattikzset{xing/.style= {\comnpatname crossing= #1}}
18188
18189 %% loudspeaker and microphone
18190
18191 \def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
18192 \compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
18193
18194 \def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
18195 \compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
18196
18197 % more instrument
18198 \def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
18199 \compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
18200 \def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
18201 \compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
18202 \def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
18203 \compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
18204 % current loop probes
18205 \def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
18206 \compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
18207 \def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
18208 \compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
18209 % qucs-style probes
18210 \def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
18211 \compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
18212 \def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
18213 \compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
18214 \def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
18215 \compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
18216
18217
18218 % Transistor like bipoles
18219
18220 \def\pgf@circ@trans@path#1#2{
18221 \pgfextra{
18222 \edef\pgf@temp{\ctikzvalof{bipole/name}}
18223 \def\pgf@circ@temp{#2}
18224 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
18225 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
18226 \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
18227 \fi
18228 }
18229 \ifpgf@circuit@bipole@inverted
18230 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
18231 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
18232 \else
18233 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
18234 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
18235 \fi
18236 \pgfextra{
18237 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
18238 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
18239 \pgfmathadd{\pgfmathresult}{-90}
18240 \pgfmathround{\pgfmathresult}
18241 \edef\pgf@circ@direction{\pgfmathresult}
18242 }
18243 ($(\tikztostart) ! .5 ! (\tikztotarget)$)
18244 node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
18245 (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
18246 \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
18247 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
18248 (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
18249 \else
18250 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
18251 (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
18252 \fi
18253 \drawpoles
18254 \pgfextra{
18255 \pgfcircresetpath
18256 }
18257 (\tikztotarget) \tikztonodes % e si continua
18258 }
18259
18260
18261 \def\pgf@circ@definetranspath#1{
18262 \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
18263 }
18264
18265 \pgf@circ@definetranspath{elmech}
18266 \pgf@circ@definetranspath{nmos}
18267 \pgf@circ@definetranspath{pmos}
18268 \pgf@circ@definetranspath{hemt}
18269 \pgf@circ@definetranspath{npn}
18270 \pgf@circ@definetranspath{pnp}
18271 \pgf@circ@definetranspath{nfet}
18272 \pgf@circ@definetranspath{nigfete}
18273 \pgf@circ@definetranspath{nigfetd}
18274 \pgf@circ@definetranspath{nigfetebulk}
18275 \pgf@circ@definetranspath{pfet}
18276 \pgf@circ@definetranspath{pigfete}
18277 \pgf@circ@definetranspath{pigfetd}
18278 \pgf@circ@definetranspath{pigfetebulk}
18279 \pgf@circ@definetranspath{njfet}
18280 \pgf@circ@definetranspath{pjfet}
18281 \pgf@circ@definetranspath{pigbt}
18282 \pgf@circ@definetranspath{nigbt}
18283 \pgf@circ@definetranspath{Lpigbt}
18284 \pgf@circ@definetranspath{Lnigbt}
18285 %%%---------- close: tex/pgfcircpath
18286
18287 \ifpgf@circ@siunitx
18288 \RequirePackage{xstring}[2009/03/13]
18289 %\expandafter\let\csname angstrom\endcsname\relax
18290 \RequirePackage{siunitx}
18291 \fi
18292
18293 \ifpgf@circ@explicitvdir\else
18294 \PackageWarningNoLine{circuitikz}{%
18295 You did not specify one of the voltage directions:\MessageBreak
18296 \space\space oldvoltagedirection, nooldvoltagedirection, \MessageBreak
18297 \space\space RPvoltages or EFvoltages \MessageBreak
18298 Default directions may have changed, \MessageBreak
18299 please check the manual%
18300 }
18301 \fi
18302
18303 \newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
18304 %override (unused) circuitikz environment for compability to externalization)
18305 \let\circuitikz\tikzpicture
18306 \let\endcircuitikz\endtikzpicture
18307
18308 \endinput